# Create a Collection POST https://api.prolific.com/api/v1/data-collection/collections Content-Type: application/json Create a new AI Task Builder Collection. Collections allow you to define static content and instructions without requiring a dataset upload. Unlike Batches, Collections do not require a dataset or setup step — they can be published to a study immediately after creation. Reference: https://beta-docs.prolific.com/api-reference/ai-task-builder/create-collection ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Create a Collection version: endpoint_aiTaskBuilder.CreateCollection paths: /api/v1/data-collection/collections: post: operationId: create-collection summary: Create a Collection description: >- Create a new AI Task Builder Collection. Collections allow you to define static content and instructions without requiring a dataset upload. Unlike Batches, Collections do not require a dataset or setup step — they can be published to a study immediately after creation. tags: - - subpackage_aiTaskBuilder parameters: - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/Collection' '400': description: Error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/CollectionCreateRequest' components: schemas: TaskDetails: type: object properties: task_name: type: string description: The title displayed to participants task_introduction: type: string description: HTML formatted introduction shown at the start of the task task_steps: type: string description: HTML formatted step-by-step instructions required: - task_name - task_introduction - task_steps CollectionInstructionInputType: type: string enum: - value: multiple_choice - value: free_text - value: multiple_choice_with_free_text - value: file_upload CollectionInstructionInputOptionsItemsValue: oneOf: - type: string - type: number format: double - type: boolean CollectionInstructionInputOptionsItems: type: object properties: label: type: string value: $ref: '#/components/schemas/CollectionInstructionInputOptionsItemsValue' heading: type: string description: Required for multiple_choice_with_free_text required: - label - value CollectionInstructionInput: type: object properties: id: type: string format: uuid description: Include to preserve an existing instruction when updating type: $ref: '#/components/schemas/CollectionInstructionInputType' description: type: string description: The question or prompt displayed to participants order: type: integer description: Position of this instruction relative to others helper_text: type: string description: Additional guidance text displayed below the question placeholder_text_input: type: string description: Placeholder text displayed in the input field answer_limit: type: integer description: >- Number of options that can be selected. Use 1 for single-select, -1 for unlimited. disable_dropdown: type: boolean default: false description: >- When true, always renders checkbox/radio elements instead of a dropdown select. options: type: array items: $ref: '#/components/schemas/CollectionInstructionInputOptionsItems' required: - type - description - order ContentBlockInputType: type: string enum: - value: image - value: rich_text ContentBlockInput: type: object properties: id: type: string format: uuid description: Include to preserve an existing content block when updating type: $ref: '#/components/schemas/ContentBlockInputType' url: type: string format: uri description: HTTPS URL for image content blocks alt_text: type: string description: Alt text for image content blocks (required for accessibility) caption: type: string description: Optional caption for image content blocks content: type: string description: Markdown content for rich_text content blocks required: - type PageItemInput: oneOf: - $ref: '#/components/schemas/CollectionInstructionInput' - $ref: '#/components/schemas/ContentBlockInput' CollectionItemInput: type: object properties: id: type: string format: uuid description: Include to preserve an existing page when updating page_items: type: array items: $ref: '#/components/schemas/PageItemInput' description: Instructions and content blocks on this page required: - page_items CollectionCreateRequest: type: object properties: name: type: string description: The name of the collection workspace_id: type: string description: The ID of the Prolific workspace task_details: $ref: '#/components/schemas/TaskDetails' collection_items: type: array items: $ref: '#/components/schemas/CollectionItemInput' description: Pages within the collection required: - name - workspace_id - task_details - collection_items CollectionSchemaVersion: type: string enum: - value: '1' CollectionItemSchemaVersion: type: string enum: - value: '1' CollectionMultipleChoiceInstructionType: type: string enum: - value: multiple_choice CollectionMultipleChoiceInstructionOptionsItemsValue: oneOf: - type: string - type: number format: double - type: boolean CollectionMultipleChoiceInstructionOptionsItems: type: object properties: label: type: string value: $ref: >- #/components/schemas/CollectionMultipleChoiceInstructionOptionsItemsValue required: - label - value CollectionMultipleChoiceInstruction: type: object properties: id: type: string format: uuid created_at: type: string format: date-time type: $ref: '#/components/schemas/CollectionMultipleChoiceInstructionType' collection_id: type: string format: uuid created_by: type: string description: type: string order: type: integer helper_text: type: string description: Additional guidance text displayed below the question placeholder_text_input: type: string description: Placeholder text displayed in the input field answer_limit: type: integer disable_dropdown: type: boolean default: false options: type: array items: $ref: >- #/components/schemas/CollectionMultipleChoiceInstructionOptionsItems required: - id - created_at - type - collection_id - created_by - description - order - answer_limit - options CollectionFreeTextInstructionType: type: string enum: - value: free_text CollectionFreeTextInstruction: type: object properties: id: type: string format: uuid created_at: type: string format: date-time type: $ref: '#/components/schemas/CollectionFreeTextInstructionType' collection_id: type: string format: uuid created_by: type: string description: type: string order: type: integer helper_text: type: string description: Additional guidance text displayed below the question placeholder_text_input: type: string description: Placeholder text displayed in the input field required: - id - created_at - type - collection_id - created_by - description - order CollectionMultipleChoiceWithFreeTextInstructionType: type: string enum: - value: multiple_choice_with_free_text CollectionMultipleChoiceWithFreeTextInstructionOptionsItemsValue: oneOf: - type: string - type: number format: double - type: boolean CollectionMultipleChoiceWithFreeTextInstructionOptionsItems: type: object properties: label: type: string value: $ref: >- #/components/schemas/CollectionMultipleChoiceWithFreeTextInstructionOptionsItemsValue heading: type: string required: - label - value - heading CollectionMultipleChoiceWithFreeTextInstruction: type: object properties: id: type: string format: uuid created_at: type: string format: date-time type: $ref: >- #/components/schemas/CollectionMultipleChoiceWithFreeTextInstructionType collection_id: type: string format: uuid created_by: type: string description: type: string order: type: integer helper_text: type: string description: Additional guidance text displayed below the question placeholder_text_input: type: string description: Placeholder text displayed in the input field answer_limit: type: integer disable_dropdown: type: boolean default: false options: type: array items: $ref: >- #/components/schemas/CollectionMultipleChoiceWithFreeTextInstructionOptionsItems required: - id - created_at - type - collection_id - created_by - description - order - answer_limit - options CollectionFileUploadInstructionType: type: string enum: - value: file_upload CollectionFileUploadInstruction: type: object properties: id: type: string format: uuid created_at: type: string format: date-time type: $ref: '#/components/schemas/CollectionFileUploadInstructionType' collection_id: type: string format: uuid created_by: type: string description: type: string order: type: integer helper_text: type: string description: Additional guidance text displayed below the question placeholder_text_input: type: string description: Placeholder text displayed in the input field required: - id - created_at - type - collection_id - created_by - description - order CollectionInstruction: oneOf: - $ref: '#/components/schemas/CollectionMultipleChoiceInstruction' - $ref: '#/components/schemas/CollectionFreeTextInstruction' - $ref: '#/components/schemas/CollectionMultipleChoiceWithFreeTextInstruction' - $ref: '#/components/schemas/CollectionFileUploadInstruction' ImageContentBlockType: type: string enum: - value: image ImageContentBlockParentType: type: string enum: - value: collection - value: batch ImageContentBlockSchemaVersion: type: string enum: - value: '1' ImageContentBlock: type: object properties: id: type: string format: uuid created_at: type: string format: date-time type: $ref: '#/components/schemas/ImageContentBlockType' parent_id: type: string format: uuid description: ID of the parent collection item (page) parent_type: $ref: '#/components/schemas/ImageContentBlockParentType' created_by: type: string schema_version: $ref: '#/components/schemas/ImageContentBlockSchemaVersion' url: type: string format: uri description: HTTPS URL of the image alt_text: type: string description: Alt text for accessibility caption: type: string description: Optional caption displayed below the image required: - id - created_at - type - parent_id - parent_type - created_by - schema_version - url - alt_text RichTextContentBlockType: type: string enum: - value: rich_text RichTextContentBlockParentType: type: string enum: - value: collection - value: batch RichTextContentBlockSchemaVersion: type: string enum: - value: '1' RichTextContentBlock: type: object properties: id: type: string format: uuid created_at: type: string format: date-time type: $ref: '#/components/schemas/RichTextContentBlockType' parent_id: type: string format: uuid description: ID of the parent collection item (page) parent_type: $ref: '#/components/schemas/RichTextContentBlockParentType' created_by: type: string schema_version: $ref: '#/components/schemas/RichTextContentBlockSchemaVersion' content: type: string description: Markdown formatted content required: - id - created_at - type - parent_id - parent_type - created_by - schema_version - content ContentBlock: oneOf: - $ref: '#/components/schemas/ImageContentBlock' - $ref: '#/components/schemas/RichTextContentBlock' PageItem: oneOf: - $ref: '#/components/schemas/CollectionInstruction' - $ref: '#/components/schemas/ContentBlock' CollectionItem: type: object properties: id: type: string format: uuid created_at: type: string format: date-time created_by: type: string schema_version: $ref: '#/components/schemas/CollectionItemSchemaVersion' page_items: type: array items: $ref: '#/components/schemas/PageItem' description: Instructions and content blocks on this page required: - id - created_at - created_by - schema_version - page_items Collection: type: object properties: id: type: string format: uuid schema_version: $ref: '#/components/schemas/CollectionSchemaVersion' created_at: type: string format: date-time description: ISO-8601 formatted creation timestamp in UTC created_by: type: string description: User ID of the Prolific user that created the collection workspace_id: type: string description: The ID of the Prolific workspace name: type: string description: The name of the collection task_details: $ref: '#/components/schemas/TaskDetails' collection_items: type: array items: $ref: '#/components/schemas/CollectionItem' description: Pages within the collection. Each collection item represents a page. last_modified_at: type: string format: date-time description: ISO-8601 formatted last modification timestamp in UTC last_modified_by: type: string description: User ID of the Prolific user that last modified the collection required: - id - schema_version - created_at - created_by - workspace_id - name - task_details - collection_items ``` ## SDK Code Examples ```python import requests url = "https://api.prolific.com/api/v1/data-collection/collections" payload = { "name": "Skin Type Assessment", "workspace_id": "6278acb09062db3b35bcbeb0", "task_details": { "task_name": "Assess Your Skin Type", "task_introduction": "

Please answer the following questions about your skin.

", "task_steps": "
  1. Read each question carefully
  2. Select the most accurate answer
" }, "collection_items": [{ "page_items": [ { "type": "rich_text", "content": "## Section 1: Basic Information" }, { "type": "multiple_choice", "content": "What is your skin type? Select the option that best describes your skin condition throughout the day." } ] }, { "page_items": [ { "type": "multiple_choice", "content": "What is your skin type?" } ] }, { "page_items": [ { "type": "multiple_choice", "content": "What is your skin type?" } ] }] } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.prolific.com/api/v1/data-collection/collections'; const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"name":"Skin Type Assessment","workspace_id":"6278acb09062db3b35bcbeb0","task_details":{"task_name":"Assess Your Skin Type","task_introduction":"

Please answer the following questions about your skin.

","task_steps":"
  1. Read each question carefully
  2. Select the most accurate answer
"},"collection_items":[{"page_items":[{"type":"rich_text","content":"## Section 1: Basic Information"},{"type":"multiple_choice","content":"What is your skin type? Select the option that best describes your skin condition throughout the day."}]},{"page_items":[{"type":"multiple_choice","content":"What is your skin type?"}]},{"page_items":[{"type":"multiple_choice","content":"What is your skin type?"}]}]}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.prolific.com/api/v1/data-collection/collections" payload := strings.NewReader("{\n \"name\": \"Skin Type Assessment\",\n \"workspace_id\": \"6278acb09062db3b35bcbeb0\",\n \"task_details\": {\n \"task_name\": \"Assess Your Skin Type\",\n \"task_introduction\": \"

Please answer the following questions about your skin.

\",\n \"task_steps\": \"
  1. Read each question carefully
  2. Select the most accurate answer
\"\n },\n \"collection_items\": [\n {\n \"page_items\": [\n {\n \"type\": \"rich_text\",\n \"content\": \"## Section 1: Basic Information\"\n },\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type? Select the option that best describes your skin condition throughout the day.\"\n }\n ]\n },\n {\n \"page_items\": [\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type?\"\n }\n ]\n },\n {\n \"page_items\": [\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type?\"\n }\n ]\n }\n ]\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "") 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 require 'uri' require 'net/http' url = URI("https://api.prolific.com/api/v1/data-collection/collections") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"Skin Type Assessment\",\n \"workspace_id\": \"6278acb09062db3b35bcbeb0\",\n \"task_details\": {\n \"task_name\": \"Assess Your Skin Type\",\n \"task_introduction\": \"

Please answer the following questions about your skin.

\",\n \"task_steps\": \"
  1. Read each question carefully
  2. Select the most accurate answer
\"\n },\n \"collection_items\": [\n {\n \"page_items\": [\n {\n \"type\": \"rich_text\",\n \"content\": \"## Section 1: Basic Information\"\n },\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type? Select the option that best describes your skin condition throughout the day.\"\n }\n ]\n },\n {\n \"page_items\": [\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type?\"\n }\n ]\n },\n {\n \"page_items\": [\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type?\"\n }\n ]\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.post("https://api.prolific.com/api/v1/data-collection/collections") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"name\": \"Skin Type Assessment\",\n \"workspace_id\": \"6278acb09062db3b35bcbeb0\",\n \"task_details\": {\n \"task_name\": \"Assess Your Skin Type\",\n \"task_introduction\": \"

Please answer the following questions about your skin.

\",\n \"task_steps\": \"
  1. Read each question carefully
  2. Select the most accurate answer
\"\n },\n \"collection_items\": [\n {\n \"page_items\": [\n {\n \"type\": \"rich_text\",\n \"content\": \"## Section 1: Basic Information\"\n },\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type? Select the option that best describes your skin condition throughout the day.\"\n }\n ]\n },\n {\n \"page_items\": [\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type?\"\n }\n ]\n },\n {\n \"page_items\": [\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type?\"\n }\n ]\n }\n ]\n}") .asString(); ``` ```php request('POST', 'https://api.prolific.com/api/v1/data-collection/collections', [ 'body' => '{ "name": "Skin Type Assessment", "workspace_id": "6278acb09062db3b35bcbeb0", "task_details": { "task_name": "Assess Your Skin Type", "task_introduction": "

Please answer the following questions about your skin.

", "task_steps": "
  1. Read each question carefully
  2. Select the most accurate answer
" }, "collection_items": [ { "page_items": [ { "type": "rich_text", "content": "## Section 1: Basic Information" }, { "type": "multiple_choice", "content": "What is your skin type? Select the option that best describes your skin condition throughout the day." } ] }, { "page_items": [ { "type": "multiple_choice", "content": "What is your skin type?" } ] }, { "page_items": [ { "type": "multiple_choice", "content": "What is your skin type?" } ] } ] }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/data-collection/collections"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"Skin Type Assessment\",\n \"workspace_id\": \"6278acb09062db3b35bcbeb0\",\n \"task_details\": {\n \"task_name\": \"Assess Your Skin Type\",\n \"task_introduction\": \"

Please answer the following questions about your skin.

\",\n \"task_steps\": \"
  1. Read each question carefully
  2. Select the most accurate answer
\"\n },\n \"collection_items\": [\n {\n \"page_items\": [\n {\n \"type\": \"rich_text\",\n \"content\": \"## Section 1: Basic Information\"\n },\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type? Select the option that best describes your skin condition throughout the day.\"\n }\n ]\n },\n {\n \"page_items\": [\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type?\"\n }\n ]\n },\n {\n \"page_items\": [\n {\n \"type\": \"multiple_choice\",\n \"content\": \"What is your skin type?\"\n }\n ]\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = [ "name": "Skin Type Assessment", "workspace_id": "6278acb09062db3b35bcbeb0", "task_details": [ "task_name": "Assess Your Skin Type", "task_introduction": "

Please answer the following questions about your skin.

", "task_steps": "
  1. Read each question carefully
  2. Select the most accurate answer
" ], "collection_items": [["page_items": [ [ "type": "rich_text", "content": "## Section 1: Basic Information" ], [ "type": "multiple_choice", "content": "What is your skin type? Select the option that best describes your skin condition throughout the day." ] ]], ["page_items": [ [ "type": "multiple_choice", "content": "What is your skin type?" ] ]], ["page_items": [ [ "type": "multiple_choice", "content": "What is your skin type?" ] ]]] ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/data-collection/collections")! 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() ```