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

> ## Agent Instructions
> AI agents that need Anchor credentials should start with https://docs.anchorbrowser.io/quickstart/agent-access. This flow lets agents obtain an API key programmatically without creating a dashboard account. Read that page before attempting authentication or API access.

# Finalize Dynamic Auth Flow

> Persists the identity, browser profile, and captured credentials after the
flow reaches `authenticated`. The response reports whether the saved login
can be replayed unattended (`automatable`).




## OpenAPI

````yaml /openapi.yaml post /v1/identities/dynamic/finalize/{session_id}
openapi: 3.1.0
info:
  title: AnchorBrowser API
  version: 1.0.0
  description: APIs to manage all browser-related actions and configuration.
servers:
  - url: https://api.anchorbrowser.io
    description: API server
security: []
paths:
  /v1/identities/dynamic/finalize/{session_id}:
    post:
      tags:
        - Identities
      summary: Finalize Dynamic Auth Flow
      description: >
        Persists the identity, browser profile, and captured credentials after
        the

        flow reaches `authenticated`. The response reports whether the saved
        login

        can be replayed unattended (`automatable`).
      parameters:
        - name: session_id
          in: path
          required: true
          description: Session whose authenticated flow to persist.
          schema:
            type: string
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthFlowV2FinalizeRequest'
      responses:
        '200':
          description: Identity created from the completed flow
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthFlowV2FinalizeResult'
        '401':
          description: Missing team context
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Auth flow or current step not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Flow must be authenticated before finalizing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to finalize
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    AuthFlowV2FinalizeRequest:
      type: object
      properties:
        identity_name:
          type: string
          description: Optional name for the created identity.
        profile_name:
          type: string
          description: Optional browser profile name. Defaults to `profile-<session_id>`.
    AuthFlowV2FinalizeResult:
      type: object
      required:
        - identityId
        - profileName
        - automatable
        - nonAutomatableReasons
      properties:
        identityId:
          type: string
        profileName:
          type: string
        automatable:
          type: boolean
          description: >
            Identity-level replay flag. False if any passed form option was not
            automatable.

            Distinct from `options[].automatable` on `decision`/`form` views,
            which is per choice.
        nonAutomatableReasons:
          type: array
          description: >-
            Why the login cannot be replayed unattended. Empty when
            `automatable` is true.
          items:
            type: string
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header

````