Each task in a journey requires specific data to be submitted before it can be completed. This could include identity information, uploaded documents, or other verification inputs.

This guide explains how to submit task data using the GBG GO API.

When to submit task data

You need to submit task data when:

  • A task requires user input (e.g., name, address, document)
  • You’ve retrieved the schema for the task
  • You want to mark a task as complete and move the journey forward

Prerequisites

Make sure you have:

Submit task data (API request)

Send a POST request to the /journey/task/update endpoint. Your request should be in the following format depending on the user data schema:

curl --request POST \
  --url https://eu.platform.go.gbgplc.com/captain/api/journey/task/update \
  --header 'Authorization: Bearer your_access_token' \
  --header 'Content-Type: application/json' \
  --data '{
    "intent": "COMPLETE",
    "instanceId": "your-instance-id",
    "taskId": "your-task-id",
    "data": {
      "firstName": "John",
      "lastName": "Doe"
    }
  }'

The "intent": "COMPLETE" value is required to mark the task as finished. Make sure the data object follows the correct structure based on the task schema (user data schema).

What happens after submitting

Once your task data is submitted:

  • If valid, then the task is marked as complete
  • If more tasks remain, then Retrieve tasks to see what’s next
  • If your data is incorrect or missing required fields, then the API returns a validation error

Handling validation errors

If the API returns a validation error:

  1. Review the error message and field names
  2. Compare your request against the schema
  3. Fix the incorrect or missing fields
  4. Retry the request

Best practices

  • Always validate your input locally against the schema before sending
  • If you’re dynamically generating forms, make sure to use the task schema structure
  • Only use "intent": "COMPLETE" when the task is ready to be finalized

Next step

Go to Fetch journey state to check whether the journey has completed or if more tasks remain.