Trigger a run of an ACTIVE workflow
curl --request POST \
--url https://api.pineyard.ai/workflows/{id}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"phone": "<string>",
"name": "<string>",
"fields": {},
"externalRef": "<string>",
"origin": "TRIGGER",
"shortenWaits": true
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '<string>',
name: '<string>',
fields: {},
externalRef: '<string>',
origin: 'TRIGGER',
shortenWaits: true
})
};
fetch('https://api.pineyard.ai/workflows/{id}/runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/workflows/{id}/runs"
payload = {
"phone": "<string>",
"name": "<string>",
"fields": {},
"externalRef": "<string>",
"origin": "TRIGGER",
"shortenWaits": True
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"status": "RUNNING",
"origin": "TRIGGER",
"currentNodeId": "<string>",
"startedAt": "<string>"
}{
"error": "invalid_body",
"issues": [
null
]
}{
"error": "not_found"
}{
"error": "workflow_not_active"
}{
"error": "workflow_invalid",
"details": [
"<string>"
]
}Workflows
Trigger a run of an ACTIVE workflow
POST
/
workflows
/
{id}
/
runs
Trigger a run of an ACTIVE workflow
curl --request POST \
--url https://api.pineyard.ai/workflows/{id}/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"phone": "<string>",
"name": "<string>",
"fields": {},
"externalRef": "<string>",
"origin": "TRIGGER",
"shortenWaits": true
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
phone: '<string>',
name: '<string>',
fields: {},
externalRef: '<string>',
origin: 'TRIGGER',
shortenWaits: true
})
};
fetch('https://api.pineyard.ai/workflows/{id}/runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/workflows/{id}/runs"
payload = {
"phone": "<string>",
"name": "<string>",
"fields": {},
"externalRef": "<string>",
"origin": "TRIGGER",
"shortenWaits": True
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"status": "RUNNING",
"origin": "TRIGGER",
"currentNodeId": "<string>",
"startedAt": "<string>"
}{
"error": "invalid_body",
"issues": [
null
]
}{
"error": "not_found"
}{
"error": "workflow_not_active"
}{
"error": "workflow_invalid",
"details": [
"<string>"
]
}Required scope:
workflows.run
Idempotency: an Idempotency-Key header is required when calling with an API key. See Idempotency.
Requires workflows enabled for your workspace. Otherwise the request is refused; see Errors.
Authorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Headers
Unique value (e.g. a UUID) per action, up to 200 printable ASCII characters. Reuse it only to retry the same request; the first response is replayed for 24 hours.
Maximum string length:
200Example:
"f1d2c3b4-0000-4000-8000-000000000000"
Path Parameters
Body
application/json

