> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tofunmiadewuyi.com/custos/llms.txt
> Use this file to discover all available pages before exploring further.

# Request access to a gated credential

> For credentials with `requires_permission`. A request never creates authority — the requester must already reach the credential through a direct or group `credential.read` grant. Admins cannot file one; they already have access.




## OpenAPI

````yaml /custos/openapi.yaml post /credentials/{id}/permission-requests
openapi: 3.1.0
info:
  title: Custos control-plane API
  version: 0.1.0
  description: >
    Seed specification. The auth, identity, key, host-list, and grant endpoints
    below are

    complete; the remaining control-plane endpoints are still being transcribed.
servers:
  - url: https://custos.example.com
    description: Your control plane
security:
  - bearerAuth: []
tags:
  - name: Auth
    description: Login, token refresh, and logout.
  - name: Identity
    description: The authenticated user.
  - name: Keys
    description: A user's SSH public keys.
  - name: Credentials
    description: Stored secrets, sealed at rest and audited on every read.
  - name: Permission requests
    description: Time-boxed access requests for gated credentials.
  - name: Sets
    description: >-
      Secret sets — an app's .env, either deployable (private) or team-shared
      (public).
  - name: Hosts
    description: Enrolled machines.
  - name: Health
    description: Liveness and readiness probes.
  - name: Notifications
    description: In-app notifications for the signed-in user.
  - name: Rotation reviews
    description: Credential rotation checklists raised when a user is suspended or removed.
  - name: Audit
    description: Install-wide trails.
  - name: Users
    description: Accounts and their lifecycle.
  - name: Invitations
    description: Onboarding new accounts.
  - name: Groups
    description: Resource groups — a grant on a group cascades to everything in it.
  - name: Grants
    description: Permission grants.
  - name: Enrollment
    description: Admitting a machine to the fleet. Daemon-facing.
  - name: Upgrades
    description: Rolling the daemon fleet forward.
paths:
  /credentials/{id}/permission-requests:
    post:
      tags:
        - Permission requests
      summary: Request access to a gated credential
      description: >
        For credentials with `requires_permission`. A request never creates
        authority — the requester must already reach the credential through a
        direct or group `credential.read` grant. Admins cannot file one; they
        already have access.
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '201':
          description: The pending request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionRequest'
        '400':
          description: Caller is an admin, or the id is invalid
        '403':
          description: No underlying `credential.read` grant
        '404':
          description: Not found
        '409':
          description: >
            Nothing to request. Either the credential is not gated, or access is
            already active, or a request from you is already pending — only one
            at a time per requester and credential. After a rejection or an
            expiry you may ask again.
components:
  schemas:
    PermissionRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
        requester:
          $ref: '#/components/schemas/Actor'
        resource_id:
          type: string
          format: uuid
        resource_type:
          type: string
        resource_name:
          type: string
        approval_status:
          type: string
          enum:
            - pending
            - approved
            - rejected
        ttl_seconds:
          type: integer
        reviewer:
          $ref: '#/components/schemas/Actor'
        reviewed_at:
          type: string
          format: date-time
        expires_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
    Actor:
      type: object
      nullable: true
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        display_name:
          type: string
        email:
          type: string
          format: email
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        An opaque access token from /login or /refresh. Tokens are checked
        against the database on every request, so revocation is immediate.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.