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

# Upload Browser Context Profile state

> Upload Browser Context Profile state



## OpenAPI

````yaml https://agent.tinyfish.ai/v1/openapi/main post /v1/profiles/{profileId}/upload
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
paths:
  /v1/profiles/{profileId}/upload:
    post:
      tags:
        - Browser Context Profiles
      summary: Upload Browser Context Profile state
      description: Upload Browser Context Profile state
      operationId: uploadBrowserContextProfileState
      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:
                cookies:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        minLength: 1
                        maxLength: 4096
                      value:
                        type: string
                        maxLength: 16384
                      domain:
                        type: string
                        minLength: 1
                        maxLength: 255
                      path:
                        type: string
                        maxLength: 4096
                      httpOnly:
                        type: boolean
                      secure:
                        type: boolean
                      sameSite:
                        type: string
                        enum:
                          - Strict
                          - Lax
                          - None
                      expires:
                        type: number
                      sourceScheme:
                        type: string
                        maxLength: 10
                      sourcePort:
                        type: number
                      partitionKey:
                        type: string
                        nullable: true
                        maxLength: 255
                      priority:
                        type: string
                        enum:
                          - Low
                          - Medium
                          - High
                    required:
                      - name
                      - value
                      - domain
                    additionalProperties:
                      nullable: true
                  maxItems: 3000
                localStorage:
                  type: array
                  items:
                    type: object
                    properties:
                      origin:
                        type: string
                        minLength: 1
                        maxLength: 2048
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              maxLength: 4096
                            value:
                              type: string
                              maxLength: 5242880
                          required:
                            - name
                            - value
                    required:
                      - origin
                      - items
                  maxItems: 100
                sessionStorage:
                  type: array
                  items:
                    type: object
                    properties:
                      origin:
                        type: string
                        minLength: 1
                        maxLength: 2048
                      items:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                              maxLength: 4096
                            value:
                              type: string
                              maxLength: 5242880
                          required:
                            - name
                            - value
                    required:
                      - origin
                      - items
                  maxItems: 100
              required:
                - cookies
      responses:
        '200':
          description: Upload Browser Context Profile state 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
                required:
                  - domains_updated
                  - domains_failed
                  - cookie_count
                  - domains_skipped
        '400':
          description: Upload body 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
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - 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
                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
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - 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
                required:
                  - error
                description: Standard error response format
        '404':
          description: Browser Context Profile 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
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - 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
                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
                          - INTERNAL_ERROR
                          - RETRY_REQUIRED
                          - UNAUTHORIZED
                          - FORBIDDEN
                          - NOT_FOUND
                          - SERVICE_BUSY
                          - TIMEOUT
                          - INSUFFICIENT_CREDITS
                          - 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
                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.

````