Schedule a Playbook Run - Cognigy Documentation

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.


Schedule a Playbook Run

POST /v2.0/playbooks/{playbookId}/schedule

cURL Example

curl --request POST \
  --url https://api-trial.cognigy.ai/new/v2.0/playbooks/{playbookId}/schedule \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '@payload.json'

Payload Example

{
  "entrypoint": "61f25579055c2f43c249a181",
  "flowId": "010d1970-89b9-4012-892b-53c78ef6c117",
  "localeId": "8b3b45e2-48f9-446d-a4c5-35d8284a01b2"
}

Code Samples

Python

import requests

url = "https://api-trial.cognigy.ai/new/v2.0/playbooks/{playbookId}/schedule"

payload = {
    "entrypoint": "61f25579055c2f43c249a181",
    "flowId": "010d1970-89b9-4012-892b-53c78ef6c117",
    "localeId": "8b3b45e2-48f9-446d-a4c5-35d8284a01b2"
}
headers = {
    "X-API-Key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)

JavaScript (Fetch)

const options = {
  method: 'POST',
  headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    entrypoint: '61f25579055c2f43c249a181',
    flowId: '010d1970-89b9-4012-892b-53c78ef6c117',
    localeId: '8b3b45e2-48f9-446d-a4c5-35d8284a01b2'
  })
};

fetch('https://api-trial.cognigy.ai/new/v2.0/playbooks/{playbookId}/schedule', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));

Response Codes


Response Structure

{
  "_id": "<string>",
  "status": "queued",
  "type": "runPlaybook",
  "parameters": {},
  "createdAt": 123,
  "lastChangedAt": 123,
  "progress": 50,
  "job": {
    "name": "<string>",
    "namespace": "<string>",
    "timeoutInMs": 123
  }
}

Errors

400 Bad Request Example

{
  "type": "Bad Request",
  "title": "Bad Request Error",
  "status": 400,
  "detail": "Validation failed. Missing payload.",
  "instance": "/v2.0/flows/5ce7c2d833ea1e04d7e6c432",
  "code": 1000,
  "traceId": "api--f84324f4-98eb-4f02-abdd-375a2e6c3c1f",
  "details": {}
}

Authorizations


Headers


Path Parameters


Request Body