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

# Add task instructions

> Add (append) instructions to an existing task. For example: provide an OTP code after initiating a login task.



## OpenAPI

````yaml POST /tasks/{session_id}/instructions
openapi: 3.0.3
info:
  title: BrowserAI Task API
  version: 1.0.0
  description: API for creating and retrieving browser automation tasks and their results.
servers:
  - url: https://browser.ai/api/v1
security: []
paths:
  /tasks/{session_id}/instructions:
    post:
      tags:
        - Task
      summary: Add instructions to a task
      description: >-
        Add (append) instructions to an existing task. For example: provide an
        OTP code after initiating a login task.
      parameters:
        - name: session_id
          in: path
          required: true
          description: The ID of the task you want to add instructions to.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                instructions:
                  type: array
                  items:
                    type: object
                    properties:
                      action:
                        type: string
                      type:
                        type: string
                    required:
                      - action
              required:
                - instructions
      responses:
        '200':
          description: Instructions added successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  executionId:
                    type: string
                  scriptType:
                    type: string
                  status:
                    type: string
                  geoLocation:
                    $ref: '#/components/schemas/GeoLocation'
                  started:
                    type: string
                    format: date-time
                  estimatedCompletion:
                    type: string
                    format: date-time
        '400':
          description: Invalid input
          content:
            application/json:
              example:
                error: Invalid input
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                error: Unauthorized
        '404':
          description: Task not found
          content:
            application/json:
              example:
                error: Task not found
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                error: Internal server error
      security:
        - ApiKeyAuth: []
components:
  schemas:
    GeoLocation:
      type: object
      required:
        - country
      properties:
        country:
          type: string
          description: '2-letter country code, for example: es for Spain.'
        city:
          type: string
        zipcode:
          type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'Insert API token, use the format: `apikey <API-TOKEN>`.'

````