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

# Save a profile setup session

> Captures cookies, local storage, and session storage from a running setup session into the Browser Context Profile. Requires the session_id returned by setup-session.



## OpenAPI

````yaml https://agent.tinyfish.ai/v1/openapi/main post /v1/profiles/{profileId}/save
openapi: 3.0.0
info:
  title: TinyFish Web Agent Automation API
  version: 1.0.0
  description: >-
    REST API for running AI-powered browser automations. Execute tasks on any
    website using natural language instructions.
  contact:
    name: TinyFish Support
    email: support@tinyfish.ai
servers:
  - url: https://agent.tinyfish.ai
    description: Production
security: []
tags:
  - name: Automation
    description: Browser automation endpoints for executing tasks on websites
  - name: Runs
    description: Endpoints for retrieving automation run data
  - name: Browser
    description: Remote browser session endpoints
  - name: Fetch
    description: Fetch URLs and extract clean page content
  - name: Search
    description: Web search endpoints
  - name: Browser Context Profiles
    description: >-
      Saved browser context endpoints for managing reusable login state,
      cookies, storage, and profile setup sessions
  - name: Vault
    description: >-
      Vault credential management endpoints for connecting password managers and
      managing stored credentials
  - name: Research
    description: Source-backed research report endpoints
  - name: Wallet
    description: Wallet balance, auto-reload, rates, and top-up endpoints
  - name: Monitor
    description: Scheduled Page and Topic Monitor endpoints
  - name: Datasets
    description: Datasets described in plain English and filled by agents
paths:
  /v1/profiles/{profileId}/save:
    post:
      tags:
        - Browser Context Profiles
      summary: Save a profile setup session
      description: >-
        Captures cookies, local storage, and session storage from a running
        setup session into the Browser Context Profile. Requires the session_id
        returned by setup-session.
      operationId: saveBrowserContextProfileSetupSession
      parameters:
        - schema:
            type: string
            minLength: 1
            description: Browser Context Profile ID
            example: prof_abc123def4567890
          required: true
          description: Browser Context Profile ID
          name: profileId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                session_id:
                  type: string
                  minLength: 1
                  example: br-a1b2c3d4-e5f6-7890-abcd-ef1234567890
                signed_in_sites:
                  type: array
                  items:
                    type: string
                    maxLength: 253
                  maxItems: 20
                  description: >-
                    Sites the user says they signed into during this setup, as
                    hosts or URLs. Each is recorded as signed in only if this
                    save wrote cookies for it; for sites TinyFish can check, its
                    sign-in cookie must be saved too. Ignored when sign-in
                    tracking is not enabled for the account.
                  example:
                    - facebook.com
              required:
                - session_id
      responses:
        '200':
          description: Save a profile setup session succeeded.
          content:
            application/json:
              schema:
                type: object
                properties:
                  domains_updated:
                    type: array
                    items:
                      type: string
                    example:
                      - example.com
                  domains_failed:
                    type: array
                    items:
                      type: string
                    example: []
                  cookie_count:
                    type: integer
                    minimum: 0
                    example: 12
                  domains_skipped:
                    type: object
                    properties:
                      cookies_skipped:
                        type: array
                        items:
                          type: string
                        example: []
                      local_storage_skipped:
                        type: array
                        items:
                          type: string
                        example: []
                      session_storage_skipped:
                        type: array
                        items:
                          type: string
                        example: []
                      blob_too_large:
                        type: array
                        items:
                          type: string
                        example: []
                    required:
                      - cookies_skipped
                      - local_storage_skipped
                      - session_storage_skipped
                      - blob_too_large
                  pages_captured:
                    type: integer
                    minimum: 0
                    example: 1
                  target_reads_skipped:
                    type: integer
                    minimum: 0
                    example: 0
                  cleanup_failed:
                    type: boolean
                    example: false
                  cleanup_kind:
                    type: string
                    example: post_save
                  may_not_persist_sites:
                    type: array
                    items:
                      type: string
                    description: >-
                      Sites this setup signed in to whose saved cookies are all
                      session-only; the sign-in may not survive a new browser.
                    example:
                      - dwservice.net
                  signed_in_sites:
                    type: array
                    items:
                      type: string
                    description: >-
                      Sites this save recorded as signed in, from sign-in
                      cookies set during setup. Omitted when sign-in tracking is
                      not enabled for the account.
                    example:
                      - github.com
                  sign_in:
                    type: object
                    properties:
                      site:
                        type: string
                        nullable: true
                      status:
                        type: string
                        enum:
                          - recorded
                          - already_recorded
                          - not_detected
                          - unverifiable
                    required:
                      - site
                      - status
                    description: >-
                      Whether TinyFish saw a sign-in to the site setup started
                      on. unverifiable when it cannot tell. Omitted when sign-in
                      tracking is not enabled for the account.
                    example:
                      site: github.com
                      status: recorded
                  user_confirmed_sites:
                    type: object
                    properties:
                      recorded:
                        type: array
                        items:
                          type: string
                      rejected:
                        type: array
                        items:
                          type: object
                          properties:
                            site:
                              type: string
                            reason:
                              type: string
                              enum:
                                - invalid_site
                                - not_saved
                                - no_sign_in_cookie
                                - record_failed
                          required:
                            - site
                            - reason
                    required:
                      - recorded
                      - rejected
                    description: >-
                      Present when the request sent signed_in_sites and sign-in
                      tracking is enabled for the account: the registered
                      domains recorded as signed in, and the sites rejected with
                      a reason.
                    example:
                      recorded:
                        - facebook.com
                      rejected:
                        - site: notion.so
                          reason: not_saved
                required:
                  - domains_updated
                  - domains_failed
                  - cookie_count
                  - domains_skipped
        '400':
          description: Captured state is invalid or exceeds limits.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - DAILY_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - VAULT_RECONNECT_REQUIRED
                          - FORBIDDEN
                          - NOT_FOUND
                          - FEATURE_NOT_AVAILABLE
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - FREE_ALLOWANCE_EXHAUSTED
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - DAILY_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - VAULT_RECONNECT_REQUIRED
                          - FORBIDDEN
                          - NOT_FOUND
                          - FEATURE_NOT_AVAILABLE
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - FREE_ALLOWANCE_EXHAUSTED
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
        '403':
          description: >-
            Forbidden - a workflow key cannot use personal vault items or
            Browser Context Profiles (FORBIDDEN, details.reason
            workflow_key_personal_credentials); use a personal key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - DAILY_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - VAULT_RECONNECT_REQUIRED
                          - FORBIDDEN
                          - NOT_FOUND
                          - FEATURE_NOT_AVAILABLE
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - FREE_ALLOWANCE_EXHAUSTED
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
        '404':
          description: Browser Context Profile or setup session not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - DAILY_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - VAULT_RECONNECT_REQUIRED
                          - FORBIDDEN
                          - NOT_FOUND
                          - FEATURE_NOT_AVAILABLE
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - FREE_ALLOWANCE_EXHAUSTED
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
        '409':
          description: >-
            Browser session is inactive, the profile is busy, or cleanup
            requires retry.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - DAILY_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - VAULT_RECONNECT_REQUIRED
                          - FORBIDDEN
                          - NOT_FOUND
                          - FEATURE_NOT_AVAILABLE
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - FREE_ALLOWANCE_EXHAUSTED
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - MISSING_API_KEY
                          - INVALID_API_KEY
                          - INVALID_INPUT
                          - RATE_LIMIT_EXCEEDED
                          - DAILY_LIMIT_EXCEEDED
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - VAULT_RECONNECT_REQUIRED
                          - FORBIDDEN
                          - NOT_FOUND
                          - FEATURE_NOT_AVAILABLE
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - FREE_ALLOWANCE_EXHAUSTED
                          - CONTENT_POLICY_VIOLATION
                          - MAX_STEPS_EXCEEDED
                          - SITE_BLOCKED
                          - TASK_FAILED
                          - CANCELLED
                        description: Machine-readable error code
                        example: INVALID_INPUT
                      message:
                        type: string
                        description: Human-readable error message
                        example: Field "url" is required and must be a string
                      details:
                        nullable: true
                        description: Additional error details (validation errors, etc.)
                    required:
                      - code
                      - message
                  request_id:
                    type: string
                    description: >-
                      Request correlation ID, also returned as the X-Request-ID
                      response header. Include it when reporting issues.
                    example: 8f9dba20-e37b-4749-a919-2269e28b4a2c
                required:
                  - error
                description: Standard error response format
      security:
        - ApiKeyAuth: []
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Get your key from the API Keys page.

````

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