Reject an AI Sales Agent activity
curl --request POST \
--url https://api.instantly.ai/api/v2/ai-agents/sales/{id}/activities/{activity_id}/reject \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rejection_reason": "Not aligned with current strategy"
}
'import requests
url = "https://api.instantly.ai/api/v2/ai-agents/sales/{id}/activities/{activity_id}/reject"
payload = { "rejection_reason": "Not aligned with current strategy" }
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({rejection_reason: 'Not aligned with current strategy'})
};
fetch('https://api.instantly.ai/api/v2/ai-agents/sales/{id}/activities/{activity_id}/reject', 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}/activities/{activity_id}/reject")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rejection_reason\": \"Not aligned with current strategy\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/ai-agents/sales/{id}/activities/{activity_id}/reject",
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([
'rejection_reason' => 'Not aligned with current strategy'
]),
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}/activities/{activity_id}/reject"
payload := strings.NewReader("{\n \"rejection_reason\": \"Not aligned with current strategy\"\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": "01a1f0d3-24e5-702b-bc6c-ea06acad2bfb",
"ai_sdr_id": "01a1f0d3-24e5-702b-bc6c-ea083a1f8bdf",
"workspace_id": "01a1f0d3-24e5-702b-bc6c-ea0a816fe860",
"action_type": "create_campaign",
"action_status": "pending",
"timestamp_created": "2026-11-18T22:42:11.813Z",
"timestamp_updated": "2026-11-18T22:42:11.813Z",
"action_payload": {},
"action_output": {},
"email_id": "01a1f0d3-24e5-702b-bc6c-ea0b529da914",
"approved_by": "01a1f0d3-24e5-702b-bc6c-ea0d04976506",
"approved_at": "2026-11-18T22:42:11.813Z",
"rejected_by": "01a1f0d3-24e5-702b-bc6c-ea0fca0a7cf8",
"rejected_at": "2026-11-18T22:42:11.813Z",
"rejection_reason": "Not aligned with current strategy",
"ai_reasoning": "This lead matches the ICP criteria and has shown interest",
"ai_confidence": 0.85,
"result": {},
"error_message": "Failed to create campaign: Invalid email list",
"error_code": "insufficient_credits",
"timestamp_executed": "2026-11-18T22:42:11.813Z",
"timestamp_completed": "2026-11-18T22:42:11.813Z"
}{
"statusCode": 400,
"error": "Bad Request",
"message": "body must have required property 'name'",
"code": "FST_ERR_VALIDATION"
}{
"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"
}AI Sales Agent
Reject an AI Sales Agent activity
Reject a pending AI Sales Agent activity action. Returns 404 when the activity does not exist or is not pending.
Requires one of the following scopes: ai_sdr:update, ai_sdr:all, all:update, all:all
POST
/
api
/
v2
/
ai-agents
/
sales
/
{id}
/
activities
/
{activity_id}
/
reject
Reject an AI Sales Agent activity
curl --request POST \
--url https://api.instantly.ai/api/v2/ai-agents/sales/{id}/activities/{activity_id}/reject \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rejection_reason": "Not aligned with current strategy"
}
'import requests
url = "https://api.instantly.ai/api/v2/ai-agents/sales/{id}/activities/{activity_id}/reject"
payload = { "rejection_reason": "Not aligned with current strategy" }
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({rejection_reason: 'Not aligned with current strategy'})
};
fetch('https://api.instantly.ai/api/v2/ai-agents/sales/{id}/activities/{activity_id}/reject', 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}/activities/{activity_id}/reject")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rejection_reason\": \"Not aligned with current strategy\"\n}")
.asString();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.instantly.ai/api/v2/ai-agents/sales/{id}/activities/{activity_id}/reject",
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([
'rejection_reason' => 'Not aligned with current strategy'
]),
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}/activities/{activity_id}/reject"
payload := strings.NewReader("{\n \"rejection_reason\": \"Not aligned with current strategy\"\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": "01a1f0d3-24e5-702b-bc6c-ea06acad2bfb",
"ai_sdr_id": "01a1f0d3-24e5-702b-bc6c-ea083a1f8bdf",
"workspace_id": "01a1f0d3-24e5-702b-bc6c-ea0a816fe860",
"action_type": "create_campaign",
"action_status": "pending",
"timestamp_created": "2026-11-18T22:42:11.813Z",
"timestamp_updated": "2026-11-18T22:42:11.813Z",
"action_payload": {},
"action_output": {},
"email_id": "01a1f0d3-24e5-702b-bc6c-ea0b529da914",
"approved_by": "01a1f0d3-24e5-702b-bc6c-ea0d04976506",
"approved_at": "2026-11-18T22:42:11.813Z",
"rejected_by": "01a1f0d3-24e5-702b-bc6c-ea0fca0a7cf8",
"rejected_at": "2026-11-18T22:42:11.813Z",
"rejection_reason": "Not aligned with current strategy",
"ai_reasoning": "This lead matches the ICP criteria and has shown interest",
"ai_confidence": 0.85,
"result": {},
"error_message": "Failed to create campaign: Invalid email list",
"error_code": "insufficient_credits",
"timestamp_executed": "2026-11-18T22:42:11.813Z",
"timestamp_completed": "2026-11-18T22:42:11.813Z"
}{
"statusCode": 400,
"error": "Bad Request",
"message": "body must have required property 'name'",
"code": "FST_ERR_VALIDATION"
}{
"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
Path Parameters
Body
application/json
Response
The rejected activity
An activity performed by an AI Sales Agent
Type of action performed
Available options:
create_campaign, edit_campaign, stop_campaign, pause_campaign, enrich_leads, push_lead, recommend_lead, recommend_autopilot, recommend_lead_quality, warning, initial_setup_scrape, initial_setup_campaigns, initial_setup_enrich, email_sent, lead_meeting_booked, lead_closed, email_opened, reply_received, opportunity_received, campaign_completed, imported_leads Example:
"create_campaign"
Stable error category if the activity failed
Available options:
insufficient_credits, insufficient_upload_limit, no_leads_with_email, scrape_site_not_supported, campaign_operation_failed, lead_move_failed, enrichment_failed, configuration_error, master_list_missing, temporary_failure, prospecting_incomplete, internal_error Example:
"insufficient_credits"