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

# Finish connecting provider accounts after the authorization redirect

> Finishes an authorization begun by startIntegrationInstall. It returns either connected accounts or provider-neutral account/action options that continue through startIntegrationInstall. The provider and organization come from the authenticated caller and single-use state nonce, never from callback parameters or browser-local storage. Resource and permission selection happens later when granting a vault.



## OpenAPI

````yaml /managed-agents/openapi.yaml post /managed-agents/v1/integrations/install/complete
openapi: 3.1.0
info:
  title: Managed Agents API
  version: 0.13.0
  description: >-
    The Recursion Managed Agents REST API. Authenticate with a Recursion API key
    as a bearer token. An organization-scoped key acts in its own organization
    and needs nothing else; a tenant-scoped key must also send
    `x-organization-id` with an organization id or `default`. Field names follow
    each operation's published schema.
servers:
  - url: https://api.recursion.labelbox.com
security:
  - bearerAuth: []
paths:
  /managed-agents/v1/integrations/install/complete:
    post:
      tags:
        - Integrations
      summary: Finish connecting provider accounts after the authorization redirect
      description: >-
        Finishes an authorization begun by startIntegrationInstall. It returns
        either connected accounts or provider-neutral account/action options
        that continue through startIntegrationInstall. The provider and
        organization come from the authenticated caller and single-use state
        nonce, never from callback parameters or browser-local storage. Resource
        and permission selection happens later when granting a vault.
      operationId: managedAgentsCompleteIntegrationInstall
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/ManagedAgentsCompleteIntegrationInstallRequest
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsInstallComplete'
          description: >-
            The completed integration authorization. Connections contains the
            accounts established by this callback; when the provider needs the
            operator to choose an account or action first, connections is empty
            and options contains those provider-defined continuations.
        '400':
          description: The request was rejected by schema or semantic validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '401':
          description: The caller is unauthenticated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '403':
          description: The caller lacks a required permission or capability.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorForbidden'
        '409':
          description: >-
            The request conflicts with the resource state, or with an in-flight
            idempotent replay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '413':
          description: The request exceeds a size or transaction budget.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '415':
          description: The request body uses a media type this operation does not accept.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorUnsupportedMediaType'
        '429':
          headers:
            Retry-After:
              description: Seconds the caller should wait before retrying.
              schema:
                type: string
              style: simple
          description: A rate limit is exhausted. Honor `Retry-After`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '500':
          description: An unexpected server-side failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '502':
          description: The service returned an invalid response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorBadGateway'
        '503':
          headers:
            Retry-After:
              description: Seconds the caller should wait before retrying.
              schema:
                type: string
              style: simple
          description: A dependency is unavailable. Retryable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiError'
        '504':
          headers:
            Retry-After:
              description: When to retry, as delay seconds or an HTTP date.
              schema:
                type: string
          description: The service did not respond before the timeout. Retryable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManagedAgentsApiErrorGatewayTimeout'
components:
  schemas:
    ManagedAgentsCompleteIntegrationInstallRequest:
      description: >-
        Request body completing integration authorization after the provider
        redirects the user back. Sent from an authenticated session so the
        provider and organization come from the single-use state record rather
        than from callback parameters or browser-local storage.
      properties:
        code:
          description: >-
            Provider authorization code, proving which user authorized this
            connection. Required by OAuth providers (GitHub, Jira, Confluence,
            Loom), which refuse a completion without one. A built-in
            integration's sign-in page also returns a single-use code, verified
            before the connection activates, so a completion without it fails.
          type: string
        selection:
          description: >-
            Which account the operator chose on the provider's own page, in the
            opaque form that provider returned. Providers with an account
            chooser may require it; GitHub returns an installation id. A
            selector only: the server verifies the choice against the accounts
            the authorizing user can reach and refuses one they cannot.
          type: string
        state:
          description: >-
            The nonce returned when authorization was started. Single-use and
            short-lived.
          type: string
      required:
        - state
      type: object
      example:
        code: example
        selection: example
        state: example
    ManagedAgentsInstallComplete:
      description: >-
        The completed integration authorization. Connections contains the
        accounts established by this callback; when the provider needs the
        operator to choose an account or action first, connections is empty and
        options contains those provider-defined continuations.
      properties:
        connections:
          description: >-
            Connections created by this callback. Empty when the provider needs
            an option selected first.
          items:
            $ref: '#/components/schemas/ManagedAgentsIntegrationConnection'
          type:
            - array
            - 'null'
        options:
          description: >-
            Provider-defined accounts or actions the operator can choose to
            continue authorization.
          items:
            $ref: '#/components/schemas/ManagedAgentsAuthorizationOption'
          type: array
        provider:
          description: Provider whose authorization is being completed.
          type: string
      required:
        - provider
        - connections
      type: object
      example:
        connections:
          - account_login: example
            account_type: example
            connected_by: example
            connection_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
            created_at: '2026-02-18T09:30:00.000Z'
            external_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
            organization_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
            permissions:
              key: example
            provider: example
            resource_selection: example
            state: example
            updated_at: '2026-02-18T09:30:00.000Z'
            usage:
              agents: 1
              automations: 1
        options:
          - description: example
            label: example
            value: example
        provider: example
    ManagedAgentsApiError:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - analytics
            - analytics_not_ready
            - artifact_fetch_unavailable
            - artifact_generation_mismatch
            - artifact_hash_mismatch
            - artifact_invalid_events
            - artifact_invalid_json
            - artifact_not_allowlisted
            - artifact_size_mismatch
            - atomic_ingest_timeout
            - auth_unavailable
            - automation_event_source_invalid
            - automation_memory_unavailable
            - automation_reference_invalid
            - automation_runs_unconfigured
            - automations_unconfigured
            - bad_gateway
            - built_in_catalog_unavailable
            - built_in_integrations_unconfigured
            - compute_offerings_unavailable
            - conflict
            - content_store_request_canceled
            - content_store_unavailable
            - content_store_upload_timeout
            - credential_encryption_unconfigured
            - delegate_preparation_failed
            - entity_family_not_permitted
            - environment_not_verified
            - evaluation_cancellation_pending
            - evaluation_deletion_pending
            - event_admission_unavailable
            - event_ingress_unavailable
            - event_source_verification_credential_invalid
            - event_sources_unconfigured
            - execution_unconfigured
            - file_quota_exceeded
            - file_storage_unconfigured
            - forbidden
            - gateway_timeout
            - gestalt_unconfigured
            - github_rate_limited
            - github_unavailable
            - handoff_access_invalid
            - handoff_access_unavailable
            - handoff_access_unsupported
            - handoff_capture_unavailable
            - handoff_requires_retest
            - handoff_revoke_unavailable
            - handoff_signal_unavailable
            - idempotency_conflict
            - idempotency_in_progress
            - idempotency_unavailable
            - ingest_policy_changed
            - ingest_policy_not_found
            - ingest_policy_revoked
            - integrations_unconfigured
            - internal_error
            - invalid_json
            - invalid_pull_request_review_result
            - invalid_request
            - invalid_scope
            - invariant_violation
            - live_fleet_unconfigured
            - managed_agents_unavailable
            - missing_dependency
            - model_gateway_metadata_missing
            - model_gateway_unconfigured
            - model_gateway_unreachable
            - mutation_transaction_budget_exceeded
            - not_found
            - page_token_expired
            - payload_too_large
            - persistence_busy
            - precondition_failed
            - precondition_required
            - provider_registration_unsupported
            - provider_selection_unsupported
            - rate_limit_exceeded
            - rate_limited
            - repository_automation_unconfigured
            - request_too_large
            - reserved_source_type
            - revision_conflict
            - run_log_store_unavailable
            - runner_image_resolution_failed
            - sandbox_provider_disabled
            - service_unavailable
            - session_analyst_busy
            - session_analyst_model_unavailable
            - session_analyst_unconfigured
            - session_start_admission_unavailable
            - session_start_not_admitted
            - setup_fallback_environment_unsafe
            - setup_run_finished
            - setup_run_in_progress
            - setup_run_limit
            - setup_run_not_started
            - setup_runs_unavailable
            - skill_storage_unconfigured
            - slack_channels_rejected
            - slack_channels_unavailable
            - slack_channels_unconfigured
            - slack_connection_malformed
            - slack_event_intake_unavailable
            - slack_installation_mismatch
            - slack_missing_scope
            - slack_rate_limited
            - slack_reapproval_required
            - source_ownership_mismatch
            - source_revision_conflict
            - spanner_unavailable
            - streaming_unsupported
            - submission_transaction_budget_exceeded
            - task_version_number_conflict
            - team_board_unconfigured
            - too_many_streams
            - unauthorized
            - unsupported_media_type
            - vault_creation_retired
            - version_content_conflict
            - webhook_delivery_too_large
            - workspace_boundary_denied
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorForbidden:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - forbidden
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorUnsupportedMediaType:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - unsupported_media_type
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorBadGateway:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - bad_gateway
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsApiErrorGatewayTimeout:
      type: object
      properties:
        code:
          type: string
          minLength: 1
          description: Stable machine-readable error code.
          enum:
            - gateway_timeout
        message:
          type: string
          minLength: 1
          description: Human-readable error message.
        details:
          description: Optional structured error details.
          type: object
          propertyNames:
            type: string
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
      description: Standard flat error response.
    ManagedAgentsIntegrationConnection:
      description: >-
        An organization's link to a third-party account, created by installing
        an integration such as the GitHub App. It holds no secret itself; grant
        it to an agent so sessions can mint short-lived provider credentials
        from it.
      properties:
        account_login:
          description: >-
            Name of the connected third-party account, e.g. the GitHub org or
            user login. Cached at install time for display, so no provider call
            is needed to show it.
          type: string
        account_type:
          description: >-
            Kind of account that was connected, as the provider reports it, e.g.
            Organization or User for GitHub and workspace for Slack.
          type: string
        connected_by:
          description: >-
            User who completed the install, recorded for audit. Empty for
            connections created by an internal admin route.
          type: string
        connection_id:
          description: >-
            Identifier for this connection (UUID). Server-assigned. Cite it when
            granting an agent access to the integration.
          type: string
        created_at:
          description: RFC 3339 timestamp of when this record was created. Server-assigned.
          format: date-time
          type: string
        external_id:
          description: >-
            The provider's own identifier for the link, which token minting
            addresses. The installation id for GitHub; the composite
            {api_app_id}:{team_id} for Slack; the customer service-account email
            for Google Cloud.
          type: string
        organization_id:
          description: >-
            Organization that owns this record. Resolved from the API key; never
            accepted from the caller.
          type: string
        permissions:
          additionalProperties:
            type: string
          description: >-
            What the provider granted the install, as permission name to access
            level (e.g. contents: write). Used to narrow a minted token without
            a provider round trip and to explain why a permission preset is
            unavailable.
          type: object
        provider:
          description: >-
            Stable slug of the third-party integration adapter this connection
            uses.
          type: string
        resource_selection:
          description: >-
            Whether the install covers all of the account's resources or only
            chosen ones: all or selected. Informational only; the authoritative
            list stays at the provider.
          type: string
        state:
          description: >-
            Lifecycle of the connection: pending was registered directly and
            waits for the customer to grant trust at the provider (a successful
            probe activates it), active can mint tokens, suspended is restorable
            at the provider and resolves to no credential, revoked was
            uninstalled and must be installed again.
          type: string
        updated_at:
          description: >-
            RFC 3339 timestamp of the last change to this record.
            Server-assigned.
          format: date-time
          type: string
        usage:
          $ref: '#/components/schemas/ManagedAgentsIntegrationConnectionUsage'
          description: Runtime usage counts, supplied on the connection list.
      required:
        - organization_id
        - connection_id
        - provider
        - external_id
        - state
        - created_at
        - updated_at
      type: object
      example:
        account_login: example
        account_type: example
        connected_by: example
        connection_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        created_at: '2026-02-18T09:30:00.000Z'
        external_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        organization_id: 9f8b1c2d-3e4f-5a6b-7c8d-9e0f1a2b3c4d
        permissions:
          key: example
        provider: example
        resource_selection: example
        state: example
        updated_at: '2026-02-18T09:30:00.000Z'
        usage:
          agents: 1
          automations: 1
    ManagedAgentsAuthorizationOption:
      description: >-
        One provider-defined account or authorization action the operator may
        choose to continue an integration install. Its value is opaque and is
        accepted only through a fresh, single-use install state.
      properties:
        description:
          description: >-
            Optional explanation of the account or action represented by this
            option.
          type: string
        label:
          description: Operator-facing name for this account or authorization action.
          type: string
        value:
          description: >-
            Short opaque provider option value to pass back when continuing this
            authorization flow.
          maxLength: 30
          type: string
      required:
        - value
        - label
      type: object
      example:
        description: example
        label: example
        value: example
    ManagedAgentsIntegrationConnectionUsage:
      description: Current agent and pinned automation runtime usage of a connection.
      properties:
        agents:
          description: Distinct agents whose current version selects this connection.
          format: int64
          type: integer
        automations:
          description: >-
            Distinct canonical automations, including paused ones, whose pinned
            agent version selects this connection.
          format: int64
          type: integer
      required:
        - agents
        - automations
      type: object
      example:
        agents: 1
        automations: 1
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Recursion API key, created in the console under API keys.

````