Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Our full core API and associated documentation is available as a Postman collection - please see our Core API page for details. In this section we spotlight some common API functionality, including step-by-step tutorials.
This section walks through the steps required to pass data from your own system into a Patchworks process flow, via the Patchworks API.
To complete these steps it's assumed that you have:
and have a username and password to access your Patchworks dashboard
that you want to update via the Patchworks API
The required steps are detailed in the following stages:
Postman
5
Postman
1
Your preferred text editor
2
Patchworks dashboard (process flows)
3
Patchworks dashboard (process flows)
4
If your process flow is sending source data into a target connection, you should map this data using the map shape. This is done in the usual way with two points to note:
In a typical situation, the is used to map data from a source connection to a target connection. However in this scenario, we don't have a source connection - Patchworks doesn't know what data you are sending in or what system it's coming from.
As such, you won't select any source details when configuring the map shape - just leave these field blank:
Because Patchworks has no way of knowing the structure of your incoming data, mapping rules must be added manually.
For further guidance please see our page.

When you send a Patchworks API request to initialise a process flow, you must provide the internal IDs for the required process flow and version. This guide walks through the steps required to obtain this information.
Step 1 Log in to the Patchworks dashboard.
Step 2 Select process flows from the left-hand navigation menu and select the process flow that you want to update.
Step 3
Check the title bar in the top-left corner and make a note of the number above the title - this is the process flow ID:
Step 4 Click the settings icon:
...to access process flow settings:
Step 5
Look in the versions panel and find the version of this process flow that you want to initialise, then note the associated ID - this is the process flow version ID:
Step 6 You'll use this information in any API requests made to initialise this process flow.
The Patchworks inbound API supports data within strings. This data must be passed within a payload key.
The required data format is a JSON object with a payload key containing a string of data. For example:
Here, note that the payload key is in a JSON object, and is being used to hold different types of data as strings - text, XML and JSON.




{
"payload": "some data" | "<some-xml></>" | "{\"a-stringified-json-payload\": true}"
}If you're passing in a payload via the request body, it must be stringified within a JSON object. For example:
{
"payload": "{\"a-stringified-json-payload\"}"
}https://svc-fabric.pwks.co/api/v1/login{
"email": "[email protected]",
"password": "mypassword123*"
}https://start.wearepatchworks.com/api/v1/flows/<flowID>/start/<flowVERSION>

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.
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.
Step 1 Create a POST request for the following endpoint:
...replacing <flowID> and <flowVERSION> with details for your required process flow noted .
Step 2
In the request headers, pass in the token obtained - this should be prefixed with the word Bearer - for example:
Step 3
In the request body, pass in the required payload - for example:
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 .
Step 4
Send the request - if successful, a 200 'flow initialised' response is given, together with a flow run id:
Patchworks API requests must be authenticated with a bearer token. To obtain a token, you need to send a login request which includes credentials that you use to access the Patchworks dashboard.
Step 1 Create a POST request for the following endpoint:
Step 2 In the request body, add the email and password that you use to log into the Patchworks dashboard. You should add this as JSON - for example:
Step 3 Send the request - if successful, a token is returned. For example:
Step 4 Save this token ready for use in your .
https://start.wearepatchworks.com/api/v1/flows/<flowID>/manual/<flowVERSION>{
"payload": "[{\"id\":1000000001,\"first_name\":\"Jane\",\"last_name\":\"Smith\"},{\"id\":1000000002,\"first_name\":\"George\",\"last_name\":\"Jones\"}]"
}https://svc-fabric.pwks.co/api/v1/login{
"email": "[email protected]",
"password": "mypassword123*"
}






The Patchworks API can be used to add and manage cross-reference lookups. Using the API you can work with:
All API requests must be authenticated with a Patchworks bearer token. To obtain a token, send a POST request to the following endpoint:
In the request body, add the email and password that you use to log into the Patchworks dashboard. You should add this as JSON - for example:
A successful response returns a token. Tokens are valid for 24 hours.
The Patchworks cross-reference lookup API accepts two identifiers as parameters:
Having selected a cross-reference lookup to view/edit, the unique id can be found at the end of the URL - for example:
Having selected a cross-reference lookup to view/edit, each existing lookup row is displayed with a unique valueId in the id column:
name (required) (string)
description (required) (string)
default_value (optional) (string)
Example:
Sample request
Sample response (200 OK)
name (optional) (string)
description (optional) (string)
default_value (optional) (string)
At least one parameter must be passed into the request.
Example:
Sample request
Sample response (200 OK)
Sample response (200 OK)
Sample response (200 OK)
left_value (required) (string)
right_value (required) (string)
Example:
Sample request
Sample response (200 OK)
left_value (optional) (string)
right_value (optional) (string)
At least one parameter must be passed into the request.
Example:
Sample request
Sample response (200 OK)
{{id}}
The unique identifier associated with the cross-reference lookup.
{{valueID}}
The unique identifier associated with the cross-reference lookup row (also known as a mapping row).












https://svc-fabric.pwks.co/api/v1/login{
"email": "[email protected]",
"password": "mypassword123*"
}GET https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookupscurl -X GET "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups" \
-H "Authorization: Bearer e1234&FSKFJmytoken"GET https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/{{id}}curl -X GET "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/2" \
-H "Authorization: Bearer e1234&FSKFJmytoken"POST https://https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookupsPATCH https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/{{id}}DELETE https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/{{id}}curl -X DELETE "https://
GET https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/{{id}}/cross-reference-lookup-valuesGET https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/{{id}}/cross-reference-lookup-values/{{valueID}}POST https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/{{id}}/cross-reference-lookup-valuesPATCH https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/{{id}}/cross-reference-lookup-values/{{valueId}}DELETE https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/{{id}}/cross-reference-lookup-values/{{valueId}}curl -X DELETE "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/7/cross-reference-lookup-values/568" \
-H "Authorization: Bearer e1234&FSKFJmytoken"{
"data": [
{
"id": 2,
"cross_reference_lookup_template_id": 10,
"name": "American state name to ANSI Alpha 2",
"description": "Mapping of state names and their respective ANSI alpha-2 codes",
"default_value": null
},
{
"id": 4,
"cross_reference_lookup_template_id": 13,
"name": "Area measurement to abbreviation",
"description": "Mapping of area measurements and their abbreviations",
"default_value": null
},
{
"id": 6,
"cross_reference_lookup_template_id": 4,
"name": "Country name to Primary currency name",
"description": "Mapping of country names and their primary currency names",
"default_value": null
},
{
"id": 5,
"cross_reference_lookup_template_id": 16,
"name": "Currency name to ISO 4217",
"description": "Mapping of currency names and their respective ISO 4217 codes",
"default_value": null
},
{
"id": 7,
"cross_reference_lookup_template_id": 11,
"name": "Month name to abbreviation",
"description": "Mapping of month names and their abbreviations",
"default_value": null
}
],
"links": {
"first": "http://core.wearepatchworks.com/api/v1/cross-reference-lookups?page=1",
"last": "http://core.wearepatchworks.com/api/v1/cross-reference-lookups?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://core.wearepatchworks.com/api/v1/cross-reference-lookups?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://core.wearepatchworks.com/api/v1/cross-reference-lookups",
"per_page": 50,
"to": 5,
"total": 5
}
}{
"data": {
"id": 2,
"cross_reference_lookup_template_id": 10,
"name": "American state name to ANSI Alpha 2",
"description": "Mapping of state names and their respective ANSI alpha-2 codes",
"default_value": null
}
}{
"name": "New lookup name",
"description": "New lookup description",
"default_value": "New lookup default value"
}curl -X POST "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups" \
-H "Authorization: Bearer e1234&FSKFJmytoken" \
-H "Content-Type: application/json" \
-d '{
"name": "Colour HEX Values",
"description": "Convert long-form colours to HEX codes",
"default_value": "FFFFFF"
}'{
"data": {
"id": 9,
"cross_reference_lookup_template_id": null,
"name": "Colour HEX Values",
"description": "Convert long-form colours to HEX codes",
"default_value": "FFFFFF"
}
}{
"name": "New lookup name",
"description": "New lookup description"
"default_value": "New lookup default value"
}curl -X PATCH "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/8" \
-H "Authorization: Bearer e1234&FSKFJmytoken" \
-H "Content-Type: application/json" \
-d '{
"name": "Colour HEX Codes",
"description": "Convert long-form colours to HEX codes",
"default_value": "000000"
}'{
"data": {
"id": 9,
"cross_reference_lookup_template_id": null,
"name": "Colour HEX Codes",
"description": "Convert long-form colours to HEX codes",
"default_value": "000000"
}
}{
"message": "Cross reference lookup deleted successfully."
}curl -X GET "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/7/cross-reference-lookup-values" \
-H "Authorization: Bearer e1234&FSKFJmytoken"{
"data": [
{
"id": 556,
"left_value": "April",
"right_value": "Apr"
},
{
"id": 557,
"left_value": "August",
"right_value": "Aug"
},
{
"id": 558,
"left_value": "December",
"right_value": "Dec"
},
{
"id": 559,
"left_value": "February",
"right_value": "Feb"
},
{
"id": 560,
"left_value": "January",
"right_value": "Jan"
},
{
"id": 561,
"left_value": "July",
"right_value": "July"
},
{
"id": 562,
"left_value": "June",
"right_value": "June"
},
{
"id": 563,
"left_value": "March",
"right_value": "Mar"
},
{
"id": 564,
"left_value": "May",
"right_value": "May"
},
{
"id": 565,
"left_value": "November",
"right_value": "Nov"
},
{
"id": 566,
"left_value": "October",
"right_value": "Oct"
},
{
"id": 567,
"left_value": "September",
"right_value": "Sept"
}
],
"links": {
"first": "http://core.wearepatchworks.com/api/v1/cross-reference-lookups/7/cross-reference-lookup-values?page=1",
"last": "http://core.wearepatchworks.com/api/v1/cross-reference-lookups/7/cross-reference-lookup-values?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://core.wearepatchworks.com/api/v1/cross-reference-lookups/7/cross-reference-lookup-values?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://core.wearepatchworks.com/api/v1/cross-reference-lookups/7/cross-reference-lookup-values",
"per_page": 50,
"to": 12,
"total": 12
}
}curl -X GET "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/7/cross-reference-lookup-values/557
-H "Authorization: Bearer e1234&FSKFJmytoken"{
"data": {
"id": 557,
"left_value": "August",
"right_value": "Aug"
}
}{
"left_value": "Your required value",
"right_value": "Your required value"
}curl -X POST "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/7/cross-reference-lookup-values" \
-H "Authorization: Bearer e1234&FSKFJmytoken" \
-H "Content-Type: application/json" \
-d '{
"left_value": "Test",
"right_value": "TST"
}'{
"data": {
"id": 568,
"left_value": "Test",
"right_value": "TST"
}
}{
"left_value": "Your required value",
"right_value": "Your required value"
}curl -X PATCH "https://app.wearepatchworks.com/core-main/api/v1/cross-reference-lookups/7/cross-reference-lookup-values/568" \
-H "Authorization: Bearer e1234&FSKFJmytoken" \
-H "Content-Type: application/json" \
-d '{
"left_value": "NEWTest",
"right_value": "NEWTST"
}'{
"data": {
"id": 568,
"left_value": "NEWTest",
"right_value": "NEWTST"
}
}{
"message": "Cross reference lookup value deleted successfully."
}