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": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"record_type": "email_message",
"direction": "inbound",
"status": "received",
"inbox_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message_id": "string",
"in_reply_to": "string",
"references": [
"string"
],
"from": {
"email": "example@telnyx.com",
"name": "string"
},
"to": [
{
"email": "example@telnyx.com",
"name": "string"
}
],
"cc": [
{
"email": "example@telnyx.com",
"name": "string"
}
],
"bcc": [
{
"email": "example@telnyx.com",
"name": "string"
}
],
"reply_to": [
{
"email": "example@telnyx.com",
"name": "string"
}
],
"subject": "string",
"text_body_url": "https://example.com",
"html_body_url": "https://example.com",
"reply_text": "string",
"has_quoted_text": false,
"headers": {
"Message-ID": "<message-id@example.com>"
},
"inline_files": [],
"attachments": [],
"labels": [
"string"
],
"read_at": "2024-01-23T18:10:02.574Z",
"received_at": "2024-01-23T18:10:02.574Z",
"sent_at": "2024-01-23T18:10:02.574Z",
"created_at": "2024-01-23T18:10:02.574Z",
"updated_at": "2024-01-23T18:10:02.574Z"
}
}{
"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
Path Parameters
Body
application/json
Was this page helpful?
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": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"record_type": "email_message",
"direction": "inbound",
"status": "received",
"inbox_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"thread_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"message_id": "string",
"in_reply_to": "string",
"references": [
"string"
],
"from": {
"email": "example@telnyx.com",
"name": "string"
},
"to": [
{
"email": "example@telnyx.com",
"name": "string"
}
],
"cc": [
{
"email": "example@telnyx.com",
"name": "string"
}
],
"bcc": [
{
"email": "example@telnyx.com",
"name": "string"
}
],
"reply_to": [
{
"email": "example@telnyx.com",
"name": "string"
}
],
"subject": "string",
"text_body_url": "https://example.com",
"html_body_url": "https://example.com",
"reply_text": "string",
"has_quoted_text": false,
"headers": {
"Message-ID": "<message-id@example.com>"
},
"inline_files": [],
"attachments": [],
"labels": [
"string"
],
"read_at": "2024-01-23T18:10:02.574Z",
"received_at": "2024-01-23T18:10:02.574Z",
"sent_at": "2024-01-23T18:10:02.574Z",
"created_at": "2024-01-23T18:10:02.574Z",
"updated_at": "2024-01-23T18:10:02.574Z"
}
}{
"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."
}
]
}