cURL
curl -X POST \
-H 'Authorization: Bearer $API_KEY' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"name": "My Scripted Workflow", "team_id": "YOUR_TEAM_ID", "is_external": false, "canvas_type": 0, "public": false}' \
'$BASE_URL/workflows'import requests
headers = {
'x-api-key': '<YOUR_API_KEY>',
'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
data = {
'name': 'My Scripted Workflow',
'team_id': '41480ee5-14ff-4f9e-89bf-91b0a8e50e77',
'is_external': False,
'canvas_type': 0,
'public': False
}
resp = requests.post('https://accounts.playbook3d.com/workflows', json=data, headers=headers)
print(resp.status_code, resp.json())fetch('https://accounts.playbook3d.com/workflows', {
method: 'POST',
headers: {
'x-api-key': '<YOUR_API_KEY>',
'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
name: 'My Scripted Workflow',
team_id: '41480ee5-14ff-4f9e-89bf-91b0a8e50e77',
is_external: false,
canvas_type: 0,
public: false
})
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));// Using HttpClient
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "<YOUR_API_KEY>");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "<YOUR_JWT_TOKEN>");
var newWorkflow = new {
name = "My Scripted Workflow",
team_id = "41480ee5-14ff-4f9e-89bf-91b0a8e50e77",
is_external = false,
canvas_type = 0,
_public = false
};
var content = new StringContent(
JsonConvert.SerializeObject(newWorkflow), Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://accounts.playbook3d.com/workflows", content);
string respContent = await response.Content.ReadAsStringAsync();
Console.WriteLine(response.StatusCode);
Console.WriteLine(respContent);{
"id": "d0763222-8f38-46aa-a96e-2532038e49b8",
"name": "My Scripted Workflow"
}{
"id": "d0763222-8f38-46aa-a96e-2532038e49b8",
"name": "My Scripted Workflow"
}{
"description": "Bad Request. Possibly invalid JSON or missing fields."
}{
"description": "Unauthorized. The Bearer token or API key is invalid or missing."
}{
"description": "Forbidden. The user does not have the required permission."
}{
"description": "Not Found. Possibly the endpoint is spelled incorrectly or the specified team doesn't exist."
}{
"description": "Internal Server Error. Something went wrong on the server."
}Workflows
Post Workflows
Creates a new workflow associated with the specified team (and owned by the user sending the request).
POST
/
workflows
cURL
curl -X POST \
-H 'Authorization: Bearer $API_KEY' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"name": "My Scripted Workflow", "team_id": "YOUR_TEAM_ID", "is_external": false, "canvas_type": 0, "public": false}' \
'$BASE_URL/workflows'import requests
headers = {
'x-api-key': '<YOUR_API_KEY>',
'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
data = {
'name': 'My Scripted Workflow',
'team_id': '41480ee5-14ff-4f9e-89bf-91b0a8e50e77',
'is_external': False,
'canvas_type': 0,
'public': False
}
resp = requests.post('https://accounts.playbook3d.com/workflows', json=data, headers=headers)
print(resp.status_code, resp.json())fetch('https://accounts.playbook3d.com/workflows', {
method: 'POST',
headers: {
'x-api-key': '<YOUR_API_KEY>',
'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: JSON.stringify({
name: 'My Scripted Workflow',
team_id: '41480ee5-14ff-4f9e-89bf-91b0a8e50e77',
is_external: false,
canvas_type: 0,
public: false
})
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));// Using HttpClient
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "<YOUR_API_KEY>");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "<YOUR_JWT_TOKEN>");
var newWorkflow = new {
name = "My Scripted Workflow",
team_id = "41480ee5-14ff-4f9e-89bf-91b0a8e50e77",
is_external = false,
canvas_type = 0,
_public = false
};
var content = new StringContent(
JsonConvert.SerializeObject(newWorkflow), Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://accounts.playbook3d.com/workflows", content);
string respContent = await response.Content.ReadAsStringAsync();
Console.WriteLine(response.StatusCode);
Console.WriteLine(respContent);{
"id": "d0763222-8f38-46aa-a96e-2532038e49b8",
"name": "My Scripted Workflow"
}{
"id": "d0763222-8f38-46aa-a96e-2532038e49b8",
"name": "My Scripted Workflow"
}{
"description": "Bad Request. Possibly invalid JSON or missing fields."
}{
"description": "Unauthorized. The Bearer token or API key is invalid or missing."
}{
"description": "Forbidden. The user does not have the required permission."
}{
"description": "Not Found. Possibly the endpoint is spelled incorrectly or the specified team doesn't exist."
}{
"description": "Internal Server Error. Something went wrong on the server."
}Headers
Your API key. This is required by most endpoints to access the API programmatically. You can view your x-api-key using the 'Profile' tab on the website.
Bearer token for authentication (JWT).
Body
application/json
JSON data defining the workflow to be created.