To view this content in our official product documentation, click here.
Introduction
Having obtained a Patchworks token, it can be applied to an API request to initialise a process flow with your data passed in the request body.
{% hint style="warning" %} You must control when your API requests are sent - the process flow trigger shape schedule cannot currently be used. With this in mind, please ensure that the default trigger shape in your process flow is not configured with any schedules. {% endhint %}
The steps
Show me
Step 1\ Create a POST request for the following endpoint:
{% code lineNumbers="true" %}
https://start.wearepatchworks.com/api/v1/flows/<flowID>/manual/<flowVERSION>...replacing <flowID> and <flowVERSION> with details for your required process flow noted previously.
This endpoint is for the Patchworks **production** environment.
Step 2\ In the request headers, pass in the token obtained previously - this should be prefixed with the word Bearer - for example:

Step 3\ In the request body, pass in the required payload - for example:
{% code lineNumbers="true" %}
{
"payload": "[{\"id\":1000000001,\"first_name\":\"Jane\",\"last_name\":\"Smith\"},{\"id\":1000000002,\"first_name\":\"George\",\"last_name\":\"Jones\"}]"
}
{% hint style="warning" %} Remember that the payload must be provided as a JSON object with a payload key containing a string of data. For more information please see Preparing your data. {% endhint %}
Step 4\ Send the request - if successful, a 200 'flow initialised' response is given, together with a flow run id:

You can check the status of this flow run via the run logs.
Comments
0 comments
Please sign in to leave a comment.