Get the status of a message
const url = 'https://api.frontmail.dev/v1/messages/msg_01j9z3m2c7v8b9n0m1q2w3e4r5';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.frontmail.dev/v1/messages/msg_01j9z3m2c7v8b9n0m1q2w3e4r5 \ --header 'Authorization: Bearer <token>'With a private key (Authorization: Bearer) any message of the organization; otherwise pass the status_token returned by the send call in the X-Frontmail-Status-Token header (preferred – query strings end up in access logs) or, for backward compatibility, as ?token=.
Authorizations
Section titled “Authorizations”- privateKey
- None
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Message id
Example
msg_01j9z3m2c7v8b9n0m1q2w3e4r5Message id
Query Parameters
Section titled “Query Parameters”Deprecated: status_token from the send response. Use the X-Frontmail-Status-Token header.
Deprecated: status_token from the send response. Use the X-Frontmail-Status-Token header.
Header Parameters
Section titled “Header Parameters”status_token from the send response (preferred over ?token=).
status_token from the send response (preferred over ?token=).
Responses
Section titled “ Responses ”Message status and timeline.
object
object
Example
{ "status": "queued"}Invalid request body, query or Idempotency-Key (invalid_body, bad_request, invalid_idempotency_key).
object
object
Stable error code. See https://docs.frontmail.dev/reference/errors/.
Example
{ "error": { "code": "invalid_template_params", "message": "Invalid template parameters. email: Enter a valid e-mail address.", "docs_url": "https://docs.frontmail.dev/reference/errors/#invalid-template-params", "details": { "issues": [ { "param": "email", "code": "invalid_email", "message": "Enter a valid e-mail address." } ] } }}Missing or invalid key (unauthorized, invalid_public_key, invalid_private_key).
object
object
Stable error code. See https://docs.frontmail.dev/reference/errors/.
Example
{ "error": { "code": "invalid_template_params", "message": "Invalid template parameters. email: Enter a valid e-mail address.", "docs_url": "https://docs.frontmail.dev/reference/errors/#invalid-template-params", "details": { "issues": [ { "param": "email", "code": "invalid_email", "message": "Enter a valid e-mail address." } ] } }}Template, service or message not found.
object
object
Stable error code. See https://docs.frontmail.dev/reference/errors/.
Example
{ "error": { "code": "invalid_template_params", "message": "Invalid template parameters. email: Enter a valid e-mail address.", "docs_url": "https://docs.frontmail.dev/reference/errors/#invalid-template-params", "details": { "issues": [ { "param": "email", "code": "invalid_email", "message": "Enter a valid e-mail address." } ] } }}Rate limited – see Retry-After (seconds).
object
object
Stable error code. See https://docs.frontmail.dev/reference/errors/.
Example
{ "error": { "code": "invalid_template_params", "message": "Invalid template parameters. email: Enter a valid e-mail address.", "docs_url": "https://docs.frontmail.dev/reference/errors/#invalid-template-params", "details": { "issues": [ { "param": "email", "code": "invalid_email", "message": "Enter a valid e-mail address." } ] } }}Headers
Section titled “Headers”Seconds to wait before retrying.
Seconds to wait before retrying.
Unexpected error; details.request_id identifies the request.
object
object
Stable error code. See https://docs.frontmail.dev/reference/errors/.
Example
{ "error": { "code": "invalid_template_params", "message": "Invalid template parameters. email: Enter a valid e-mail address.", "docs_url": "https://docs.frontmail.dev/reference/errors/#invalid-template-params", "details": { "issues": [ { "param": "email", "code": "invalid_email", "message": "Enter a valid e-mail address." } ] } }}