> ## 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.

# Get Dynamic Auth Flow State

> Read-only snapshot of an in-progress dynamic auth flow. Does not acquire the
flow lock or mutate state.

Poll this endpoint when:
- start/resolve returned `type: detection_failed` with `retryable: true`
  (the next login step is still being determined and may take longer than
  the request timeout)
- start/resolve timed out or returned 409 while a transition is in flight
- you need the current presentation without submitting an answer

`view` is that presentation — the same object start/resolve return. Treat it
as the live step when `phase` is `settled`. While `phase` is `navigating`,
`view` may already describe the next step; `target` is only a progress
label for the in-flight transition.

Keep polling until `view.type` is `decision`, `form`, `authenticated`, a
non-retryable `detection_failed`, or a non-retryable `failed`. Then call
`/resolve` only for `decision`/`form`, `/finalize` for `authenticated`, or
open `live_view_url` for `detection_failed`.




## OpenAPI

````yaml /openapi.yaml get /v1/identities/dynamic/state/{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/state/{session_id}:
    get:
      tags:
        - Identities
      summary: Get Dynamic Auth Flow State
      description: >
        Read-only snapshot of an in-progress dynamic auth flow. Does not acquire
        the

        flow lock or mutate state.


        Poll this endpoint when:

        - start/resolve returned `type: detection_failed` with `retryable: true`
          (the next login step is still being determined and may take longer than
          the request timeout)
        - start/resolve timed out or returned 409 while a transition is in
        flight

        - you need the current presentation without submitting an answer


        `view` is that presentation — the same object start/resolve return.
        Treat it

        as the live step when `phase` is `settled`. While `phase` is
        `navigating`,

        `view` may already describe the next step; `target` is only a progress

        label for the in-flight transition.


        Keep polling until `view.type` is `decision`, `form`, `authenticated`, a

        non-retryable `detection_failed`, or a non-retryable `failed`. Then call

        `/resolve` only for `decision`/`form`, `/finalize` for `authenticated`,
        or

        open `live_view_url` for `detection_failed`.
      parameters:
        - name: session_id
          in: path
          required: true
          description: Session whose auth flow state to read.
          schema:
            type: string
      responses:
        '200':
          description: Current auth flow state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthFlowV2State'
        '404':
          description: Auth flow not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to read auth flow state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    AuthFlowV2State:
      type: object
      description: >
        Poll this after retryable `detection_failed`, a request timeout, or 409.


        `view` is the same presentation start/resolve return (`type`
        discriminant).

        When `phase` is `settled`, it is the current step. When `phase` is
        `navigating`,

        it may already describe the next step so you can render (or answer)
        before the

        browser finishes moving; it is omitted until there is something to show.


        Call `/resolve` only when `view.type` is `decision` or `form`.
      required:
        - session_id
        - graph_id
        - current_step_id
        - discovery_status
        - phase
        - updated_at
        - nav
      properties:
        session_id:
          type: string
        graph_id:
          type: integer
          description: Internal identifier for this auth flow.
        current_step_id:
          type: string
          description: >
            Identifier of the step the flow last committed. While `phase` is
            `navigating`,

            `view` may already describe a later step.
        discovery_status:
          type: string
          enum:
            - in_progress
            - complete
            - failed
          description: Whether automatic detection of the login steps is still running.
        discovery_error:
          type: string
        phase:
          type: string
          enum:
            - navigating
            - settled
          description: >
            `navigating` — a browser transition is in flight; `view` may already
            be the next step.

            `settled` — idle at a step; `view` is that step.
        updated_at:
          type: number
          description: Unix epoch milliseconds of the last state change.
        target:
          type: object
          description: >
            Step the browser is moving toward. Present only while `phase` is
            `navigating`.

            Use for progress copy (for example "Preparing {label}…"). Not a
            second

            presentation — `view` is what to show.
          properties:
            step_id:
              type: string
            label:
              type: string
        nav:
          type: object
          required:
            - status
          description: Outcome of the latest navigation operation.
          properties:
            status:
              type: string
              enum:
                - pending
                - succeeded
                - failed
                - none
            error:
              type: string
            credentials_rejected:
              type: boolean
        view:
          allOf:
            - $ref: '#/components/schemas/AuthFlowV2View'
          description: >
            What to render or answer. Same shape as start/resolve, derived
            read-only.


            - `phase: settled` — the current step.

            - `phase: navigating` — the upcoming step, when known; omitted until
            then.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
    AuthFlowV2View:
      description: >
        Presentation returned by start/resolve. GET `/state` nests the same
        object as

        `view` when there is something to show. Discriminated on `type`. Call
        `/resolve`

        only for `decision` or `form`.
      oneOf:
        - $ref: '#/components/schemas/AuthFlowV2DecisionView'
        - $ref: '#/components/schemas/AuthFlowV2FormView'
        - $ref: '#/components/schemas/AuthFlowV2DetectionFailedView'
        - $ref: '#/components/schemas/AuthFlowV2AuthenticatedView'
        - $ref: '#/components/schemas/AuthFlowV2FailedView'
      discriminator:
        propertyName: type
        mapping:
          decision:
            $ref: '#/components/schemas/AuthFlowV2DecisionView'
          form:
            $ref: '#/components/schemas/AuthFlowV2FormView'
          detection_failed:
            $ref: '#/components/schemas/AuthFlowV2DetectionFailedView'
          authenticated:
            $ref: '#/components/schemas/AuthFlowV2AuthenticatedView'
          failed:
            $ref: '#/components/schemas/AuthFlowV2FailedView'
    AuthFlowV2DecisionView:
      title: decision
      allOf:
        - $ref: '#/components/schemas/AuthFlowV2ViewBase'
        - type: object
          required:
            - type
            - options
          properties:
            type:
              type: string
              enum:
                - decision
            options:
              type: array
              description: |
                Each item is `{ step_id, label, automatable }`.
                POST `/resolve` with `{ "choice": "<step_id>" }`.
              items:
                $ref: '#/components/schemas/AuthFlowV2DecisionOption'
    AuthFlowV2FormView:
      title: form
      allOf:
        - $ref: '#/components/schemas/AuthFlowV2ViewBase'
        - type: object
          required:
            - type
            - options
          properties:
            type:
              type: string
              enum:
                - form
            options:
              type: array
              description: |
                Each item includes `type` and `automatable`.
                POST `/resolve` with `{ "option_index": n, "values": { ... } }`.
              items:
                $ref: '#/components/schemas/AuthFlowV2FormOption'
            credentials_rejected:
              type: boolean
              description: >-
                The last submission was rejected (e.g. wrong password) and the
                same form is re-presented.
            credentials_passed:
              type: boolean
              description: The previous step just cleared. Transient.
    AuthFlowV2DetectionFailedView:
      title: detection_failed
      allOf:
        - $ref: '#/components/schemas/AuthFlowV2ViewBase'
        - type: object
          required:
            - type
            - node_status
            - retryable
            - message
          properties:
            type:
              type: string
              enum:
                - detection_failed
            node_status:
              type: string
              enum:
                - detected
                - failed
                - explored
              description: How far the current step has been analyzed.
            last_error:
              type: string
              description: The most recent navigation error, if any.
            retryable:
              type: boolean
              description: >-
                True means keep polling `/state`; false means stop and use
                `live_view_url`.
            message:
              type: string
              description: >
                Why detection stopped. Open `live_view_url` to finish signing in
                in the browser.

                Do not resolve. If `retryable` is true, you may also poll GET
                `/state`.
    AuthFlowV2AuthenticatedView:
      title: authenticated
      allOf:
        - $ref: '#/components/schemas/AuthFlowV2ViewBase'
        - type: object
          required:
            - type
          properties:
            type:
              type: string
              enum:
                - authenticated
            message:
              type: string
              description: Human-readable status. POST `/finalize` to persist the identity.
    AuthFlowV2FailedView:
      title: failed
      allOf:
        - $ref: '#/components/schemas/AuthFlowV2ViewBase'
        - type: object
          required:
            - type
            - error
            - retryable
          properties:
            type:
              type: string
              enum:
                - failed
            error:
              type: string
              description: What went wrong.
            retryable:
              type: boolean
              description: True means keep polling `/state`; false means stop.
    AuthFlowV2ViewBase:
      type: object
      required:
        - session_id
        - host
        - current_step_label
        - step_id
        - cdp_url
        - live_view_url
      properties:
        session_id:
          type: string
        host:
          type: string
          description: Hostname the flow was started for.
        current_step_label:
          type: string
          description: Human-readable label of the current login step.
        step_id:
          type: string
          description: Identifier of the current login step.
        cdp_url:
          type: string
          description: CDP websocket URL of the session driving the login.
        live_view_url:
          type: string
          description: URL to watch or take over the session in a browser.
        discovery_error:
          type: string
          description: >-
            Set when automatic step detection hit an error. A partial flow may
            still be presented.
    AuthFlowV2DecisionOption:
      type: object
      required:
        - step_id
        - label
        - automatable
      description: |
        One option on a `decision` step. The option's `step_id` is the value to
        send as `choice` on `/resolve`; the decision view's `step_id` identifies
        the step that is asking you to choose.
      properties:
        step_id:
          type: string
          description: Opaque identifier for this option; pass it back as `choice`.
        label:
          type: string
          description: Human-readable name of the login path (e.g. "Continue with Google").
        automatable:
          type: boolean
          description: >-
            True if this path is known to be replayable unattended, without a
            human.
    AuthFlowV2FormOption:
      type: object
      required:
        - type
        - automatable
      description: >
        One way to complete a `form` step. Pick it with `option_index` on
        `/resolve`.

        `automatable` is true when this option can be replayed unattended
        (typically

        `credentials`, `totp_secret`, `gmail_one_click_integration`). Captcha,
        passkey,

        consent, and magic_link are typically false.


        `gmail_one_click_integration`: open `extra_data.create_integration_url`
        in a

        browser once; it returns a value to send as `values.gmail_tokens` on
        `/resolve`.

        The token is bound to the Gmail account, not to this flow — reuse it on
        any

        later email MFA form for that account, across applications, without

        authorizing again.
      properties:
        type:
          type: string
          enum:
            - credentials
            - mfa_totp
            - mfa_sms
            - mfa_email
            - sso
            - captcha
            - consent
            - magic_link
            - passkey
            - generic
            - totp_secret
            - gmail_one_click_integration
        automatable:
          type: boolean
          description: True if this option can be replayed unattended without a human.
        inputs:
          type: array
          items:
            type: object
            required:
              - name
              - type
            properties:
              name:
                type: string
              type:
                type: string
              label:
                type: string
              placeholder:
                type: string
              value:
                type: string
        extra_data:
          type: object
          additionalProperties: true
          description: Type-specific extras. Present only when the option has any.
          properties:
            create_integration_url:
              type: string
              format: uri
              description: >-
                On `gmail_one_click_integration`. Browser URL to connect Gmail;
                see the option description for the token it returns.
            number:
              type: string
              description: >-
                On `consent`. Device confirmation number from the live page,
                when shown.
        message:
          type: string
        provider:
          type: string
        phoneHint:
          type: string
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header

````