curl --request POST \
--url https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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"
payload = { "content": "Always write in a friendly, casual tone and keep emails under 100 words." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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"
payload := strings.NewReader("{\n \"content\": \"Always write in a friendly, casual tone and keep emails under 100 words.\"\n}")
req, _ := http.NewRequest("POST", 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": "Maximum 10 guidance rules allowed"
}{
"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"
}Create an AI Sales Agent guidance rule
Add a guidance rule the AI Sales Agent must follow when writing outreach. An agent can have at most 10 rules. 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 POST \
--url https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"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"
payload = { "content": "Always write in a friendly, casual tone and keep emails under 100 words." }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.instantly.ai/api/v2/ai-agents/sales/{id}/guidance-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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"
payload := strings.NewReader("{\n \"content\": \"Always write in a friendly, casual tone and keep emails under 100 words.\"\n}")
req, _ := http.NewRequest("POST", 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": "Maximum 10 guidance rules allowed"
}{
"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-b277-7624-9f8a-290035be2eba"
Body
The rule text the agent must follow
1"Always write in a friendly, casual tone and keep emails under 100 words."
Optional short title of the rule. When omitted, a positional default title is used.
119^[^\n\r]*$"Tone of voice"
Response
The created 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."