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

# Start OAuth sign-in

> Start a sign-in for an OAuth variable and get the link to send the user to. The link works for 10 minutes, and only the caller who made it can complete it. When the variable needs more settings first, `authorization` is null and the response says which.



## OpenAPI

````yaml POST /api/v1/agent-vault/variables/{variableId}/authorizations
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/agent-vault/variables/{variableId}/authorizations:
    post:
      tags:
        - Agent Vault Variables
      description: >-
        Start a sign-in for an OAuth variable and get the link to send the user
        to. The link works for 10 minutes, and only the caller who made it can
        complete it. When the variable needs more settings first,
        `authorization` is null and the response says which.
      operationId: createAgentVaultVariableAuthorization
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: variableId
          required: true
          description: The ID of the variable.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              anyOf:
                - not: {}
                - type: object
                  properties:
                    clientSecret:
                      allOf:
                        - type: string
                          minLength: 1
                        - type: string
                          maxLength: 4096
                          pattern: ^[\x20-\x7e]+$
                      description: >-
                        The client secret of your own OAuth app, for a variable
                        with a `clientId`. Leave it out on a reconnect to keep
                        the stored one, or for an app with no secret.
                  additionalProperties: false
                  nullable: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  authorization:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        description: The ID of the sign-in.
                      authorizeUrl:
                        type: string
                        description: >-
                          Send the user to this URL to sign in with the
                          provider. The provider then redirects to `redirectUri`
                          with `state` and `code`, for your callback to send to
                          the complete endpoint.
                      expiresAt:
                        type: string
                        format: date-time
                        description: >-
                          When the sign-in link stops working, 10 minutes after
                          it was made.
                    required:
                      - id
                      - authorizeUrl
                      - expiresAt
                    additionalProperties: false
                    nullable: true
                    description: >-
                      The sign-in, or null when the variable needs `clientId`
                      (`registrationRequired`) or endpoints set by hand
                      (`manualSetupRequired`) first.
                  registrationRequired:
                    type: boolean
                    description: >-
                      True when the provider can't register a client by itself,
                      or refused to. Set `clientId` on the variable to your own
                      OAuth app, then start the sign-in again.
                  manualSetupRequired:
                    type: boolean
                    description: >-
                      True when discovery found no endpoints Infisical can
                      trust: it only guessed them, or the provider's metadata
                      names another issuer. Nothing was sent to them. Check
                      `prefill`, set the endpoints on the variable by hand, then
                      start the sign-in again.
                  prefill:
                    type: object
                    properties:
                      authorizationEndpoint:
                        type: string
                        description: >-
                          The provider's authorization endpoint, an https URL.
                          Send it with `tokenEndpoint`.
                      tokenEndpoint:
                        type: string
                        description: >-
                          The provider's token endpoint, an https URL. Send it
                          with `authorizationEndpoint`.
                      issuer:
                        type: string
                        nullable: true
                        description: The issuer the provider's metadata names, if any.
                      scopes:
                        type: array
                        items:
                          type: string
                        description: Scopes the provider lists.
                    required:
                      - authorizationEndpoint
                      - tokenEndpoint
                      - issuer
                      - scopes
                    additionalProperties: false
                    nullable: true
                    description: >-
                      What discovery found, as a starting point for the
                      endpoints to set by hand. Null otherwise.
                  redirectUri:
                    type: string
                    description: >-
                      Where the provider sends the user back after signing in:
                      the variable's `redirectUri`, or Infisical's callback
                      page. Register it with your OAuth app.
                required:
                  - authorization
                  - registrationRequired
                  - manualSetupRequired
                  - prefill
                  - redirectUri
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````

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