# Approve or reject a submission POST https://api.prolific.com/api/v1/submissions/{id}/transition/ Content-Type: application/json Transition a submission to `APPROVED`, `REJECTED`, `PARTIALLY APPROVED`, `AWAITING REVIEW` or `SCREENED OUT`. Once the status is changed, it can not be restored to its previous value. You can only transition a submission to PARTIALLY APPROVED or SCREENED OUT by: - setting up the study with the appropriate completion codes (only some workspaces have access to these features) - providing the correct completion code in the request body - providing the necessary data in the request body (to PARTIALLY APPROVE a submission) Note this endpoint is idempotent, so if you make the same request twice, the second request will be ignored. Reference: https://beta-docs.prolific.com/api-reference/submissions/transition-submission ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Approve or reject a submission version: endpoint_submissions.TransitionSubmission paths: /api/v1/submissions/{id}/transition/: post: operationId: transition-submission summary: Approve or reject a submission description: >- Transition a submission to `APPROVED`, `REJECTED`, `PARTIALLY APPROVED`, `AWAITING REVIEW` or `SCREENED OUT`. Once the status is changed, it can not be restored to its previous value. You can only transition a submission to PARTIALLY APPROVED or SCREENED OUT by: - setting up the study with the appropriate completion codes (only some workspaces have access to these features) - providing the correct completion code in the request body - providing the necessary data in the request body (to PARTIALLY APPROVE a submission) Note this endpoint is idempotent, so if you make the same request twice, the second request will be ignored. tags: - - subpackage_submissions parameters: - name: id in: path description: |- Submission id. This is the ID we pass to the survey platform using %SESSION_ID% required: true schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Submission' '400': description: Error content: {} requestBody: content: application/json: schema: $ref: '#/components/schemas/SubmissionTransition' components: schemas: SubmissionTransitionAction: type: string enum: - value: APPROVE - value: COMPLETE - value: REJECT - value: RETURN - value: START - value: SCREEN_OUT - value: UNREJECT - value: UNRETURN SubmissionTransitionRejectionCategory: type: string enum: - value: TOO_QUICKLY - value: TOO_SLOWLY - value: FAILED_INSTRUCTIONS - value: INCOMP_LONGITUDINAL - value: FAILED_CHECK - value: LOW_EFFORT - value: MALINGERING - value: NO_CODE - value: BAD_CODE - value: NO_DATA - value: UNSUPP_DEVICE - value: OTHER SubmissionTransitionCompletionCodeData: type: object properties: percentage_of_reward: type: number format: double description: >- Required if the code is for a DYNAMIC_PAYMENT action. Must be between 8 - 99 (inclusive). message_to_participant: type: string description: >- Optional message to the participant to be sent alongside a dynamic payment. SubmissionTransition: type: object properties: action: $ref: '#/components/schemas/SubmissionTransitionAction' description: The action that should be performed on the submission. message: type: string description: |- Required if action is 'REJECT'. Message sent to the participant explaining the reason for the rejection. It must be at least 100 chars long. rejection_category: $ref: '#/components/schemas/SubmissionTransitionRejectionCategory' description: |- Required if action is 'REJECT', it sums as the category of the rejection. completion_code: type: string description: >- Required if the action is 'COMPLETE'. The completion code must match a value provided when creating the study, and the actor must have been set to `researcher`. Any actions that were provided during the set up of the completion code (e.g. automatically approve) will then be carried out. completion_code_data: $ref: '#/components/schemas/SubmissionTransitionCompletionCodeData' description: >- Required if the action is 'COMPLETE' and the code has the action "DYNAMIC_PAYMENT" associated with it. required: - action SubmissionStatus: type: string enum: - value: ACTIVE - value: APPROVED - value: AWAITING REVIEW - value: REJECTED - value: RESERVED - value: RETURNED - value: TIMED-OUT - value: SCREENED OUT - value: UNKNOWN Submission: type: object properties: id: type: string description: The id of the submission completed_at: type: - string - 'null' description: The time the submission was completed at. entered_code: type: - string - 'null' description: The completion code used by the participant to complete the study. participant: type: string description: Participant id. started_at: type: string description: The date and time that the user started the submission (UTC) status: $ref: '#/components/schemas/SubmissionStatus' description: The current status of the submission study_id: type: string description: Study id. required: - id - started_at - status - study_id ``` ## SDK Code Examples ```python Completing a submission on behalf of a participant with a code import requests url = "https://api.prolific.com/api/v1/submissions/id/transition/" payload = { "action": "COMPLETE", "completion_code": "CODE1290" } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Completing a submission on behalf of a participant with a code const url = 'https://api.prolific.com/api/v1/submissions/id/transition/'; const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"action":"COMPLETE","completion_code":"CODE1290"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Completing a submission on behalf of a participant with a code package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.prolific.com/api/v1/submissions/id/transition/" payload := strings.NewReader("{\n \"action\": \"COMPLETE\",\n \"completion_code\": \"CODE1290\"\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 Completing a submission on behalf of a participant with a code require 'uri' require 'net/http' url = URI("https://api.prolific.com/api/v1/submissions/id/transition/") 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 \"action\": \"COMPLETE\",\n \"completion_code\": \"CODE1290\"\n}" response = http.request(request) puts response.read_body ``` ```java Completing a submission on behalf of a participant with a code HttpResponse response = Unirest.post("https://api.prolific.com/api/v1/submissions/id/transition/") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"action\": \"COMPLETE\",\n \"completion_code\": \"CODE1290\"\n}") .asString(); ``` ```php Completing a submission on behalf of a participant with a code request('POST', 'https://api.prolific.com/api/v1/submissions/id/transition/', [ 'body' => '{ "action": "COMPLETE", "completion_code": "CODE1290" }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Completing a submission on behalf of a participant with a code var client = new RestClient("https://api.prolific.com/api/v1/submissions/id/transition/"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"action\": \"COMPLETE\",\n \"completion_code\": \"CODE1290\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Completing a submission on behalf of a participant with a code import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = [ "action": "COMPLETE", "completion_code": "CODE1290" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/submissions/id/transition/")! 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() ``` ```python Screening out a submission import requests url = "https://api.prolific.com/api/v1/submissions/id/transition/" payload = { "action": "SCREEN_OUT" } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Screening out a submission const url = 'https://api.prolific.com/api/v1/submissions/id/transition/'; const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"action":"SCREEN_OUT"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Screening out a submission package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.prolific.com/api/v1/submissions/id/transition/" payload := strings.NewReader("{\n \"action\": \"SCREEN_OUT\"\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 Screening out a submission require 'uri' require 'net/http' url = URI("https://api.prolific.com/api/v1/submissions/id/transition/") 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 \"action\": \"SCREEN_OUT\"\n}" response = http.request(request) puts response.read_body ``` ```java Screening out a submission HttpResponse response = Unirest.post("https://api.prolific.com/api/v1/submissions/id/transition/") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"action\": \"SCREEN_OUT\"\n}") .asString(); ``` ```php Screening out a submission request('POST', 'https://api.prolific.com/api/v1/submissions/id/transition/', [ 'body' => '{ "action": "SCREEN_OUT" }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Screening out a submission var client = new RestClient("https://api.prolific.com/api/v1/submissions/id/transition/"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"action\": \"SCREEN_OUT\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Screening out a submission import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = ["action": "SCREEN_OUT"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/submissions/id/transition/")! 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() ``` ```python Approving a submission import requests url = "https://api.prolific.com/api/v1/submissions/id/transition/" payload = { "action": "APPROVE" } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.post(url, json=payload, headers=headers) print(response.json()) ``` ```javascript Approving a submission const url = 'https://api.prolific.com/api/v1/submissions/id/transition/'; const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"action":"APPROVE"}' }; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Approving a submission package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.prolific.com/api/v1/submissions/id/transition/" payload := strings.NewReader("{\n \"action\": \"APPROVE\"\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 Approving a submission require 'uri' require 'net/http' url = URI("https://api.prolific.com/api/v1/submissions/id/transition/") 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 \"action\": \"APPROVE\"\n}" response = http.request(request) puts response.read_body ``` ```java Approving a submission HttpResponse response = Unirest.post("https://api.prolific.com/api/v1/submissions/id/transition/") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"action\": \"APPROVE\"\n}") .asString(); ``` ```php Approving a submission request('POST', 'https://api.prolific.com/api/v1/submissions/id/transition/', [ 'body' => '{ "action": "APPROVE" }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp Approving a submission var client = new RestClient("https://api.prolific.com/api/v1/submissions/id/transition/"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"action\": \"APPROVE\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift Approving a submission import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = ["action": "APPROVE"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/submissions/id/transition/")! 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() ``` ```python import requests url = "https://api.prolific.com/api/v1/submissions/id/transition/" payload = { "action": "REJECT", "message": "More than 100 chars long message to amuse the participant with my knowledge of the english language in this funny example", "rejection_category": "FAILED_INSTRUCTIONS" } 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/submissions/id/transition/'; const options = { method: 'POST', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"action":"REJECT","message":"More than 100 chars long message to amuse the participant with my knowledge of the english language in this funny example","rejection_category":"FAILED_INSTRUCTIONS"}' }; 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/submissions/id/transition/" payload := strings.NewReader("{\n \"action\": \"REJECT\",\n \"message\": \"More than 100 chars long message to amuse the participant with my knowledge of the english language in this funny example\",\n \"rejection_category\": \"FAILED_INSTRUCTIONS\"\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/submissions/id/transition/") 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 \"action\": \"REJECT\",\n \"message\": \"More than 100 chars long message to amuse the participant with my knowledge of the english language in this funny example\",\n \"rejection_category\": \"FAILED_INSTRUCTIONS\"\n}" response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.post("https://api.prolific.com/api/v1/submissions/id/transition/") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"action\": \"REJECT\",\n \"message\": \"More than 100 chars long message to amuse the participant with my knowledge of the english language in this funny example\",\n \"rejection_category\": \"FAILED_INSTRUCTIONS\"\n}") .asString(); ``` ```php request('POST', 'https://api.prolific.com/api/v1/submissions/id/transition/', [ 'body' => '{ "action": "REJECT", "message": "More than 100 chars long message to amuse the participant with my knowledge of the english language in this funny example", "rejection_category": "FAILED_INSTRUCTIONS" }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/submissions/id/transition/"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"action\": \"REJECT\",\n \"message\": \"More than 100 chars long message to amuse the participant with my knowledge of the english language in this funny example\",\n \"rejection_category\": \"FAILED_INSTRUCTIONS\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = [ "action": "REJECT", "message": "More than 100 chars long message to amuse the participant with my knowledge of the english language in this funny example", "rejection_category": "FAILED_INSTRUCTIONS" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/submissions/id/transition/")! 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() ```