Update an inbox message
Updates the explicit read state of an account-scoped inbound message. Set read_at
to true to mark the message read at the server’s current time, to an ISO 8601
timestamp to use that timestamp, or to null to mark the message unread. Repeating
the same update is idempotent.
PATCH
/
email_inboxes
/
{inbox_id}
/
messages
/
{message_id}
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const InboundMessage = await client.emailInboxes.messages.update('inbox_id', 'message_id', {
read_at: 'True',
});
console.log(InboundMessage.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
inbound_message = client.email_inboxes.messages.update(
inbox_id="inbox_id",
message_id="message_id",
read_at="True",
)
print(inbound_message.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
message, err := client.EmailInboxes.Messages.Update(
context.TODO(),
"inbox_id",
"message_id",
telnyx.EmailInboxeMessageUpdateParams{
ReadAt: "read_at",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", message.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.emailInboxes.messages.MessageUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessageUpdateParams params = MessageUpdateParams.builder()
.readAt(MessageUpdateParams.ReadAt.TRUE)
.build();
var response = client.emailInboxes().messages().update("inbox_id", "message_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
inbound_message = telnyx.email_inboxes.messages.update("inbox_id", "message_id", read_at: :True)
puts(inbound_message)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$inbound_message = $client->emailInboxes->messages->update(
'inbox_id',
'message_id',
read_at: 'True',
);
var_dump($inbound_message);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:messages update \
--api-key 'My API Key' \
--inbox-id inbox_id \
--message-id message_id \
--read-at Truecurl --request PATCH \
--url https://api.telnyx.com/v2/email_inboxes/{inbox_id}/messages/{message_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"read_at": true
}
'{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"record_type": "email_message",
"direction": "inbound",
"status": "received",
"inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_id": "<string>",
"in_reply_to": "<string>",
"references": [
"<string>"
],
"from": {
"email": "jsmith@example.com",
"name": "<string>"
},
"to": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"cc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"bcc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"reply_to": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"subject": "<string>",
"text_body_url": "<string>",
"html_body_url": "<string>",
"reply_text": "<string>",
"has_quoted_text": true,
"headers": {},
"inline_files": [
{}
],
"attachments": [
{}
],
"labels": [
"<string>"
],
"read_at": "2023-11-07T05:31:56Z",
"received_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"errors": [
{
"code": "10006",
"title": "Not authorized",
"detail": "Invalid API key",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested resource was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "subject can't be blank",
"source": {
"pointer": "/data/attributes/subject"
}
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "The email domain service is temporarily unavailable. Please try again later."
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Email inbox UUID.
Inbound email message UUID.
Body
application/json
Set to true for server time, an ISO 8601 timestamp for an explicit read time, or null to mark unread.
Available options:
true Response
Updated inbox message.
Show child attributes
Show child attributes
Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const InboundMessage = await client.emailInboxes.messages.update('inbox_id', 'message_id', {
read_at: 'True',
});
console.log(InboundMessage.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
inbound_message = client.email_inboxes.messages.update(
inbox_id="inbox_id",
message_id="message_id",
read_at="True",
)
print(inbound_message.data)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
message, err := client.EmailInboxes.Messages.Update(
context.TODO(),
"inbox_id",
"message_id",
telnyx.EmailInboxeMessageUpdateParams{
ReadAt: "read_at",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", message.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.emailInboxes.messages.MessageUpdateParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessageUpdateParams params = MessageUpdateParams.builder()
.readAt(MessageUpdateParams.ReadAt.TRUE)
.build();
var response = client.emailInboxes().messages().update("inbox_id", "message_id", params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
inbound_message = telnyx.email_inboxes.messages.update("inbox_id", "message_id", read_at: :True)
puts(inbound_message)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$inbound_message = $client->emailInboxes->messages->update(
'inbox_id',
'message_id',
read_at: 'True',
);
var_dump($inbound_message);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx email-inboxes:messages update \
--api-key 'My API Key' \
--inbox-id inbox_id \
--message-id message_id \
--read-at Truecurl --request PATCH \
--url https://api.telnyx.com/v2/email_inboxes/{inbox_id}/messages/{message_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"read_at": true
}
'{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"record_type": "email_message",
"direction": "inbound",
"status": "received",
"inbox_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"thread_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_id": "<string>",
"in_reply_to": "<string>",
"references": [
"<string>"
],
"from": {
"email": "jsmith@example.com",
"name": "<string>"
},
"to": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"cc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"bcc": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"reply_to": [
{
"email": "jsmith@example.com",
"name": "<string>"
}
],
"subject": "<string>",
"text_body_url": "<string>",
"html_body_url": "<string>",
"reply_text": "<string>",
"has_quoted_text": true,
"headers": {},
"inline_files": [
{}
],
"attachments": [
{}
],
"labels": [
"<string>"
],
"read_at": "2023-11-07T05:31:56Z",
"received_at": "2023-11-07T05:31:56Z",
"sent_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"errors": [
{
"code": "10006",
"title": "Not authorized",
"detail": "Invalid API key",
"meta": {
"url": "https://developers.telnyx.com/docs/overview/errors/10006"
}
}
]
}{
"errors": [
{
"code": "10001",
"title": "Not Found",
"detail": "The requested resource was not found"
}
]
}{
"errors": [
{
"code": "10015",
"title": "Validation Failed",
"detail": "subject can't be blank",
"source": {
"pointer": "/data/attributes/subject"
}
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "The email domain service is temporarily unavailable. Please try again later."
}
]
}