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

# Post apiv2useragent connectionsrequests



## OpenAPI

````yaml https://raw.githubusercontent.com/lightdash/lightdash/refs/heads/main/packages/backend/src/generated/swagger.json post /api/v2/user/agent-connections/requests
openapi: 3.0.0
info:
  title: Lightdash API
  version: 2.568.0
  description: >
    Open API documentation for all public Lightdash API endpoints. #
    Authentication Before you get started, you might need to create a Personal
    Access Token to authenticate via the API. You can create a token by
    following this guide: https://docs.lightdash.com/references/personal_tokens
  license:
    name: MIT
  contact:
    name: Lightdash Support
    email: support@lightdash.com
    url: https://docs.lightdash.com/help-and-contact/contact/contact_info/
servers:
  - url: /
security: []
tags:
  - name: My Account
    description: These routes allow users to manage their own user account.
  - name: Organizations
    description: >-
      Each user is a member of a single organization. These routes allow users
      to manage their organization. Most actions are only available to admin
      users.
  - name: Projects
    description: >-
      Projects belong to a single organization. These routes allow users to
      manage their projects, browse content, and execute queries. Users inside
      an organization might have access to a project from an organization-level
      role or they might be granted access to a project directly.
  - name: Spaces
    description: >-
      Spaces allow you to organize charts and dashboards within a project. They
      also allow granular access to content by allowing you to create private
      spaces, which are only accessible to the creator and admins.
  - name: Roles & Permissions
    description: >-
      These routes allow users to manage roles and permissions for their
      organization.
    externalDocs:
      url: https://docs.lightdash.com/references/roles
  - name: Query
    description: >-
      These routes allow users to execute and manage queries against their data
      warehouse. This includes metric queries, SQL queries, and retrieving query
      results.
paths:
  /api/v2/user/agent-connections/requests:
    post:
      tags:
        - v2
        - Agent connections
      operationId: RequestApproval
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgentConnectionApprovalRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/AgentConnectionApprovalResponse'
                  - $ref: '#/components/schemas/AgentConnectionApprovalErrorResponse'
        default:
          description: Approval request error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentConnectionApprovalErrorResponse'
      security: []
components:
  schemas:
    AgentConnectionApprovalRequest:
      properties:
        resource:
          type: string
        codeChallengeMethod:
          type: string
          enum:
            - S256
          nullable: false
        codeChallenge:
          type: string
        state:
          type: string
        redirectUri:
          type: string
        expiresInSeconds:
          type: number
          format: double
        capabilities:
          items:
            $ref: '#/components/schemas/AgentCapability'
          type: array
        projects:
          items:
            $ref: '#/components/schemas/UuidOrSlug'
          type: array
          nullable: true
        name:
          type: string
        clientId:
          type: string
          enum:
            - lightdash-cli
          nullable: false
      required:
        - resource
        - codeChallengeMethod
        - codeChallenge
        - state
        - redirectUri
        - expiresInSeconds
        - capabilities
        - projects
        - name
        - clientId
      type: object
    AgentConnectionApprovalResponse:
      properties:
        results:
          properties:
            expiresAt:
              type: string
            resource:
              type: string
            issuer:
              type: string
            authorizationUrl:
              type: string
          required:
            - expiresAt
            - resource
            - issuer
            - authorizationUrl
          type: object
        status:
          type: string
          enum:
            - ok
          nullable: false
      required:
        - results
        - status
      type: object
    AgentConnectionApprovalErrorResponse:
      properties:
        error:
          properties:
            review:
              $ref: '#/components/schemas/AgentConnectionApprovalReview'
            message:
              type: string
            code:
              $ref: '#/components/schemas/AgentConnectionApprovalErrorCode'
            name:
              type: string
              enum:
                - AgentConnectionApprovalError
              nullable: false
            statusCode:
              type: number
              format: double
          required:
            - message
            - code
            - name
            - statusCode
          type: object
        status:
          type: string
          enum:
            - error
          nullable: false
      required:
        - error
        - status
      type: object
    AgentCapability:
      enum:
        - read_discover
        - query
        - raw_sql
        - content_write
        - delete
        - publish
        - deploy_upload
        - dbt_writeback
        - export
        - administration
        - external_tools
      type: string
    UuidOrSlug:
      type: string
      description: >-
        A resource UUID or its URL slug. Resolve to a real UUID before using as
        a key.
    AgentConnectionApprovalReview:
      properties:
        revision:
          type: number
          format: double
        nonce:
          type: string
        projects:
          items:
            $ref: '#/components/schemas/AgentConnectionApprovalProject'
          type: array
        notice:
          type: string
          enum:
            - Review only. No connection will be created.
          nullable: false
        request:
          properties:
            expiresAt:
              type: string
            expiresInSeconds:
              type: number
              format: double
            clientLabel:
              type: string
            name:
              type: string
          required:
            - expiresAt
            - expiresInSeconds
            - clientLabel
            - name
          type: object
      required:
        - revision
        - nonce
        - projects
        - notice
        - request
      type: object
    AgentConnectionApprovalErrorCode:
      type: string
      enum:
        - authentication_required
        - agent_identity_disabled
        - person_required
        - browser_session_required
        - approval_forbidden
        - csrf_failed
        - invalid_approval_request
        - too_many_projects
        - pending_request_limit
        - agent_connections_unavailable
        - approval_request_not_found
        - approval_request_expired
        - approval_request_consumed
        - approval_not_decided
        - approval_selection_changed
        - internal_error
    AgentConnectionApprovalProject:
      properties:
        capabilities:
          items:
            $ref: '#/components/schemas/AgentConnectionApprovalCapability'
          type: array
        reason:
          type: string
          nullable: true
        selectable:
          type: boolean
        name:
          type: string
        projectUuid:
          type: string
      required:
        - capabilities
        - reason
        - selectable
        - name
        - projectUuid
      type: object
    AgentConnectionApprovalCapability:
      properties:
        reason:
          type: string
          nullable: true
        reasonCode:
          type: string
          nullable: true
        visibility:
          type: string
          enum:
            - offered
            - hidden
            - blocked
        capability:
          $ref: '#/components/schemas/AgentCapability'
      required:
        - reason
        - reasonCode
        - visibility
        - capability
      type: object

````

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