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

# Create Authorization Request

> Begin a first-party OAuth authorization-code flow with PKCE.



## OpenAPI

````yaml /openapi.json post /v1/agent-auth/authorization-requests
openapi: 3.1.0
info:
  title: Korve API
  version: 0.1.0
  description: >-
    Typed control plane for deploying applications and explicitly provisioning
    their managed infrastructure.
servers:
  - url: https://api.korve.dev
security: []
paths:
  /v1/agent-auth/authorization-requests:
    post:
      tags:
        - agentAuth
      summary: Create Authorization Request
      description: Begin a first-party OAuth authorization-code flow with PKCE.
      operationId: agentAuth.createAuthorizationRequest
      parameters: []
      requestBody:
        required: true
        x-korve-max-bytes: 1048576
        content:
          application/json:
            schema:
              type: object
              properties:
                clientId:
                  type: string
                  enum:
                    - korve-cli
                    - korve-mcp
                redirectUri:
                  type: string
                  format: uri
                  maxLength: 2048
                state:
                  type: string
                  minLength: 32
                  maxLength: 256
                codeChallenge:
                  type: string
                  pattern: ^[A-Za-z0-9_-]{43}$
                  description: Base64url SHA-256 digest of the client's PKCE verifier.
                codeChallengeMethod:
                  type: string
                  enum:
                    - S256
                audience:
                  type: string
                  enum:
                    - cli
                    - mcp
                  description: >-
                    The first-party client surface that may present the
                    resulting token.
                scopes:
                  type: array
                  minItems: 1
                  maxItems: 256
                  items:
                    type: string
                    pattern: ^[A-Za-z][A-Za-z0-9]*\.[A-Za-z][A-Za-z0-9]*$
                    maxLength: 128
                  description: Exact public API operation ids the grant may call.
                requestedRole:
                  type: string
                  enum:
                    - member
                    - admin
                  description: >-
                    Maximum organization role the grant may exercise. Owner
                    grants do not exist.
              required:
                - clientId
                - redirectUri
                - state
                - codeChallenge
                - codeChallengeMethod
                - audience
                - scopes
                - requestedRole
      responses:
        '201':
          description: Authorization request created; open authorizationUrl in a browser.
          content:
            application/json:
              schema:
                type: object
                properties:
                  requestId:
                    type: string
                    format: uuid
                  authorizationUrl:
                    type: string
                    format: uri
                  expiresAt:
                    type: string
                    format: date-time
                required:
                  - requestId
                  - authorizationUrl
                  - expiresAt
        '422':
          description: Invalid client, redirect, state, PKCE challenge, scope, or role.
        '429':
          description: Too many authorization attempts from this network source.
      security: []

````