Mark email thread read
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read \
--header 'Authorization: Bearer <token>' \
--header 'Team-SID: <api-key>'import requests
url = "https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read"
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Team-SID': '<api-key>'}
};
fetch('https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read', 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://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Team-SID: <api-key>"
],
]);
$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://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "action",
"action": "<string>",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"email_account_sid": "<string>",
"provider_thread_id": "<string>",
"subject_normalized": "<string>",
"participants": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"participants_count": 123,
"messages_count": 123,
"unread_count": 123,
"last_message_at": "<string>",
"last_inbound_at": "<string>",
"last_outbound_at": "<string>",
"has_unanswered_inbound": true,
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>"
},
"result": {
"updated_messages_count": 123
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}email_threads
Mark email thread read
Mark every message of a conversation read, in the mailbox at its provider too, in one call: the way to settle a thread after it was handled. item is the thread after the change (unread_count 0), result.updated_messages_count how many messages turned. If the provider refuses part way, the messages already turned stay read, so repeating finishes the job. One message alone is update_email_message. Requires can_act_email_messages.
Contract:
- MCP tool
mark_email_thread_read, registry packagemcp.email/email_threads, mountemail.messaging. - Operation
action, response envelopeaction. - Flags: none.
POST
/
api
/
email-threads
/
{sid}
/
mark-as-read
Mark email thread read
curl --request POST \
--url https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read \
--header 'Authorization: Bearer <token>' \
--header 'Team-SID: <api-key>'import requests
url = "https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read"
headers = {
"Authorization": "Bearer <token>",
"Team-SID": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Team-SID': '<api-key>'}
};
fetch('https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read', 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://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Team-SID: <api-key>"
],
]);
$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://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Team-SID", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read")
.header("Authorization", "Bearer <token>")
.header("Team-SID", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gtm-api.com/email/v4/api/email-threads/{sid}/mark-as-read")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Team-SID"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"operation": "action",
"action": "<string>",
"item": {
"sid": "<string>",
"team_sid": "<string>",
"email_account_sid": "<string>",
"provider_thread_id": "<string>",
"subject_normalized": "<string>",
"participants": [
{
"email": "<string>",
"display_name": "<string>"
}
],
"participants_count": 123,
"messages_count": 123,
"unread_count": 123,
"last_message_at": "<string>",
"last_inbound_at": "<string>",
"last_outbound_at": "<string>",
"has_unanswered_inbound": true,
"created_at": "<string>",
"updated_at": "<string>",
"deleted_at": "<string>"
},
"result": {
"updated_messages_count": 123
},
"meta": {
"trace_id": "<string>",
"span_id": "<string>",
"timestamp": "<string>",
"duration_ms": 1,
"team_sid": "<string>",
"actor_type": "<string>"
}
}Authorizations
Headers
Response
action success envelope.