curl --request PATCH \
--url https://api.parley.so/v1/automations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"triggers": {
"add": [
{
"type": "cron",
"cron": "<string>",
"timezone": "<string>"
}
],
"remove": [
"<string>"
]
},
"projectId": "<string>"
}
'import requests
url = "https://api.parley.so/v1/automations/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"triggers": {
"add": [
{
"type": "cron",
"cron": "<string>",
"timezone": "<string>"
}
],
"remove": ["<string>"]
},
"projectId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
instructions: '<string>',
triggers: {
add: [{type: 'cron', cron: '<string>', timezone: '<string>'}],
remove: ['<string>']
},
projectId: '<string>'
})
};
fetch('https://api.parley.so/v1/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.parley.so/v1/automations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'instructions' => '<string>',
'triggers' => [
'add' => [
[
'type' => 'cron',
'cron' => '<string>',
'timezone' => '<string>'
]
],
'remove' => [
'<string>'
]
],
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.parley.so/v1/automations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"triggers\": {\n \"add\": [\n {\n \"type\": \"cron\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n },\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.parley.so/v1/automations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"triggers\": {\n \"add\": [\n {\n \"type\": \"cron\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n },\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parley.so/v1/automations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"triggers\": {\n \"add\": [\n {\n \"type\": \"cron\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n },\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"status": "active",
"nextRunAt": "2023-11-07T05:31:56Z",
"project": {
"type": "project",
"id": "<string>",
"name": "<string>"
},
"lastRun": {
"id": "<string>",
"status": "pending",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"triggers": [
{
"id": "<string>",
"type": "cron",
"cron": "<string>",
"timezone": "<string>"
}
],
"instructions": "<string>"
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "The request is invalid.",
"details": {
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid credentials."
}
}{
"error": {
"code": "FORBIDDEN",
"message": "You don't have permission to do this."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Not found."
}
}{
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests."
}
}Update an automation
Rename an automation, replace its instructions, add or remove triggers, pause or resume it, or move it to another project. Omitted fields are left unchanged.
curl --request PATCH \
--url https://api.parley.so/v1/automations/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"triggers": {
"add": [
{
"type": "cron",
"cron": "<string>",
"timezone": "<string>"
}
],
"remove": [
"<string>"
]
},
"projectId": "<string>"
}
'import requests
url = "https://api.parley.so/v1/automations/{id}"
payload = {
"name": "<string>",
"description": "<string>",
"instructions": "<string>",
"triggers": {
"add": [
{
"type": "cron",
"cron": "<string>",
"timezone": "<string>"
}
],
"remove": ["<string>"]
},
"projectId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
instructions: '<string>',
triggers: {
add: [{type: 'cron', cron: '<string>', timezone: '<string>'}],
remove: ['<string>']
},
projectId: '<string>'
})
};
fetch('https://api.parley.so/v1/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.parley.so/v1/automations/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'instructions' => '<string>',
'triggers' => [
'add' => [
[
'type' => 'cron',
'cron' => '<string>',
'timezone' => '<string>'
]
],
'remove' => [
'<string>'
]
],
'projectId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.parley.so/v1/automations/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"triggers\": {\n \"add\": [\n {\n \"type\": \"cron\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n },\n \"projectId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.parley.so/v1/automations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"triggers\": {\n \"add\": [\n {\n \"type\": \"cron\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n },\n \"projectId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.parley.so/v1/automations/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"instructions\": \"<string>\",\n \"triggers\": {\n \"add\": [\n {\n \"type\": \"cron\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\"\n }\n ],\n \"remove\": [\n \"<string>\"\n ]\n },\n \"projectId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"status": "active",
"nextRunAt": "2023-11-07T05:31:56Z",
"project": {
"type": "project",
"id": "<string>",
"name": "<string>"
},
"lastRun": {
"id": "<string>",
"status": "pending",
"startedAt": "2023-11-07T05:31:56Z",
"endedAt": "2023-11-07T05:31:56Z"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"triggers": [
{
"id": "<string>",
"type": "cron",
"cron": "<string>",
"timezone": "<string>"
}
],
"instructions": "<string>"
}{
"error": {
"code": "VALIDATION_FAILED",
"message": "The request is invalid.",
"details": {
"issues": [
{
"path": "<string>",
"message": "<string>"
}
]
}
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid credentials."
}
}{
"error": {
"code": "FORBIDDEN",
"message": "You don't have permission to do this."
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Not found."
}
}{
"error": {
"code": "TOO_MANY_REQUESTS",
"message": "Too many requests."
}
}Authorizations
A Parley API key.
Path Parameters
The automation ID.
1Body
A new name.
1 - 120A new summary. Pass null to clear it.
2000New instructions that replace the current ones. They take effect on the next run and don't change a run in progress.
1 - 20000Triggers to add or remove. Triggers you don't mention are left unchanged. To change a trigger, remove it and add its replacement in the same call. An automation can have at most 10.
Show child attributes
Show child attributes
paused puts every trigger on hold and keeps the automation and its run history. active resumes them.
active, paused A project to run the automation in, which needs edit access to it. Pass null to run it across the organization.
1Response
OK
The automation ID.
1The automation name.
A short summary of what the automation does, or null.
active: the automation runs when its triggers fire. paused: its triggers are on hold, and the automation only runs when someone starts a run.
active, paused When a trigger next starts a run, or null for an automation that is paused or has no scheduled trigger.
The project the automation runs in, with that project's files, notes, and linked records as its context, or null for an automation that runs across the organization.
Show child attributes
Show child attributes
The most recent run, or null for an automation that has never run.
Show child attributes
Show child attributes
When the automation was created.
When the automation or its triggers were last changed.
What starts the automation on its own, oldest first. Empty for an automation that only runs when someone starts a run.
Something that starts a run. cron: a schedule. event: something that happens in Parley. More types will be added, so skip any type you do not recognize.
- Option 1
- Option 2
Show child attributes
Show child attributes
The automation's instructions: the prompt Parley's assistant carries out on every run.
Was this page helpful?
