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

# Post agents permissions



## OpenAPI

````yaml /openapi.json post /agents/{agentId}/permissions
openapi: 3.1.1
info:
  title: Anima API
  version: 0.1.0
  description: >-
    The Anima API provides programmatic access to unified infrastructure for AI
    agents: create and manage agents; send and receive email; place phone calls
    and send/receive SMS and voice; store and retrieve vault credentials; manage
    agent identity; and configure webhooks for real-time events. Authenticate
    using a Bearer token or an API key passed via the X-API-Key header.
  contact:
    name: Anima Labs
    url: https://useanima.sh
    email: support@useanima.sh
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: https://api.useanima.sh/v1
    description: Production
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /agents/{agentId}/permissions:
    post:
      operationId: agentPermission.set
      parameters:
        - name: agentId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
            description: Agent to change
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                procedurePath:
                  type: string
                  minLength: 1
                  description: Procedure to set. Omit when setting bypassReads.
                state:
                  enum:
                    - ASK
                    - ALWAYS_ALLOW
                    - NEVER
                  type: string
                  description: Required with procedurePath
                bypassReads:
                  type: boolean
                  description: >-
                    Turn the blanket read-only grant on or off. Omit when
                    setting a procedure.
              required: []
              description: Set one standing decision for an agent
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  agentId:
                    type: string
                  procedurePath:
                    anyOf:
                      - type: string
                      - type: 'null'
                  state:
                    anyOf:
                      - enum:
                          - ASK
                          - ALWAYS_ALLOW
                          - NEVER
                        type: string
                        description: >-
                          ASK (file a request and wait for the owner),
                          ALWAYS_ALLOW (proceed without asking), NEVER (refuse
                          outright and do not queue a request).
                      - type: 'null'
                    description: >-
                      ASK (file a request and wait for the owner), ALWAYS_ALLOW
                      (proceed without asking), NEVER (refuse outright and do
                      not queue a request).
                  bypassReads:
                    type: boolean
                required:
                  - agentId
                  - procedurePath
                  - state
                  - bypassReads
                description: The decision as it now stands
        '403':
          description: '403'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: FORBIDDEN
                      status:
                        const: 403
                      message:
                        type: string
                        default: >-
                          Changing an agent's permissions requires master
                          authority.
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '404':
          description: '404'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: NOT_FOUND
                      status:
                        const: 404
                      message:
                        type: string
                        default: No such agent in this organization.
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
        '422':
          description: '422'
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      defined:
                        const: true
                      code:
                        const: UNPROCESSABLE_CONTENT
                      status:
                        const: 422
                      message:
                        type: string
                        default: >-
                          Set exactly one of procedurePath (with state) or
                          bypassReads.
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
                  - type: object
                    properties:
                      defined:
                        const: false
                      code:
                        type: string
                      status:
                        type: number
                      message:
                        type: string
                      data: {}
                    required:
                      - defined
                      - code
                      - status
                      - message
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        JWT Bearer token obtained from authentication. Pass as: Authorization:
        Bearer <token>
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API key for programmatic access. Pass as: X-API-Key: <your-key>'

````