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

# Oauth Bind Installation

> Bind a connection to one installation of its GitHub App, and optionally to some of its repositories: its calls then carry an installation access token limited to them instead of the user's token. A null ``installation_id`` returns it to the user's token.

Only an installation, and repositories of it, that the connection's GitHub user can access are accepted. Whoever may sign the connection in again may bind it.



## OpenAPI

````yaml /api-reference/openapi.json put /v1/workspaces/{workspace}/oauth/installation
openapi: 3.1.0
info:
  description: >-
    Modular and extensible framework for building AI agents. This API requires
    JWT Bearer token authentication for most endpoints. Include your JWT token
    in the Authorization header. Public endpoints include /, /health, /docs,
    /redoc, and /openapi.json.
  title: AgentArea API
  version: 0.2.0
servers: []
security:
  - bearer: []
paths:
  /v1/workspaces/{workspace}/oauth/installation:
    put:
      tags:
        - v1
        - protected
        - oauth-connect
      summary: Oauth Bind Installation
      description: >-
        Bind a connection to one installation of its GitHub App, and optionally
        to some of its repositories: its calls then carry an installation access
        token limited to them instead of the user's token. A null
        ``installation_id`` returns it to the user's token.


        Only an installation, and repositories of it, that the connection's
        GitHub user can access are accepted. Whoever may sign the connection in
        again may bind it.
      operationId: oauth_bind_installation_v1_oauth_installation_put
      parameters:
        - description: Slug of the workspace the request acts in
          in: path
          name: workspace
          required: true
          schema:
            description: Slug of the workspace the request acts in
            maxLength: 120
            pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
            title: Workspace
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthInstallationBindingRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OAuthInstallationBindingResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    OAuthInstallationBindingRequest:
      additionalProperties: false
      properties:
        installation_id:
          anyOf:
            - minimum: 1
              type: integer
            - type: 'null'
          title: Installation Id
          description: >-
            Installation to bind to; null returns the connection to the user's
            token
        instance_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Instance Id
          description: MCP instance to bind
        openapi_connection_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Openapi Connection Id
          description: API connection to bind
        repositories:
          anyOf:
            - items:
                maxLength: 100
                minLength: 1
                type: string
              maxItems: 500
              type: array
            - type: 'null'
          title: Repositories
          description: >-
            Repository names to limit the token to; null or empty for every
            repository of the installation
      required:
        - installation_id
      title: OAuthInstallationBindingRequest
      type: object
    OAuthInstallationBindingResponse:
      properties:
        installation_binding:
          anyOf:
            - $ref: '#/components/schemas/OAuthInstallationBinding'
            - type: 'null'
          title: Installation Binding
      required:
        - installation_binding
      title: OAuthInstallationBindingResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    OAuthInstallationBinding:
      description: The installation a connection's calls are limited to.
      properties:
        account:
          description: >-
            Login of the account (organization or user) the installation belongs
            to
          title: Account
          type: string
        installation_id:
          title: Installation Id
          type: integer
        repositories:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Repositories
          description: >-
            Names of the repositories the token is limited to; null for every
            repository of the installation
      required:
        - installation_id
        - account
        - repositories
      title: OAuthInstallationBinding
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearer:
      bearerFormat: JWT
      description: JWT Bearer token for authentication
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````

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