curl --request DELETE \
--url https://api.isnap.ai/v1/messages/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.isnap.ai/v1/messages/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.isnap.ai/v1/messages/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.isnap.ai/v1/messages/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.isnap.ai/v1/messages/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.isnap.ai/v1/messages/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.isnap.ai/v1/messages/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"line_id": "<string>",
"direction": "outbound",
"kind": "message",
"to": "<string>",
"from": "<string>",
"body": "<string>",
"channel": "auto",
"service": "iMessage",
"status": "queued",
"effect": {
"type": "bubble",
"name": "slam"
},
"reply_to_message_id": "<string>",
"use_typing_indicator": true,
"metadata": {},
"attachments": [
{
"id": "<string>",
"content_type": "<string>",
"filename": "<string>",
"size_bytes": 2,
"duration_ms": 1
}
],
"reactions": [
{
"reaction_type": "love",
"reaction_emoji": "<string>",
"from_handle": "<string>",
"direction": "outbound",
"created_at": "<string>"
}
],
"scheduled_for": "<string>",
"schedule_reason": "<string>",
"reply_lane": true,
"ignore_quiet_hours": true,
"queue_info": {
"queue_position": 1,
"is_new_contact": true,
"daily_new_contacts_used": 1,
"daily_new_contact_limit": 1,
"daily_known_contacts_used": 1,
"daily_known_contact_limit": 1,
"daily_messages_used": 1,
"daily_total_message_limit": 1,
"reply_lane": true,
"daily_replies_used": 1,
"daily_reply_limit": 1,
"messages_ahead_in_queue": 1,
"daily_slot_of": "<string>",
"target_activity_hour": 11,
"next_slot_available_at": "<string>",
"last_new_contact_sent_at": "<string>",
"min_inter_new_contact_seconds": 1,
"jitter_applied_seconds": 1
},
"created_at": "<string>",
"queued_at": "<string>",
"sent_at": "<string>",
"delivered_at": "<string>",
"read_at": "<string>",
"failed_at": "<string>",
"error_code": "<string>",
"error_message": "<string>",
"cancelled_at": "<string>"
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}Cancel a message
Cancels a queued or held message that the line’s device has not taken.
curl --request DELETE \
--url https://api.isnap.ai/v1/messages/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.isnap.ai/v1/messages/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.isnap.ai/v1/messages/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.isnap.ai/v1/messages/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.isnap.ai/v1/messages/{id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://api.isnap.ai/v1/messages/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.isnap.ai/v1/messages/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"line_id": "<string>",
"direction": "outbound",
"kind": "message",
"to": "<string>",
"from": "<string>",
"body": "<string>",
"channel": "auto",
"service": "iMessage",
"status": "queued",
"effect": {
"type": "bubble",
"name": "slam"
},
"reply_to_message_id": "<string>",
"use_typing_indicator": true,
"metadata": {},
"attachments": [
{
"id": "<string>",
"content_type": "<string>",
"filename": "<string>",
"size_bytes": 2,
"duration_ms": 1
}
],
"reactions": [
{
"reaction_type": "love",
"reaction_emoji": "<string>",
"from_handle": "<string>",
"direction": "outbound",
"created_at": "<string>"
}
],
"scheduled_for": "<string>",
"schedule_reason": "<string>",
"reply_lane": true,
"ignore_quiet_hours": true,
"queue_info": {
"queue_position": 1,
"is_new_contact": true,
"daily_new_contacts_used": 1,
"daily_new_contact_limit": 1,
"daily_known_contacts_used": 1,
"daily_known_contact_limit": 1,
"daily_messages_used": 1,
"daily_total_message_limit": 1,
"reply_lane": true,
"daily_replies_used": 1,
"daily_reply_limit": 1,
"messages_ahead_in_queue": 1,
"daily_slot_of": "<string>",
"target_activity_hour": 11,
"next_slot_available_at": "<string>",
"last_new_contact_sent_at": "<string>",
"min_inter_new_contact_seconds": 1,
"jitter_applied_seconds": 1
},
"created_at": "<string>",
"queued_at": "<string>",
"sent_at": "<string>",
"delivered_at": "<string>",
"read_at": "<string>",
"failed_at": "<string>",
"error_code": "<string>",
"error_message": "<string>",
"cancelled_at": "<string>"
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}{
"success": false,
"data": "<unknown>",
"error": {
"status": 123,
"code": "<string>",
"message": "<string>",
"retry_after": 123,
"retry_at": "<string>",
"issues": [
{
"path": [
"<string>"
],
"message": "<string>",
"code": "<string>",
"min": 123,
"max": 123
}
]
},
"trace_id": "<string>",
"request_id": "<string>"
}- Credential: an API key. A trial key returns
401 unauthorized. - Line-scoped keys: a line-scoped key gets
404 not_foundfor a message on a line outside its list. Idempotency-Key: not honored. A repeat of a cancel that succeeded returns409 too_late_to_cancel.- Events: sends
message.cancelled. - Personal data: the response carries the handles in
toandfrom, the text inbody, the attachment file names and yourmetadata. Request it only when needed, do not copy it into logs, tickets or other tools, and refer to a contact by an id of your own. - What can be canceled: a message whose
statusisqueuedorscheduled, and that the line’s device has not taken. See Canceling a message. - Sending limits: a canceled message that had counted against the limits of the line stops counting against them.
Errors
| Status | error.code | When |
|---|---|---|
| 400 | validation_failed | The id is not msg_ followed by 25 characters. |
| 404 | not_found | The id is unknown, the message belongs to another account or to a trial, is on a line outside the list of a line-scoped key, or iSnap has deleted it. |
| 409 | too_late_to_cancel | The message is sent, delivered, read, failed or already cancelled, or it is queued and the line’s device has taken it. On a queued message, the device goes on with the send. |
Authorizations
An API key created in the iSnap dashboard, or a trial key, sent as Authorization: Bearer <key>. An API key starts with isnap_live_ or isnap_test_; both act on the same account, lines and billing. A trial key acts on its trial only.
Path Parameters
Message id: msg_ followed by 25 letters or digits.
^msg_[0-9A-Za-z]{25}$Response
The canceled message, with status: cancelled.
Always true on a success response.
true A message sent or received by a line. The response of POST /v1/messages, the reads, the list items, the cancel response and the message field of the message.* events all carry this object. It has no chat id: the chat id is given by GET /v1/chats and by events. It carries personal data: the handles in to and from, the text in body, the file names of attachments, and what you put in metadata. Timestamps are ISO 8601 in UTC.
Show child attributes
Show child attributes
Trace id of the request that produced this response: 32 lowercase hexadecimal characters. Quote it when you report a problem to iSnap.
Id of the request that produced this response: req_ followed by 25 letters or digits.