curl --request PATCH \
--url https://api.social-api.ai/v1/automations/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"once_per_person": true,
"post_ids": [
"<string>"
],
"steps": [
{
"actions": [
{
"private_reply": {
"texts": [
"Here is the link: https://example.com"
]
},
"reply_comment": {
"texts": [
"Here is the link: https://example.com"
]
},
"send_dm": {
"texts": [
"Here is the link: https://example.com"
]
},
"type": "private_reply"
}
],
"buttons": [
{
"next_step": "check",
"title": "Open",
"type": "url",
"url": "https://example.com"
}
],
"fallthrough_step": "<string>",
"filters": [
{
"keyword": {
"keywords": [
"link",
"price"
],
"match": "contains"
},
"type": "keyword"
}
],
"key": "start"
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
once_per_person: true,
post_ids: ['<string>'],
steps: [
{
actions: [
{
private_reply: {texts: ['Here is the link: https://example.com']},
reply_comment: {texts: ['Here is the link: https://example.com']},
send_dm: {texts: ['Here is the link: https://example.com']},
type: 'private_reply'
}
],
buttons: [{next_step: 'check', title: 'Open', type: 'url', url: 'https://example.com'}],
fallthrough_step: '<string>',
filters: [{keyword: {keywords: ['link', 'price'], match: 'contains'}, type: 'keyword'}],
key: 'start'
}
]
})
};
fetch('https://api.social-api.ai/v1/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/automations/{id}"
payload = {
"name": "<string>",
"once_per_person": True,
"post_ids": ["<string>"],
"steps": [
{
"actions": [
{
"private_reply": { "texts": ["Here is the link: https://example.com"] },
"reply_comment": { "texts": ["Here is the link: https://example.com"] },
"send_dm": { "texts": ["Here is the link: https://example.com"] },
"type": "private_reply"
}
],
"buttons": [
{
"next_step": "check",
"title": "Open",
"type": "url",
"url": "https://example.com"
}
],
"fallthrough_step": "<string>",
"filters": [
{
"keyword": {
"keywords": ["link", "price"],
"match": "contains"
},
"type": "keyword"
}
],
"key": "start"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"created_at": "<string>",
"failed_count": 123,
"fired_count": 123,
"id": "aut_01J9Z8Y7X6W5V4T3S2R1Q0P9N8",
"name": "Send the link",
"once_per_person": true,
"post_ids": [
"<string>"
],
"sent_count": 123,
"status": "active",
"steps": [
{
"actions": [
{
"private_reply": {
"texts": [
"Here is the link: https://example.com"
]
},
"reply_comment": {
"texts": [
"Here is the link: https://example.com"
]
},
"send_dm": {
"texts": [
"Here is the link: https://example.com"
]
},
"type": "private_reply"
}
],
"buttons": [
{
"next_step": "check",
"title": "Open",
"type": "url",
"url": "https://example.com"
}
],
"fallthrough_step": "<string>",
"filters": [
{
"keyword": {
"keywords": [
"link",
"price"
],
"match": "contains"
},
"type": "keyword"
}
],
"key": "start"
}
],
"trigger": "comment",
"updated_at": "<string>"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Update an Automation
Updates the fields you send and keeps the rest. Set status to paused to stop the Automation and to active to resume it. steps replaces the whole list. Changed steps or post_ids must meet the same rules as creation. Renaming or pausing needs only automations:write; resuming, or changing steps, post_ids or once_per_person, also needs each action’s own scope.
curl --request PATCH \
--url https://api.social-api.ai/v1/automations/{id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"once_per_person": true,
"post_ids": [
"<string>"
],
"steps": [
{
"actions": [
{
"private_reply": {
"texts": [
"Here is the link: https://example.com"
]
},
"reply_comment": {
"texts": [
"Here is the link: https://example.com"
]
},
"send_dm": {
"texts": [
"Here is the link: https://example.com"
]
},
"type": "private_reply"
}
],
"buttons": [
{
"next_step": "check",
"title": "Open",
"type": "url",
"url": "https://example.com"
}
],
"fallthrough_step": "<string>",
"filters": [
{
"keyword": {
"keywords": [
"link",
"price"
],
"match": "contains"
},
"type": "keyword"
}
],
"key": "start"
}
]
}
'const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
once_per_person: true,
post_ids: ['<string>'],
steps: [
{
actions: [
{
private_reply: {texts: ['Here is the link: https://example.com']},
reply_comment: {texts: ['Here is the link: https://example.com']},
send_dm: {texts: ['Here is the link: https://example.com']},
type: 'private_reply'
}
],
buttons: [{next_step: 'check', title: 'Open', type: 'url', url: 'https://example.com'}],
fallthrough_step: '<string>',
filters: [{keyword: {keywords: ['link', 'price'], match: 'contains'}, type: 'keyword'}],
key: 'start'
}
]
})
};
fetch('https://api.social-api.ai/v1/automations/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.social-api.ai/v1/automations/{id}"
payload = {
"name": "<string>",
"once_per_person": True,
"post_ids": ["<string>"],
"steps": [
{
"actions": [
{
"private_reply": { "texts": ["Here is the link: https://example.com"] },
"reply_comment": { "texts": ["Here is the link: https://example.com"] },
"send_dm": { "texts": ["Here is the link: https://example.com"] },
"type": "private_reply"
}
],
"buttons": [
{
"next_step": "check",
"title": "Open",
"type": "url",
"url": "https://example.com"
}
],
"fallthrough_step": "<string>",
"filters": [
{
"keyword": {
"keywords": ["link", "price"],
"match": "contains"
},
"type": "keyword"
}
],
"key": "start"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
"created_at": "<string>",
"failed_count": 123,
"fired_count": 123,
"id": "aut_01J9Z8Y7X6W5V4T3S2R1Q0P9N8",
"name": "Send the link",
"once_per_person": true,
"post_ids": [
"<string>"
],
"sent_count": 123,
"status": "active",
"steps": [
{
"actions": [
{
"private_reply": {
"texts": [
"Here is the link: https://example.com"
]
},
"reply_comment": {
"texts": [
"Here is the link: https://example.com"
]
},
"send_dm": {
"texts": [
"Here is the link: https://example.com"
]
},
"type": "private_reply"
}
],
"buttons": [
{
"next_step": "check",
"title": "Open",
"type": "url",
"url": "https://example.com"
}
],
"fallthrough_step": "<string>",
"filters": [
{
"keyword": {
"keywords": [
"link",
"price"
],
"match": "contains"
},
"type": "keyword"
}
],
"key": "start"
}
],
"trigger": "comment",
"updated_at": "<string>"
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}{
"error": {
"code": "resource.not_found",
"message": "Account not found",
"meta": {}
}
}Authorizations
Prefix your API key with "Bearer ". Example: Authorization: Bearer sapi_key_...
Path Parameters
Automation ID
Body
Fields to change
Response
OK
"acc_01HZ9X3Q4R5M6N7P8V2K0W1J"
Actions that failed
Events the Automation ran against
"aut_01J9Z8Y7X6W5V4T3S2R1Q0P9N8"
"Send the link"
Reach each person at most once. A run in which every action failed does not count
Up to 100 platform post ids, each 1 to 100 characters, a comment must be on. Omitted means every post. Comment trigger only
Actions carried out successfully
active, paused "active"
Up to 10 Steps forming a graph. One must have the key "start"
Show child attributes
Show child attributes
The kind of inbound event that fires the Automation
comment, dm "comment"