Update a macro
Replaces the macro’s name, visibility and actions. actions is replaced wholesale, not merged — send the complete list every time.
curl --request PATCH \
--url https://app.tied.com/api/v1/accounts/{account_id}/macros/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"name": "Send the shipping policy",
"visibility": "personal",
"actions": [
{
"action_name": "send_message",
"action_params": [
"Here is our shipping policy: orders placed before 2pm ship the same working day."
]
}
]
}
'import requests
url = "https://app.tied.com/api/v1/accounts/{account_id}/macros/{id}"
payload = {
"name": "Send the shipping policy",
"visibility": "personal",
"actions": [
{
"action_name": "send_message",
"action_params": ["Here is our shipping policy: orders placed before 2pm ship the same working day."]
}
]
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Send the shipping policy',
visibility: 'personal',
actions: [
{
action_name: 'send_message',
action_params: [
'Here is our shipping policy: orders placed before 2pm ship the same working day.'
]
}
]
})
};
fetch('https://app.tied.com/api/v1/accounts/{account_id}/macros/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://app.tied.com/api/v1/accounts/{account_id}/macros/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Send the shipping policy\",\n \"visibility\": \"personal\",\n \"actions\": [\n {\n \"action_name\": \"send_message\",\n \"action_params\": [\n \"Here is our shipping policy: orders placed before 2pm ship the same working day.\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.tied.com/api/v1/accounts/{account_id}/macros/{id}"
payload := strings.NewReader("{\n \"name\": \"Send the shipping policy\",\n \"visibility\": \"personal\",\n \"actions\": [\n {\n \"action_name\": \"send_message\",\n \"action_params\": [\n \"Here is our shipping policy: orders placed before 2pm ship the same working day.\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("api_access_token", "<api-key>")
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))
}{
"payload": {
"id": 4,
"name": "Send the shipping policy",
"visibility": "personal",
"created_by": {
"id": 1,
"account_id": 1,
"availability_status": "offline",
"auto_offline": true,
"confirmed": true,
"email": "you@example.com",
"provider": "email",
"available_name": "Alex Rivera",
"name": "Alex Rivera",
"role": "administrator",
"thumbnail": "/dashboard/images/default-contact-avatars/031.svg",
"avatar_url": "",
"illustration_avatar": true,
"accent_color": null,
"custom_role_id": null
},
"updated_by": {
"id": 1,
"account_id": 1,
"availability_status": "offline",
"auto_offline": true,
"confirmed": true,
"email": "you@example.com",
"provider": "email",
"available_name": "Alex Rivera",
"name": "Alex Rivera",
"role": "administrator",
"thumbnail": "/dashboard/images/default-contact-avatars/031.svg",
"avatar_url": "",
"illustration_avatar": true,
"accent_color": null,
"custom_role_id": null
},
"account_id": 1,
"actions": [
{
"action_name": "send_message",
"action_params": [
"Here is our shipping policy: orders placed before 2pm ship the same working day."
]
}
]
}
}{
"error": "Resource could not be found"
}{
"error": "Resource could not be found"
}{
"message": "Url has already been taken",
"attributes": [
"url"
]
}Authorizations
This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.
Path Parameters
The numeric ID of the macro.
2
Body
Unlike most write endpoints, the macro body is sent at the top level rather than under a macro key.
The macro name.
"Send the shipping policy"
The ordered steps. An unrecognised action_name fails the whole request with a 422.
Show child attributes
Show child attributes
Defaults to personal. An agent token is always forced to personal whatever it sends — only an administrator can create a global macro.
global, personal Response
Success
Single-macro responses are wrapped in a payload key.
Show child attributes
Show child attributes
Was this page helpful?
curl --request PATCH \
--url https://app.tied.com/api/v1/accounts/{account_id}/macros/{id} \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"name": "Send the shipping policy",
"visibility": "personal",
"actions": [
{
"action_name": "send_message",
"action_params": [
"Here is our shipping policy: orders placed before 2pm ship the same working day."
]
}
]
}
'import requests
url = "https://app.tied.com/api/v1/accounts/{account_id}/macros/{id}"
payload = {
"name": "Send the shipping policy",
"visibility": "personal",
"actions": [
{
"action_name": "send_message",
"action_params": ["Here is our shipping policy: orders placed before 2pm ship the same working day."]
}
]
}
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Send the shipping policy',
visibility: 'personal',
actions: [
{
action_name: 'send_message',
action_params: [
'Here is our shipping policy: orders placed before 2pm ship the same working day.'
]
}
]
})
};
fetch('https://app.tied.com/api/v1/accounts/{account_id}/macros/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));require 'uri'
require 'net/http'
url = URI("https://app.tied.com/api/v1/accounts/{account_id}/macros/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["api_access_token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Send the shipping policy\",\n \"visibility\": \"personal\",\n \"actions\": [\n {\n \"action_name\": \"send_message\",\n \"action_params\": [\n \"Here is our shipping policy: orders placed before 2pm ship the same working day.\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.tied.com/api/v1/accounts/{account_id}/macros/{id}"
payload := strings.NewReader("{\n \"name\": \"Send the shipping policy\",\n \"visibility\": \"personal\",\n \"actions\": [\n {\n \"action_name\": \"send_message\",\n \"action_params\": [\n \"Here is our shipping policy: orders placed before 2pm ship the same working day.\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("api_access_token", "<api-key>")
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))
}{
"payload": {
"id": 4,
"name": "Send the shipping policy",
"visibility": "personal",
"created_by": {
"id": 1,
"account_id": 1,
"availability_status": "offline",
"auto_offline": true,
"confirmed": true,
"email": "you@example.com",
"provider": "email",
"available_name": "Alex Rivera",
"name": "Alex Rivera",
"role": "administrator",
"thumbnail": "/dashboard/images/default-contact-avatars/031.svg",
"avatar_url": "",
"illustration_avatar": true,
"accent_color": null,
"custom_role_id": null
},
"updated_by": {
"id": 1,
"account_id": 1,
"availability_status": "offline",
"auto_offline": true,
"confirmed": true,
"email": "you@example.com",
"provider": "email",
"available_name": "Alex Rivera",
"name": "Alex Rivera",
"role": "administrator",
"thumbnail": "/dashboard/images/default-contact-avatars/031.svg",
"avatar_url": "",
"illustration_avatar": true,
"accent_color": null,
"custom_role_id": null
},
"account_id": 1,
"actions": [
{
"action_name": "send_message",
"action_params": [
"Here is our shipping policy: orders placed before 2pm ship the same working day."
]
}
]
}
}{
"error": "Resource could not be found"
}{
"error": "Resource could not be found"
}{
"message": "Url has already been taken",
"attributes": [
"url"
]
}