> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.prolific.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.prolific.com/_mcp/server.

# Create Batch Instructions

POST https://api.prolific.com/api/v1/data-collection/batches/{batch_id}/instructions
Content-Type: application/json

Create instructions for a Task Builder batch.

**Deprecated for batches that use `batch_items`.**

All responses include the [RFC 8594](https://www.rfc-editor.org/rfc/rfc8594) headers `Deprecation: true` and `Sunset: Tue, 01 Sep 2026 23:59:59 GMT`.

If the target batch was created with `batch_items` (the per-item instructions flow), this endpoint will respond with **`422 Unprocessable Entity`** and an error message directing you to manage instructions via the `batch_items` payload instead.

Legacy batches (where `batch_items` is `null`) continue to work and return `201 Created`.

Reference: https://docs.prolific.com/api-reference/ai-task-builder/create-task-builder-instructions

## Authentication

- `Authorization` header (required) (prefixed with `Token `) — The Prolific API uses API token to authenticate requests. You can create an API token directly from your settings. Your API token does not have an expiry date and carries full permission, so be sure to keep them secure. If your token is leaked, delete it and create a new one directly in the app. In your requests add `Authorization` header with the value `Token <your token>`.

## Request

### Path parameters

- `batch_id` (string, required) — The unique identifier of the AI Task Builder batch

### Body (application/json)

This endpoint expects an object.

- `instructions` (list of object, required) — The instructions to create for the AI Task Builder batch.
  - `type` (enum, required) — The type of instruction.
    - Allowed values: `multiple_choice`, `free_text`, `free_text_with_unit`, `multiple_choice_with_free_text`, `file_upload`
  - `description` (string, required) — The question or prompt displayed to participants.
  - `helper_text` (string, optional) — Additional guidance text displayed below the question.
  - `placeholder_text_input` (string, optional) — Placeholder text displayed in the input field.
  - `answer_limit` (integer, optional) — Number of options that can be selected (required for multiple_choice and multiple_choice_with_free_text). Use 1 for single-select, -1 for unlimited.
  - `disable_dropdown` (boolean, optional, default: false) — When true, always renders checkbox/radio elements instead of a dropdown select. By default, a dropdown is used when there are 5 or more options.
  - `options` (list of object, optional) — The options (required for multiple_choice and multiple_choice_with_free_text).
    - `label` (string, required) — The display label for the option.
    - `value` (string, required) — The value associated with the option.
    - `heading` (string, optional) — The heading for the option (required for multiple_choice_with_free_text).
  - `unit_options` (list of object, optional) — The unit options (required for free_text_with_unit). List of available units that participants can select from.
    - `label` (string, required) — The display label for the unit.
    - `value` (string or double or boolean, required) — The value associated with the unit.
    - `validation` (object, optional) — Optional validation constraints for this unit option.
      - `type` (enum, required) — The expected input type. When "number", the input must be numeric and min/max constrain the numeric value. When "string", the input is treated as text and min/max constrain the character count.
        - Allowed values: `number`, `string`
      - `min` (double, optional, nullable) — Minimum value (for type "number") or minimum character count (for type "string"). Null means unbounded. When type is "string", must be a non-negative integer. If both min and max are provided, min must be less than or equal to max.
      - `max` (double, optional, nullable) — Maximum value (for type "number") or maximum character count (for type "string"). Null means unbounded. When type is "string", must be a non-negative integer. If both min and max are provided, max must be greater than or equal to min.
  - `default_unit` (string, optional) — For free_text_with_unit. Default selected unit (must match a value from unit_options).
  - `unit_position` (enum, optional) — Required for free_text_with_unit. Position of the unit selector relative to the text input. Use 'prefix' for units before the input (e.g., currency symbols) or 'suffix' for units after the input (e.g., measurements).
    - Allowed values: `prefix`, `suffix`
  - `validation` (object, optional) — Optional validation constraints for the input value (for free_text).
    - `type` (enum, required) — The expected input type. When "number", the input must be numeric and min/max constrain the numeric value. When "string", the input is treated as text and min/max constrain the character count.
      - Allowed values: `number`, `string`
    - `min` (double, optional, nullable) — Minimum value (for type "number") or minimum character count (for type "string"). Null means unbounded. When type is "string", must be a non-negative integer. If both min and max are provided, min must be less than or equal to max.
    - `max` (double, optional, nullable) — Maximum value (for type "number") or maximum character count (for type "string"). Null means unbounded. When type is "string", must be a non-negative integer. If both min and max are provided, max must be greater than or equal to min.

## Response

### 201

Created. Returned only for legacy batches (`batch_items` is `null`).

- `list of object`
  - `type`: `multiple_choice` (multiple_choice)
    - `answer_limit` (integer, required) — Number of options that can be selected. Use 1 for single-select, -1 for unlimited, or any number up to the total options.
    - `created_at` (datetime, required)
    - `created_by` (string, required)
    - `description` (string, required) — The question or prompt displayed to participants
    - `id` (string, required)
    - `options` (list of object, required)
      - `label` (string, required) — Display text shown to participants
      - `value` (string or double or boolean, required) — Value returned in responses
      - `exclusive` (boolean, optional) — When true, selecting this option deselects all other options. Useful for "None of the above" style options.
    - `parent_id` (string, required) — ID of the parent batch or collection
    - `parent_type` (enum, required)
      - Allowed values: `batch`, `collection`
    - `disable_dropdown` (boolean, optional, default: false) — When true, always renders checkbox/radio elements instead of a dropdown select, regardless of option count. By default, a dropdown is used when there are 5 or more options.
    - `helper_text` (string, optional) — Additional guidance text displayed below the question
    - `placeholder_text_input` (string, optional) — Placeholder text displayed in the input field
  - `type`: `free_text` (free_text)
    - `created_at` (datetime, required)
    - `created_by` (string, required)
    - `description` (string, required) — The question or prompt displayed to participants
    - `id` (string, required)
    - `parent_id` (string, required) — ID of the parent batch or collection
    - `parent_type` (enum, required)
      - Allowed values: `batch`, `collection`
    - `helper_text` (string, optional) — Additional guidance text displayed below the question
    - `placeholder_text_input` (string, optional) — Placeholder text displayed in the input field
    - `validation` (object, optional) — Optional validation constraints for the input value
      - `type` (enum, required) — The expected input type. When "number", the input must be numeric and min/max constrain the numeric value. When "string", the input is treated as text and min/max constrain the character count.
        - Allowed values: `number`, `string`
      - `min` (double, optional, nullable) — Minimum value (for type "number") or minimum character count (for type "string"). Null means unbounded. When type is "string", must be a non-negative integer. If both min and max are provided, min must be less than or equal to max.
      - `max` (double, optional, nullable) — Maximum value (for type "number") or maximum character count (for type "string"). Null means unbounded. When type is "string", must be a non-negative integer. If both min and max are provided, max must be greater than or equal to min.
  - `type`: `free_text_with_unit` (free_text_with_unit)
    - `created_at` (datetime, required)
    - `created_by` (string, required)
    - `description` (string, required) — The question or prompt displayed to participants
    - `id` (string, required)
    - `parent_id` (string, required) — ID of the parent batch or collection
    - `parent_type` (enum, required)
      - Allowed values: `batch`, `collection`
    - `unit_options` (list of object, required) — List of available units that participants can select from
      - `label` (string, required) — Display text shown to participants
      - `value` (string or double or boolean, required) — Value returned in responses
      - `validation` (object, optional) — Optional validation constraints for this unit option
        - `type` (enum, required) — The expected input type. When "number", the input must be numeric and min/max constrain the numeric value. When "string", the input is treated as text and min/max constrain the character count.
          - Allowed values: `number`, `string`
        - `min` (double, optional, nullable) — Minimum value (for type "number") or minimum character count (for type "string"). Null means unbounded. When type is "string", must be a non-negative integer. If both min and max are provided, min must be less than or equal to max.
        - `max` (double, optional, nullable) — Maximum value (for type "number") or maximum character count (for type "string"). Null means unbounded. When type is "string", must be a non-negative integer. If both min and max are provided, max must be greater than or equal to min.
    - `unit_position` (enum, required) — Position of the unit selector relative to the text input. Use 'prefix' for units before the input (e.g., currency symbols) or 'suffix' for units after the input (e.g., measurements).
      - Allowed values: `prefix`, `suffix`
    - `default_unit` (string, optional) — Default selected unit (must match a value from unit_options)
    - `helper_text` (string, optional) — Additional guidance text displayed below the question
    - `placeholder_text_input` (string, optional) — Placeholder text displayed in the input field
  - `type`: `multiple_choice_with_free_text` (multiple_choice_with_free_text)
    - `answer_limit` (integer, required) — Number of options that can be selected. Use 1 for single-select, -1 for unlimited, or any number up to the total options.
    - `created_at` (datetime, required)
    - `created_by` (string, required)
    - `description` (string, required) — The question or prompt displayed to participants
    - `id` (string, required)
    - `options` (list of object, required)
      - `label` (string, required) — Display text shown to participants
      - `value` (string or double or boolean, required) — Value returned in responses
      - `heading` (string, required) — Section heading that groups this option
      - `exclusive` (boolean, optional) — When true, selecting this option deselects all other options. Useful for "None of the above" style options.
    - `parent_id` (string, required) — ID of the parent batch or collection
    - `parent_type` (enum, required)
      - Allowed values: `batch`, `collection`
    - `disable_dropdown` (boolean, optional, default: false) — When true, always renders checkbox/radio elements instead of a dropdown select, regardless of option count. By default, a dropdown is used when there are 5 or more options.
    - `helper_text` (string, optional) — Additional guidance text displayed below the question
    - `placeholder_text_input` (string, optional) — Placeholder text displayed in the input field
  - `type`: `file_upload` (file_upload)
    - `created_at` (datetime, required)
    - `created_by` (string, required)
    - `description` (string, required) — The prompt describing what to upload
    - `id` (string, required)
    - `parent_id` (string, required) — ID of the parent batch or collection
    - `parent_type` (enum, required)
      - Allowed values: `batch`, `collection`
    - `accepted_file_types` (list of string, optional) — File extensions to accept (e.g., [".jpg", ".png", ".pdf"]). Each extension must start with a dot. Defaults to [".jpg", ".jpeg", ".png", ".heic", ".heif"] if not specified.
    - `helper_text` (string, optional) — Additional guidance text displayed below the question
    - `max_file_count` (integer, optional) — Maximum number of files allowed. Must be at least 1 and greater than or equal to min_file_count. Defaults to 10.
    - `max_file_size_mb` (double, optional) — Maximum file size in megabytes per file. Must be a positive number. Defaults to 25.
    - `min_file_count` (integer, optional) — Minimum number of files required. Must be at least 1. Defaults to 1.
    - `placeholder_text_input` (string, optional) — Placeholder text displayed in the input field

## Errors

### 422 Unprocessable Entity Error

Returned when the target batch uses `batch_items`. Instructions must be managed via the `batch_items` payload instead of this endpoint.

- `error` (object, required)
  - `status` (integer, required) — Status code as in the http standards
  - `error_code` (integer, required) — Internal error code
  - `title` (string, required) — Error title
  - `detail` (string or list of string or object, required) — Error detail
    - object
      - `any_field` (list of string, optional) — Name of the field with a validation error and as a value an array with the error descriptions
  - `additional_information` (string, optional) — Optional extra information
  - `traceback` (string, optional) — Optional debug information
  - `interactive` (boolean, optional)

### 400 Client Request Error

Error

- `error` (object, required)
  - `status` (integer, required) — Status code as in the http standards
  - `error_code` (integer, required) — Internal error code
  - `title` (string, required) — Error title
  - `detail` (string or list of string or object, required) — Error detail
    - object
      - `any_field` (list of string, optional) — Name of the field with a validation error and as a value an array with the error descriptions
  - `additional_information` (string, optional) — Optional extra information
  - `traceback` (string, optional) — Optional debug information
  - `interactive` (boolean, optional)

## Examples

**Request**

```json
{
  "instructions": [
    {
      "type": "multiple_choice",
      "description": "Choose the LLM response which is more accurate.",
      "answer_limit": 1,
      "options": [
        {
          "label": "Response 1",
          "value": "response1"
        },
        {
          "label": "Response 2",
          "value": "response2"
        }
      ]
    },
    {
      "type": "free_text",
      "description": "Please share the reasons for your choice.",
      "placeholder_text_input": "e.g. I chose this response because..."
    },
    {
      "type": "multiple_choice_with_free_text",
      "description": "Rate each aspect and explain your reasoning.",
      "answer_limit": -1,
      "options": [
        {
          "label": "Good",
          "value": "accuracy_good",
          "heading": "Accuracy"
        },
        {
          "label": "Needs improvement",
          "value": "accuracy_poor",
          "heading": "Accuracy"
        }
      ]
    },
    {
      "type": "free_text_with_unit",
      "description": "What is your height?",
      "unit_options": [
        {
          "label": "Centimeters",
          "value": "cm",
          "validation": {
            "type": "number",
            "min": 50,
            "max": 300
          }
        },
        {
          "label": "Feet",
          "value": "ft",
          "validation": {
            "type": "number",
            "min": 1,
            "max": 9
          }
        }
      ],
      "unit_position": "suffix"
    },
    {
      "type": "file_upload",
      "description": "Upload a photo of the item",
      "accepted_file_types": [
        ".jpg",
        ".jpeg",
        ".png"
      ],
      "max_file_size_mb": 10,
      "min_file_count": 1,
      "max_file_count": 3
    }
  ]
}
```

**Response**

```json
[
  {
    "type": "multiple_choice",
    "answer_limit": 1,
    "created_at": "2024-09-18T07:50:15.055Z",
    "created_by": "Sean",
    "description": "Choose the LLM response which is more accurate.",
    "id": "0192041c-470f-7336-8e3d-e03fc086a4e1",
    "options": [
      {
        "label": "Response 1",
        "value": "response1"
      },
      {
        "label": "Response 2",
        "value": "response2"
      }
    ],
    "parent_id": "01974850-9e29-744a-811c-b26612812345",
    "parent_type": "batch"
  },
  {
    "type": "free_text",
    "created_at": "2024-09-18T07:50:15.056Z",
    "created_by": "Sean",
    "description": "Please share the reasons for your choice.",
    "id": "0192041c-4710-7336-8e3d-e9b6149c0797",
    "parent_id": "01974850-9e29-744a-811c-b26612812345",
    "parent_type": "batch"
  },
  {
    "type": "multiple_choice_with_free_text",
    "answer_limit": -1,
    "created_at": "2024-09-18T07:50:15.057Z",
    "created_by": "Sean",
    "description": "Rate each aspect and explain your reasoning.",
    "id": "0192041c-4712-7336-8e3d-a2b3c4d5e6f7",
    "options": [
      {
        "label": "Good",
        "value": "accuracy_good",
        "heading": "Accuracy"
      },
      {
        "label": "Needs improvement",
        "value": "accuracy_poor",
        "heading": "Accuracy"
      }
    ],
    "parent_id": "01974850-9e29-744a-811c-b26612812345",
    "parent_type": "batch"
  },
  {
    "type": "free_text_with_unit",
    "created_at": "2024-09-18T07:50:15.058Z",
    "created_by": "Sean",
    "description": "What is your height?",
    "id": "0192041c-4713-7336-8e3d-b3c4d5e6f7a8",
    "parent_id": "01974850-9e29-744a-811c-b26612812345",
    "parent_type": "batch",
    "unit_options": [
      {
        "label": "Centimeters",
        "value": "cm",
        "validation": {
          "type": "number",
          "min": 50,
          "max": 300
        }
      },
      {
        "label": "Feet",
        "value": "ft",
        "validation": {
          "type": "number",
          "min": 1,
          "max": 9
        }
      }
    ],
    "unit_position": "suffix"
  },
  {
    "type": "file_upload",
    "created_at": "2024-09-18T07:50:15.059Z",
    "created_by": "Sean",
    "description": "Upload a photo of the item",
    "id": "0192041c-4711-7336-8e3d-f1c7260d1898",
    "parent_id": "01974850-9e29-744a-811c-b26612812345",
    "parent_type": "batch",
    "accepted_file_types": [
      ".jpg",
      ".jpeg",
      ".png"
    ],
    "max_file_count": 3,
    "max_file_size_mb": 10,
    "min_file_count": 1
  }
]
```

**SDK Code**

```python AI Task Builder_CreateTaskBuilderInstructions_example
import requests

url = "https://api.prolific.com/api/v1/data-collection/batches/5f7b5e9a-3f3c-4b3e-8f1a-1a2b3c4d5e6f/instructions"

payload = { "instructions": [
        {
            "type": "multiple_choice",
            "description": "Choose the LLM response which is more accurate.",
            "answer_limit": 1,
            "options": [
                {
                    "label": "Response 1",
                    "value": "response1"
                },
                {
                    "label": "Response 2",
                    "value": "response2"
                }
            ]
        },
        {
            "type": "free_text",
            "description": "Please share the reasons for your choice.",
            "placeholder_text_input": "e.g. I chose this response because..."
        },
        {
            "type": "multiple_choice_with_free_text",
            "description": "Rate each aspect and explain your reasoning.",
            "answer_limit": -1,
            "options": [
                {
                    "label": "Good",
                    "value": "accuracy_good",
                    "heading": "Accuracy"
                },
                {
                    "label": "Needs improvement",
                    "value": "accuracy_poor",
                    "heading": "Accuracy"
                }
            ]
        },
        {
            "type": "free_text_with_unit",
            "description": "What is your height?",
            "unit_options": [
                {
                    "label": "Centimeters",
                    "value": "cm",
                    "validation": {
                        "type": "number",
                        "min": 50,
                        "max": 300
                    }
                },
                {
                    "label": "Feet",
                    "value": "ft",
                    "validation": {
                        "type": "number",
                        "min": 1,
                        "max": 9
                    }
                }
            ],
            "unit_position": "suffix"
        },
        {
            "type": "file_upload",
            "description": "Upload a photo of the item",
            "accepted_file_types": [".jpg", ".jpeg", ".png"],
            "max_file_size_mb": 10,
            "min_file_count": 1,
            "max_file_count": 3
        }
    ] }
headers = {
    "Authorization": "Token <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript AI Task Builder_CreateTaskBuilderInstructions_example
const url = 'https://api.prolific.com/api/v1/data-collection/batches/5f7b5e9a-3f3c-4b3e-8f1a-1a2b3c4d5e6f/instructions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
  body: '{"instructions":[{"type":"multiple_choice","description":"Choose the LLM response which is more accurate.","answer_limit":1,"options":[{"label":"Response 1","value":"response1"},{"label":"Response 2","value":"response2"}]},{"type":"free_text","description":"Please share the reasons for your choice.","placeholder_text_input":"e.g. I chose this response because..."},{"type":"multiple_choice_with_free_text","description":"Rate each aspect and explain your reasoning.","answer_limit":-1,"options":[{"label":"Good","value":"accuracy_good","heading":"Accuracy"},{"label":"Needs improvement","value":"accuracy_poor","heading":"Accuracy"}]},{"type":"free_text_with_unit","description":"What is your height?","unit_options":[{"label":"Centimeters","value":"cm","validation":{"type":"number","min":50,"max":300}},{"label":"Feet","value":"ft","validation":{"type":"number","min":1,"max":9}}],"unit_position":"suffix"},{"type":"file_upload","description":"Upload a photo of the item","accepted_file_types":[".jpg",".jpeg",".png"],"max_file_size_mb":10,"min_file_count":1,"max_file_count":3}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go AI Task Builder_CreateTaskBuilderInstructions_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.prolific.com/api/v1/data-collection/batches/5f7b5e9a-3f3c-4b3e-8f1a-1a2b3c4d5e6f/instructions"

	payload := strings.NewReader("{\n  \"instructions\": [\n    {\n      \"type\": \"multiple_choice\",\n      \"description\": \"Choose the LLM response which is more accurate.\",\n      \"answer_limit\": 1,\n      \"options\": [\n        {\n          \"label\": \"Response 1\",\n          \"value\": \"response1\"\n        },\n        {\n          \"label\": \"Response 2\",\n          \"value\": \"response2\"\n        }\n      ]\n    },\n    {\n      \"type\": \"free_text\",\n      \"description\": \"Please share the reasons for your choice.\",\n      \"placeholder_text_input\": \"e.g. I chose this response because...\"\n    },\n    {\n      \"type\": \"multiple_choice_with_free_text\",\n      \"description\": \"Rate each aspect and explain your reasoning.\",\n      \"answer_limit\": -1,\n      \"options\": [\n        {\n          \"label\": \"Good\",\n          \"value\": \"accuracy_good\",\n          \"heading\": \"Accuracy\"\n        },\n        {\n          \"label\": \"Needs improvement\",\n          \"value\": \"accuracy_poor\",\n          \"heading\": \"Accuracy\"\n        }\n      ]\n    },\n    {\n      \"type\": \"free_text_with_unit\",\n      \"description\": \"What is your height?\",\n      \"unit_options\": [\n        {\n          \"label\": \"Centimeters\",\n          \"value\": \"cm\",\n          \"validation\": {\n            \"type\": \"number\",\n            \"min\": 50,\n            \"max\": 300\n          }\n        },\n        {\n          \"label\": \"Feet\",\n          \"value\": \"ft\",\n          \"validation\": {\n            \"type\": \"number\",\n            \"min\": 1,\n            \"max\": 9\n          }\n        }\n      ],\n      \"unit_position\": \"suffix\"\n    },\n    {\n      \"type\": \"file_upload\",\n      \"description\": \"Upload a photo of the item\",\n      \"accepted_file_types\": [\n        \".jpg\",\n        \".jpeg\",\n        \".png\"\n      ],\n      \"max_file_size_mb\": 10,\n      \"min_file_count\": 1,\n      \"max_file_count\": 3\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Token <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby AI Task Builder_CreateTaskBuilderInstructions_example
require 'uri'
require 'net/http'

url = URI("https://api.prolific.com/api/v1/data-collection/batches/5f7b5e9a-3f3c-4b3e-8f1a-1a2b3c4d5e6f/instructions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"instructions\": [\n    {\n      \"type\": \"multiple_choice\",\n      \"description\": \"Choose the LLM response which is more accurate.\",\n      \"answer_limit\": 1,\n      \"options\": [\n        {\n          \"label\": \"Response 1\",\n          \"value\": \"response1\"\n        },\n        {\n          \"label\": \"Response 2\",\n          \"value\": \"response2\"\n        }\n      ]\n    },\n    {\n      \"type\": \"free_text\",\n      \"description\": \"Please share the reasons for your choice.\",\n      \"placeholder_text_input\": \"e.g. I chose this response because...\"\n    },\n    {\n      \"type\": \"multiple_choice_with_free_text\",\n      \"description\": \"Rate each aspect and explain your reasoning.\",\n      \"answer_limit\": -1,\n      \"options\": [\n        {\n          \"label\": \"Good\",\n          \"value\": \"accuracy_good\",\n          \"heading\": \"Accuracy\"\n        },\n        {\n          \"label\": \"Needs improvement\",\n          \"value\": \"accuracy_poor\",\n          \"heading\": \"Accuracy\"\n        }\n      ]\n    },\n    {\n      \"type\": \"free_text_with_unit\",\n      \"description\": \"What is your height?\",\n      \"unit_options\": [\n        {\n          \"label\": \"Centimeters\",\n          \"value\": \"cm\",\n          \"validation\": {\n            \"type\": \"number\",\n            \"min\": 50,\n            \"max\": 300\n          }\n        },\n        {\n          \"label\": \"Feet\",\n          \"value\": \"ft\",\n          \"validation\": {\n            \"type\": \"number\",\n            \"min\": 1,\n            \"max\": 9\n          }\n        }\n      ],\n      \"unit_position\": \"suffix\"\n    },\n    {\n      \"type\": \"file_upload\",\n      \"description\": \"Upload a photo of the item\",\n      \"accepted_file_types\": [\n        \".jpg\",\n        \".jpeg\",\n        \".png\"\n      ],\n      \"max_file_size_mb\": 10,\n      \"min_file_count\": 1,\n      \"max_file_count\": 3\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java AI Task Builder_CreateTaskBuilderInstructions_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/data-collection/batches/5f7b5e9a-3f3c-4b3e-8f1a-1a2b3c4d5e6f/instructions")
  .header("Authorization", "Token <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"instructions\": [\n    {\n      \"type\": \"multiple_choice\",\n      \"description\": \"Choose the LLM response which is more accurate.\",\n      \"answer_limit\": 1,\n      \"options\": [\n        {\n          \"label\": \"Response 1\",\n          \"value\": \"response1\"\n        },\n        {\n          \"label\": \"Response 2\",\n          \"value\": \"response2\"\n        }\n      ]\n    },\n    {\n      \"type\": \"free_text\",\n      \"description\": \"Please share the reasons for your choice.\",\n      \"placeholder_text_input\": \"e.g. I chose this response because...\"\n    },\n    {\n      \"type\": \"multiple_choice_with_free_text\",\n      \"description\": \"Rate each aspect and explain your reasoning.\",\n      \"answer_limit\": -1,\n      \"options\": [\n        {\n          \"label\": \"Good\",\n          \"value\": \"accuracy_good\",\n          \"heading\": \"Accuracy\"\n        },\n        {\n          \"label\": \"Needs improvement\",\n          \"value\": \"accuracy_poor\",\n          \"heading\": \"Accuracy\"\n        }\n      ]\n    },\n    {\n      \"type\": \"free_text_with_unit\",\n      \"description\": \"What is your height?\",\n      \"unit_options\": [\n        {\n          \"label\": \"Centimeters\",\n          \"value\": \"cm\",\n          \"validation\": {\n            \"type\": \"number\",\n            \"min\": 50,\n            \"max\": 300\n          }\n        },\n        {\n          \"label\": \"Feet\",\n          \"value\": \"ft\",\n          \"validation\": {\n            \"type\": \"number\",\n            \"min\": 1,\n            \"max\": 9\n          }\n        }\n      ],\n      \"unit_position\": \"suffix\"\n    },\n    {\n      \"type\": \"file_upload\",\n      \"description\": \"Upload a photo of the item\",\n      \"accepted_file_types\": [\n        \".jpg\",\n        \".jpeg\",\n        \".png\"\n      ],\n      \"max_file_size_mb\": 10,\n      \"min_file_count\": 1,\n      \"max_file_count\": 3\n    }\n  ]\n}")
  .asString();
```

```php AI Task Builder_CreateTaskBuilderInstructions_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.prolific.com/api/v1/data-collection/batches/5f7b5e9a-3f3c-4b3e-8f1a-1a2b3c4d5e6f/instructions', [
  'body' => '{
  "instructions": [
    {
      "type": "multiple_choice",
      "description": "Choose the LLM response which is more accurate.",
      "answer_limit": 1,
      "options": [
        {
          "label": "Response 1",
          "value": "response1"
        },
        {
          "label": "Response 2",
          "value": "response2"
        }
      ]
    },
    {
      "type": "free_text",
      "description": "Please share the reasons for your choice.",
      "placeholder_text_input": "e.g. I chose this response because..."
    },
    {
      "type": "multiple_choice_with_free_text",
      "description": "Rate each aspect and explain your reasoning.",
      "answer_limit": -1,
      "options": [
        {
          "label": "Good",
          "value": "accuracy_good",
          "heading": "Accuracy"
        },
        {
          "label": "Needs improvement",
          "value": "accuracy_poor",
          "heading": "Accuracy"
        }
      ]
    },
    {
      "type": "free_text_with_unit",
      "description": "What is your height?",
      "unit_options": [
        {
          "label": "Centimeters",
          "value": "cm",
          "validation": {
            "type": "number",
            "min": 50,
            "max": 300
          }
        },
        {
          "label": "Feet",
          "value": "ft",
          "validation": {
            "type": "number",
            "min": 1,
            "max": 9
          }
        }
      ],
      "unit_position": "suffix"
    },
    {
      "type": "file_upload",
      "description": "Upload a photo of the item",
      "accepted_file_types": [
        ".jpg",
        ".jpeg",
        ".png"
      ],
      "max_file_size_mb": 10,
      "min_file_count": 1,
      "max_file_count": 3
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Token <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp AI Task Builder_CreateTaskBuilderInstructions_example
using RestSharp;

var client = new RestClient("https://api.prolific.com/api/v1/data-collection/batches/5f7b5e9a-3f3c-4b3e-8f1a-1a2b3c4d5e6f/instructions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"instructions\": [\n    {\n      \"type\": \"multiple_choice\",\n      \"description\": \"Choose the LLM response which is more accurate.\",\n      \"answer_limit\": 1,\n      \"options\": [\n        {\n          \"label\": \"Response 1\",\n          \"value\": \"response1\"\n        },\n        {\n          \"label\": \"Response 2\",\n          \"value\": \"response2\"\n        }\n      ]\n    },\n    {\n      \"type\": \"free_text\",\n      \"description\": \"Please share the reasons for your choice.\",\n      \"placeholder_text_input\": \"e.g. I chose this response because...\"\n    },\n    {\n      \"type\": \"multiple_choice_with_free_text\",\n      \"description\": \"Rate each aspect and explain your reasoning.\",\n      \"answer_limit\": -1,\n      \"options\": [\n        {\n          \"label\": \"Good\",\n          \"value\": \"accuracy_good\",\n          \"heading\": \"Accuracy\"\n        },\n        {\n          \"label\": \"Needs improvement\",\n          \"value\": \"accuracy_poor\",\n          \"heading\": \"Accuracy\"\n        }\n      ]\n    },\n    {\n      \"type\": \"free_text_with_unit\",\n      \"description\": \"What is your height?\",\n      \"unit_options\": [\n        {\n          \"label\": \"Centimeters\",\n          \"value\": \"cm\",\n          \"validation\": {\n            \"type\": \"number\",\n            \"min\": 50,\n            \"max\": 300\n          }\n        },\n        {\n          \"label\": \"Feet\",\n          \"value\": \"ft\",\n          \"validation\": {\n            \"type\": \"number\",\n            \"min\": 1,\n            \"max\": 9\n          }\n        }\n      ],\n      \"unit_position\": \"suffix\"\n    },\n    {\n      \"type\": \"file_upload\",\n      \"description\": \"Upload a photo of the item\",\n      \"accepted_file_types\": [\n        \".jpg\",\n        \".jpeg\",\n        \".png\"\n      ],\n      \"max_file_size_mb\": 10,\n      \"min_file_count\": 1,\n      \"max_file_count\": 3\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift AI Task Builder_CreateTaskBuilderInstructions_example
import Foundation

let headers = [
  "Authorization": "Token <token>",
  "Content-Type": "application/json"
]
let parameters = ["instructions": [
    [
      "type": "multiple_choice",
      "description": "Choose the LLM response which is more accurate.",
      "answer_limit": 1,
      "options": [
        [
          "label": "Response 1",
          "value": "response1"
        ],
        [
          "label": "Response 2",
          "value": "response2"
        ]
      ]
    ],
    [
      "type": "free_text",
      "description": "Please share the reasons for your choice.",
      "placeholder_text_input": "e.g. I chose this response because..."
    ],
    [
      "type": "multiple_choice_with_free_text",
      "description": "Rate each aspect and explain your reasoning.",
      "answer_limit": -1,
      "options": [
        [
          "label": "Good",
          "value": "accuracy_good",
          "heading": "Accuracy"
        ],
        [
          "label": "Needs improvement",
          "value": "accuracy_poor",
          "heading": "Accuracy"
        ]
      ]
    ],
    [
      "type": "free_text_with_unit",
      "description": "What is your height?",
      "unit_options": [
        [
          "label": "Centimeters",
          "value": "cm",
          "validation": [
            "type": "number",
            "min": 50,
            "max": 300
          ]
        ],
        [
          "label": "Feet",
          "value": "ft",
          "validation": [
            "type": "number",
            "min": 1,
            "max": 9
          ]
        ]
      ],
      "unit_position": "suffix"
    ],
    [
      "type": "file_upload",
      "description": "Upload a photo of the item",
      "accepted_file_types": [".jpg", ".jpeg", ".png"],
      "max_file_size_mb": 10,
      "min_file_count": 1,
      "max_file_count": 3
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/data-collection/batches/5f7b5e9a-3f3c-4b3e-8f1a-1a2b3c4d5e6f/instructions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```