Mark a whole conversation read / unread
curl -X PATCH "https://api.supasend.io/v1/inbox/threads/507f1f77bcf86cd799439011" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"is_read": true
}'
import requests
import json
url = "https://api.supasend.io/v1/inbox/threads/507f1f77bcf86cd799439011"
headers = {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
}
data = {
"is_read": true
}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.supasend.io/v1/inbox/threads/507f1f77bcf86cd799439011", {
method: "PATCH",
headers: {
"Content-Type": "application/json",
"X-API-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"is_read": true
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"is_read": true
}`)
req, err := http.NewRequest("PATCH", "https://api.supasend.io/v1/inbox/threads/507f1f77bcf86cd799439011", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-API-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.supasend.io/v1/inbox/threads/507f1f77bcf86cd799439011')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(uri)
request['Content-Type'] = 'application/json'
request['X-API-Key'] = 'YOUR_API_KEY'
request.body = '{
"is_read": true
}'
response = http.request(request)
puts response.body
{
"id": "example_string",
"mailbox_id": "example_string",
"root_message_id": "example_string",
"subject": "example_string",
"participants": [
"example_string"
],
"email_job_id": "user@example.com",
"message_count": 25,
"unread_count": 10,
"last_message_at": "2024-12-25T10:00:00Z",
"last_message_direction": "inbound",
"last_inbound_at": "2024-12-25T10:00:00Z",
"snippet": "example_string",
"created_at": "2024-12-25T10:00:00Z",
"updated_at": "2024-12-25T10:00:00Z"
}
{
"error": "Not Found",
"message": "The requested resource was not found",
"code": 404
}
PATCH
/v1/inbox/threads/{id}PATCH
Base URLstring
Target server for requests. Edit to use your own host.
API Key (header: X-API-Key)
X-API-Keystring
RequiredAPI key in the format sk_live_<64 hex characters>
API key in the format
sk_live_<64 hex characters>path
idstring
RequiredMongoDB ObjectID
Content-Typestring
RequiredThe media type of the request body
Options: application/json
Request Preview
Response
Response will appear here after sending the request
Authentication
header
X-API-Keystring
RequiredAPI Key for authentication. API key in the format sk_live_\<64 hex characters\>
Path Parameters
Body
application/json
Responses
idstring
mailbox_idstring
root_message_idstring
subjectstring
participantsstring[]
Counterparty addresses (your mailbox is excluded)
email_job_idstring
The send that started the conversation, when it was yours
message_countinteger
unread_countinteger
last_message_atstring
last_message_directionstring
Allowed values:
inboundoutboundlast_inbound_atstring
snippetstring
created_atstring
updated_atstring
Was this page helpful?