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

# Reauthenticate Identity

> Re-authenticates an identity on demand: validates the saved browser profile and runs login if
it is no longer signed in, then persists the refreshed profile and tears the temporary session
down. Equivalent to a session with `identity_skip_validation: false` that ends after auth.




## OpenAPI

````yaml /openapi.yaml post /v1/identities/{identityId}/reauthenticate
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/{identityId}/reauthenticate:
    post:
      tags:
        - Identities
      summary: Reauthenticate Identity
      description: >
        Re-authenticates an identity on demand: validates the saved browser
        profile and runs login if

        it is no longer signed in, then persists the refreshed profile and tears
        the temporary session

        down. Equivalent to a session with `identity_skip_validation: false`
        that ends after auth.
      parameters:
        - name: identityId
          in: path
          required: true
          description: The ID of the identity to reauthenticate
          schema:
            type: string
            format: uuid
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReauthenticateIdentityRequest'
            examples:
              syncReauthenticate:
                summary: Wait for authentication to finish (default)
                value:
                  sync: true
              asyncReauthenticate:
                summary: Start authentication in the background
                value:
                  sync: false
      responses:
        '200':
          description: Identity reauthentication started or completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReauthenticateIdentityResponse'
        '401':
          description: Missing API key for team
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Identity not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '412':
          description: Identity has no credentials to authenticate with
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Identity authentication failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Failed to reauthenticate identity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    ReauthenticateIdentityRequest:
      type: object
      properties:
        sync:
          type: boolean
          default: true
          description: >
            When `true` (default), wait for authentication to finish and persist
            the refreshed

            profile before returning. When `false`, start authentication
            asynchronously.
    ReauthenticateIdentityResponse:
      type: object
      required:
        - identityId
        - async
      properties:
        identityId:
          type: string
          description: The identity that was reauthenticated
        async:
          type: boolean
          description: Whether authentication is still running in the background
    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

````