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

# Authorize

> The hot path. Every consequential agent action passes through here.

Returns 200 with the decision rather than an error status even when the
answer is no: a refusal is a normal, expected outcome that the caller must
handle, and it is evidence either way.

**Who may call it:** an API key, or any role other than auditor.



## OpenAPI

````yaml /api/openapi.json post /v1/authorize
openapi: 3.1.0
info:
  title: RotaGrant API
  version: 0.1.0
  description: >-
    The HTTP API of a RotaGrant deployment, made from the product's own route
    definitions at the commit named in `x-rotascale-source`. Nothing here is
    written by hand.


    There is no shared endpoint. RotaGrant runs in your environment, and your
    deployment serves its own copy of this description at `/api/docs`. That copy
    is the authority on what your version has and which features are switched
    on; this one is the reference for one commit of the main line. The version
    is 0.1.0: routes and shapes can still change.


    Every route says who may call it. Most need a bearer token from the identity
    provider your deployment uses, held by a person with the role named. The
    routes an SDK calls also accept a workspace API key. A few are open, and say
    why.
servers:
  - url: https://{deployment}
    description: Your own deployment. There is no shared endpoint.
    variables:
      deployment:
        default: rotagrant.internal.example
        description: The host your deployment answers on.
security: []
paths:
  /v1/authorize:
    post:
      tags:
        - Authority
      summary: Authorize
      description: >-
        The hot path. Every consequential agent action passes through here.


        Returns 200 with the decision rather than an error status even when the

        answer is no: a refusal is a normal, expected outcome that the caller
        must

        handle, and it is evidence either way.


        **Who may call it:** an API key, or any role other than auditor.
      operationId: authorize_v1_authorize_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthorizeIn'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizeOut'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - bearerToken: []
        - apiKey: []
components:
  schemas:
    AuthorizeIn:
      properties:
        grant_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Grant Id
        action:
          additionalProperties: true
          type: object
          title: Action
        amount_minor:
          type: integer
          minimum: 0
          title: Amount Minor
          default: 0
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        trajectory_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Trajectory Id
        step_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Step Id
        taint:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Taint
        incumbent_decision:
          anyOf:
            - type: string
              pattern: ^(allow|deny)$
            - type: 'null'
          title: Incumbent Decision
      type: object
      title: AuthorizeIn
    AuthorizeOut:
      properties:
        outcome:
          type: string
          title: Outcome
        allowed:
          type: boolean
          title: Allowed
        policy_outcome:
          anyOf:
            - type: string
            - type: 'null'
          title: Policy Outcome
        enforcement_mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Enforcement Mode
        reason:
          type: string
          title: Reason
        grant_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Grant Id
        ledger_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Ledger Id
        remaining_amount_minor:
          anyOf:
            - type: integer
            - type: 'null'
          title: Remaining Amount Minor
        remaining_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Remaining Count
        findings:
          items:
            type: string
          type: array
          title: Findings
        capability:
          anyOf:
            - type: string
            - type: 'null'
          title: Capability
        capability_expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Capability Expires At
      type: object
      required:
        - outcome
        - allowed
        - reason
        - grant_id
        - ledger_id
        - remaining_amount_minor
        - remaining_count
        - findings
      title: AuthorizeOut
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A token from the identity provider your deployment federates with. It
        identifies a person; their roles in the workspace decide what they may
        do.
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        A workspace API key (`rsk_...`), issued in the console and shown once.
        It identifies a service, not a person, and is accepted only on the
        routes an SDK calls. It may also be sent as `Authorization: Bearer
        rsk_...`.

````

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