# Create a test participant for a researcher POST https://api.prolific.com/api/v1/researchers/participants/ Content-Type: application/json ### Overview Creates a test participant with the same details as the researcher and the supplied email. This participant will bypass any fraud checks and on-boarding steps. ### Enabling the feature This endpoint is only enabled for select workspaces and will need enabling before the endpoint can be used. ### Participant Limitations - The participant will be limited to take studies only in the workspaces associated to the researcher and where the feature is enabled. - The participant will not be able to cashout any balance earned from completing studies. ### Usage - The API response contains the participant ID. This can be used in a custom allowlist or participant group to target the participant on studies. This enables the researcher to test the study set up end-to-end. - A randomly generated password is assigned to the participant account. We recommend that you request to reset the password, and use this new password to login to the participant account. Reference: https://beta-docs.prolific.com/api-reference/users/create-test-participant-for-researcher ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Create a test participant for a researcher version: endpoint_users.CreateTestParticipantForResearcher paths: /api/v1/researchers/participants/: post: operationId: create-test-participant-for-researcher summary: Create a test participant for a researcher description: > ### Overview Creates a test participant with the same details as the researcher and the supplied email. This participant will bypass any fraud checks and on-boarding steps. ### Enabling the feature This endpoint is only enabled for select workspaces and will need enabling before the endpoint can be used. ### Participant Limitations - The participant will be limited to take studies only in the workspaces associated to the researcher and where the feature is enabled. - The participant will not be able to cashout any balance earned from completing studies. ### Usage - The API response contains the participant ID. This can be used in a custom allowlist or participant group to target the participant on studies. This enables the researcher to test the study set up end-to-end. - A randomly generated password is assigned to the participant account. We recommend that you request to reset the password, and use this new password to login to the participant account. tags: - - subpackage_users 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/CreateTestParticipantForResearcherResponse '400': description: Error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/CreateTestParticipantForResearcher' components: schemas: CreateTestParticipantForResearcher: type: object properties: email: type: string format: email description: > - The email of the test participant. - This cannot be an email that has been registered with Prolific already. required: - email CreateTestParticipantForResearcherResponse: type: object properties: participant_id: type: string format: objectId description: The ID of the test participant ``` ## SDK Code Examples ```python import requests url = "https://api.prolific.com/api/v1/researchers/participants/" payload = { "email": "test.participant@researchlab.com" } 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/researchers/participants/'; const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"email":"test.participant@researchlab.com"}' }; 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/researchers/participants/" payload := strings.NewReader("{\n \"email\": \"test.participant@researchlab.com\"\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/researchers/participants/") 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 \"email\": \"test.participant@researchlab.com\"\n}" response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.post("https://api.prolific.com/api/v1/researchers/participants/") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"email\": \"test.participant@researchlab.com\"\n}") .asString(); ``` ```php request('POST', 'https://api.prolific.com/api/v1/researchers/participants/', [ 'body' => '{ "email": "test.participant@researchlab.com" }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/researchers/participants/"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"email\": \"test.participant@researchlab.com\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = ["email": "test.participant@researchlab.com"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/researchers/participants/")! 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() ```