/journey/task/schema) endpoint to retrieve the schema for any task assigned to a journey instance.
When to retrieve a task schema
You should fetch a task’s schema when:- Preparing to submit data for a task
- Dynamically generating input fields in your UI
- Confirming the required fields and their formats
- Validating data before submitting it
Prerequisites
Before sending the request, make sure you have:- Access token – Get this from the Authenticate step
- Task ID – Returned when you Retrieve tasks
- (Optional) Instance ID – Needed in some journey configurations
Retrieve task schema (API request)
Send aPOST request to the /journey/task/schema endpoint. Your request should be in this format:
cURL
instanceId in the request body as well:
JSON
JSON
How to use the schema
The schema defines:- The field names, for example, document.type
- The data types, for example, string, array, or object
- Which fields are required
- Any format restrictions, for example, base64 for file uploads
Best practices
- Always retrieve the latest schema before submitting data.
- If the schema changes, update your integration to match the new structure.
- Validate your input locally using the schema before calling the API.