Node.js
import { Rewrite } from '@rewritetoday/sdk';
const rewrite = new Rewrite(process.env.REWRITE_API_KEY!);
const { data, error } = await rewrite.messages.get(
'748395130237498412',
);
if (error) throw error;{
"ok": true,
"data": {
"id": "748395130237498412",
"createdAt": "2026-03-20T14:22:31.562Z",
"contact": "Fernanda",
"contactId": "748395130237498515",
"to": "+5511999999999",
"from": null,
"type": "SMS",
"tags": {
"flow": "login",
"origin": "checkout"
},
"status": "DELIVERED",
"country": "br",
"content": "Rewrite: seu codigo e 478201",
"encoding": "GSM7",
"templateId": null,
"deliveredAt": "2026-03-20T14:22:39.914Z",
"scheduledAt": null,
"sandbox": false
}
}Messages
Get a message
Fetch the current state of a single message, including delivery timestamps and rendered content.
GET
/
messages
/
{id}
Node.js
import { Rewrite } from '@rewritetoday/sdk';
const rewrite = new Rewrite(process.env.REWRITE_API_KEY!);
const { data, error } = await rewrite.messages.get(
'748395130237498412',
);
if (error) throw error;{
"ok": true,
"data": {
"id": "748395130237498412",
"createdAt": "2026-03-20T14:22:31.562Z",
"contact": "Fernanda",
"contactId": "748395130237498515",
"to": "+5511999999999",
"from": null,
"type": "SMS",
"tags": {
"flow": "login",
"origin": "checkout"
},
"status": "DELIVERED",
"country": "br",
"content": "Rewrite: seu codigo e 478201",
"encoding": "GSM7",
"templateId": null,
"deliveredAt": "2026-03-20T14:22:39.914Z",
"scheduledAt": null,
"sandbox": false
}
}Authorizations
Send your API key as Authorization: Bearer rw_....
Required scope: message:read.
Path Parameters
Message identifier returned by Rewrite.
Example:
"748395130237498412"