curl --request PATCH \
--url https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Tone of voice",
"content": "Always write in a friendly, casual tone and keep emails under 100 words."
}
'import requests
url = "https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id}"
payload = {
"title": "Tone of voice",
"content": "Always write in a friendly, casual tone and keep emails under 100 words."
}
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({
title: 'Tone of voice',
content: 'Always write in a friendly, casual tone and keep emails under 100 words.'
})
};
fetch('https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Tone of voice\",\n \"content\": \"Always write in a friendly, casual tone and keep emails under 100 words.\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_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([
'title' => 'Tone of voice',
'content' => 'Always write in a friendly, casual tone and keep emails under 100 words.'
]),
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.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id}"
payload := strings.NewReader("{\n \"title\": \"Tone of voice\",\n \"content\": \"Always write in a friendly, casual tone and keep emails under 100 words.\"\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))
}{
"id": "rule-0",
"title": "Tone of voice",
"content": "Always write in a friendly, casual tone and keep emails under 100 words."
}{
"statusCode": 400,
"error": "Bad Request",
"message": "body must have required property 'name'"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}Update an AI Sales Agent guidance rule
Update the title or content of a guidance rule. Rules are stored as a single list, so concurrent writes to the same agent are last-write-wins — serialize them client-side.
Requires one of the following scopes: ai_sdr:update, ai_sdr:all, all:update, all:all
curl --request PATCH \
--url https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "Tone of voice",
"content": "Always write in a friendly, casual tone and keep emails under 100 words."
}
'import requests
url = "https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id}"
payload = {
"title": "Tone of voice",
"content": "Always write in a friendly, casual tone and keep emails under 100 words."
}
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({
title: 'Tone of voice',
content: 'Always write in a friendly, casual tone and keep emails under 100 words.'
})
};
fetch('https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.patch("https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"Tone of voice\",\n \"content\": \"Always write in a friendly, casual tone and keep emails under 100 words.\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_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([
'title' => 'Tone of voice',
'content' => 'Always write in a friendly, casual tone and keep emails under 100 words.'
]),
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.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules/{rule_id}"
payload := strings.NewReader("{\n \"title\": \"Tone of voice\",\n \"content\": \"Always write in a friendly, casual tone and keep emails under 100 words.\"\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))
}{
"id": "rule-0",
"title": "Tone of voice",
"content": "Always write in a friendly, casual tone and keep emails under 100 words."
}{
"statusCode": 400,
"error": "Bad Request",
"message": "body must have required property 'name'"
}{
"statusCode": 401,
"error": "Unauthorized",
"message": "Missing Authorization header"
}{
"statusCode": 402,
"error": "Payment Required",
"message": "Workspace does not have an active paid plan"
}{
"statusCode": 404,
"error": "Not Found",
"message": "Resource not found"
}{
"statusCode": 429,
"error": "Too Many Requests",
"message": "Rate limit exceeded"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
AI Sales Agent ID
"01a08b36-b27f-768a-b450-8bb2c5ece1d8"
Positional guidance rule id from the guidance rules list (e.g. rule-0). Ids re-index after a deletion.
^rule-(0|[1-9][0-9]*)$"rule-0"
Body
Response
The updated guidance rule
A guidance rule the AI Sales Agent must follow when writing outreach. An agent can have at most 10 rules. Rule ids are positional (rule-0, rule-1, …) and re-index after a deletion.
Positional rule id. Re-indexed after a deletion, so re-fetch the list after deleting a rule.
"rule-0"
Short title of the rule
119"Tone of voice"
The rule text the agent must follow
"Always write in a friendly, casual tone and keep emails under 100 words."