> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rray.app/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rray.app/_mcp/server.

# Get Message

GET https://api.rray.app/v1/messages/{message_id}

One message with its aggregate `status`, one entry per recipient in `deliveries`, and
the `events` timeline across all of them. An id belonging to another workspace is a
`404` — ids are never confirmed across the isolation boundary.

Reference: https://docs.rray.app/api/api-reference/messages/get

## Authentication

- `Authorization` header (bearer token, required) — A workspace key (`rray_live_…`, bound to one workspace) or the account's platform key. Platform keys name the target workspace with `RRay-Workspace-Id`. See [Credentials](https://docs.rray.app/docs/concepts/authentication).

## Request

### Path parameters

- `message_id` (string, required)

### Headers

- `RRay-Workspace-Id` (string, optional, nullable) — The workspace to act on. Required with a platform key; rejected with a workspace key, which already carries its workspace — a matching value is rejected too, rather than silently ignored. An id that is not yours returns `404 workspace.not_found`.

## Response

### 200

Successful Response

- `id` (string, required) — Identifier of the message.
- `status` (enum, required) — Aggregate status across every delivery of this message; `mixed` when its deliveries disagree.
  - Allowed values: `accepted`, `queued`, `delivered`, `bounced`, `deferred`, `failed`, `mixed`
- `from` (string, required) — Sender address as sent.
- `workspace_id` (string, required) — Workspace this message was sent from.
- `created_at` (datetime, required) — When the message was accepted (RFC 3339, UTC).
- `object` ("message", optional, default: message) — Always `message`.
- `subject` (string, optional, nullable) — Subject line as sent.
- `deliveries` (list of DeliveryBreakdown, optional, default: []) — One entry per recipient address, with that recipient's own status.
- `attachments` (list of AttachmentMeta, optional, default: []) — Descriptor of each attachment as sent. The bytes themselves are not retained.
- `events` (list of DeliveryEventResponse, optional, default: []) — Delivery timeline across every recipient of this message, oldest first.

## Errors

### 401 Unauthorized Error

Unauthorized

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Stable machine-readable error key to match on. Full catalog: `GET /errors`.
  - Allowed values: `api_key.not_found`, `app.internal_error`, `auth.dashboard_session_required`, `auth.forbidden`, `auth.platform_credential_required`, `auth.provider_unavailable`, `auth.unauthorized`, `billing.daily_cap_reached`, `billing.outstanding_invoice`, `billing.overage_cap_reached`, `billing.payment_method_required`, `billing.plan_quota_exhausted`, `billing.provider_error`, `billing.suspended`, `billing.workspace_limit_exceeded`, `domain.already_exists`, `error_type.not_found`, `idempotency.body_mismatch`, `idempotency.conflict`, `message.body_unavailable`, `message.injection_failed`, `message.not_found`, `pat.name_taken`, `pat.not_found`, `rate_limit.exceeded`, `resource.conflict`, `resource.not_found`, `validation.attachment_too_large`, `validation.attachment_url_forbidden`, `validation.batch_empty`, `validation.batch_invalid`, `validation.batch_too_large`, `validation.cursor_filters_mismatch`, `validation.cursor_invalid`, `validation.duplicate_recipient`, `validation.failed`, `validation.invalid_attachment`, `validation.limit_below_usage`, `validation.limit_exceeds_capacity`, `validation.overage_cap_unavailable_on_free`, `validation.request_invalid`, `validation.workspace_header_conflict`, `validation.workspace_header_invalid`, `validation.workspace_header_required`, `workspace.name_taken`, `workspace.not_found`
- `category` (enum, required) — Coarse error class for client handling (one level above `code`): validation / authentication / authorization / not_found / conflict / rate_limit / billing / upstream / server.
  - Allowed values: `validation`, `authentication`, `authorization`, `not_found`, `conflict`, `rate_limit`, `billing`, `upstream`, `server`
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `invalid_params` (list of ValidationIssue, optional, nullable) — Request fields that failed validation; present on field-scoped errors, else omitted.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

### 404 Not Found Error

Not Found

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Stable machine-readable error key to match on. Full catalog: `GET /errors`.
  - Allowed values: `api_key.not_found`, `app.internal_error`, `auth.dashboard_session_required`, `auth.forbidden`, `auth.platform_credential_required`, `auth.provider_unavailable`, `auth.unauthorized`, `billing.daily_cap_reached`, `billing.outstanding_invoice`, `billing.overage_cap_reached`, `billing.payment_method_required`, `billing.plan_quota_exhausted`, `billing.provider_error`, `billing.suspended`, `billing.workspace_limit_exceeded`, `domain.already_exists`, `error_type.not_found`, `idempotency.body_mismatch`, `idempotency.conflict`, `message.body_unavailable`, `message.injection_failed`, `message.not_found`, `pat.name_taken`, `pat.not_found`, `rate_limit.exceeded`, `resource.conflict`, `resource.not_found`, `validation.attachment_too_large`, `validation.attachment_url_forbidden`, `validation.batch_empty`, `validation.batch_invalid`, `validation.batch_too_large`, `validation.cursor_filters_mismatch`, `validation.cursor_invalid`, `validation.duplicate_recipient`, `validation.failed`, `validation.invalid_attachment`, `validation.limit_below_usage`, `validation.limit_exceeds_capacity`, `validation.overage_cap_unavailable_on_free`, `validation.request_invalid`, `validation.workspace_header_conflict`, `validation.workspace_header_invalid`, `validation.workspace_header_required`, `workspace.name_taken`, `workspace.not_found`
- `category` (enum, required) — Coarse error class for client handling (one level above `code`): validation / authentication / authorization / not_found / conflict / rate_limit / billing / upstream / server.
  - Allowed values: `validation`, `authentication`, `authorization`, `not_found`, `conflict`, `rate_limit`, `billing`, `upstream`, `server`
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `invalid_params` (list of ValidationIssue, optional, nullable) — Request fields that failed validation; present on field-scoped errors, else omitted.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

### 422 Unprocessable Entity Error

Unprocessable Entity

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Always `validation.request_invalid` for a schema-validation failure.
  - Allowed values: `validation.request_invalid`
- `category` (enum, required) — Always `validation` for a schema-validation failure.
  - Allowed values: `validation`
- `invalid_params` (list of ValidationIssue, required) — The request fields that failed schema validation.
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

### 429 Too Many Requests Error

Too Many Requests

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Stable machine-readable error key to match on. Full catalog: `GET /errors`.
  - Allowed values: `api_key.not_found`, `app.internal_error`, `auth.dashboard_session_required`, `auth.forbidden`, `auth.platform_credential_required`, `auth.provider_unavailable`, `auth.unauthorized`, `billing.daily_cap_reached`, `billing.outstanding_invoice`, `billing.overage_cap_reached`, `billing.payment_method_required`, `billing.plan_quota_exhausted`, `billing.provider_error`, `billing.suspended`, `billing.workspace_limit_exceeded`, `domain.already_exists`, `error_type.not_found`, `idempotency.body_mismatch`, `idempotency.conflict`, `message.body_unavailable`, `message.injection_failed`, `message.not_found`, `pat.name_taken`, `pat.not_found`, `rate_limit.exceeded`, `resource.conflict`, `resource.not_found`, `validation.attachment_too_large`, `validation.attachment_url_forbidden`, `validation.batch_empty`, `validation.batch_invalid`, `validation.batch_too_large`, `validation.cursor_filters_mismatch`, `validation.cursor_invalid`, `validation.duplicate_recipient`, `validation.failed`, `validation.invalid_attachment`, `validation.limit_below_usage`, `validation.limit_exceeds_capacity`, `validation.overage_cap_unavailable_on_free`, `validation.request_invalid`, `validation.workspace_header_conflict`, `validation.workspace_header_invalid`, `validation.workspace_header_required`, `workspace.name_taken`, `workspace.not_found`
- `category` (enum, required) — Coarse error class for client handling (one level above `code`): validation / authentication / authorization / not_found / conflict / rate_limit / billing / upstream / server.
  - Allowed values: `validation`, `authentication`, `authorization`, `not_found`, `conflict`, `rate_limit`, `billing`, `upstream`, `server`
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `invalid_params` (list of ValidationIssue, optional, nullable) — Request fields that failed validation; present on field-scoped errors, else omitted.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

### 500 Internal Server Error

Internal Server Error

- `type` (string, required) — Dereferenceable URL to this error's entry in the public /errors catalog.
- `title` (string, required) — Human-readable summary of the error code (constant per `code`).
- `status` (integer, required) — HTTP status code, determined by `code`.
- `code` (enum, required) — Stable machine-readable error key to match on. Full catalog: `GET /errors`.
  - Allowed values: `api_key.not_found`, `app.internal_error`, `auth.dashboard_session_required`, `auth.forbidden`, `auth.platform_credential_required`, `auth.provider_unavailable`, `auth.unauthorized`, `billing.daily_cap_reached`, `billing.outstanding_invoice`, `billing.overage_cap_reached`, `billing.payment_method_required`, `billing.plan_quota_exhausted`, `billing.provider_error`, `billing.suspended`, `billing.workspace_limit_exceeded`, `domain.already_exists`, `error_type.not_found`, `idempotency.body_mismatch`, `idempotency.conflict`, `message.body_unavailable`, `message.injection_failed`, `message.not_found`, `pat.name_taken`, `pat.not_found`, `rate_limit.exceeded`, `resource.conflict`, `resource.not_found`, `validation.attachment_too_large`, `validation.attachment_url_forbidden`, `validation.batch_empty`, `validation.batch_invalid`, `validation.batch_too_large`, `validation.cursor_filters_mismatch`, `validation.cursor_invalid`, `validation.duplicate_recipient`, `validation.failed`, `validation.invalid_attachment`, `validation.limit_below_usage`, `validation.limit_exceeds_capacity`, `validation.overage_cap_unavailable_on_free`, `validation.request_invalid`, `validation.workspace_header_conflict`, `validation.workspace_header_invalid`, `validation.workspace_header_required`, `workspace.name_taken`, `workspace.not_found`
- `category` (enum, required) — Coarse error class for client handling (one level above `code`): validation / authentication / authorization / not_found / conflict / rate_limit / billing / upstream / server.
  - Allowed values: `validation`, `authentication`, `authorization`, `not_found`, `conflict`, `rate_limit`, `billing`, `upstream`, `server`
- `detail` (string, optional, nullable) — Human-readable explanation of this error (constant per `code`); omitted when `title` says it all.
- `request_id` (string, optional, nullable) — Correlation id of the request, for support.
- `instance` (string, optional, nullable) — Path of the request that produced this error.
- `invalid_params` (list of ValidationIssue, optional, nullable) — Request fields that failed validation; present on field-scoped errors, else omitted.
- `state_errors` (list of StateError, optional, nullable) — Resource-state preconditions that failed; present on state-scoped errors, else omitted.

## Types

### DeliveryBreakdown

One recipient's copy in a message response — no internal per-delivery id. ``role``/``status`` are closed enums (validated at runtime), so generated SDKs get real enum types and can exhaustively switch on delivery state.

- `address` (string, required) — The recipient address this delivery is for, without any display name.
- `role` (enum, required) — Which channel the address was given on.
  - Allowed values: `to`, `cc`, `bcc`
- `status` (enum, required) — This recipient's own delivery status.
  - Allowed values: `accepted`, `queued`, `delivered`, `bounced`, `deferred`, `failed`

### AttachmentMeta

Attachment metadata surfaced on the message (GET). Bytes are pass-through and never stored, so only the descriptor is retained.

- `filename` (string, required) — Name as sent.
- `content_type` (string, required) — MIME type as sent.
- `size` (integer, required) — Size in bytes of the attached file.

### DeliveryEventResponse

One timeline entry of the message detail view (across all its deliveries).

- `id` (string, required) — Identifier of this timeline entry.
- `type` (enum, required) — What happened. `accepted` (we took the message), `queued` (handed off for delivery), `delivered` (the recipient's provider accepted it), `deferred` (temporarily refused, still retrying), `bounced` (permanently refused) or `failed` (retries exhausted). Treat an unrecognised value as 'no status change' rather than an error.
  - Allowed values: `accepted`, `queued`, `delivered`, `bounced`, `deferred`, `failed`
- `created_at` (datetime, required) — When the event happened (RFC 3339, UTC).
- `object` ("delivery_event", optional, default: delivery_event) — Always `delivery_event`.
- `address` (string, optional, nullable) — The recipient this entry belongs to; `null` for an entry that is not tied to one address.

### ValidationIssue

One failed field — an entry of the ``invalid_params`` array (a request field the caller can fix). Shared by schema-validation failures (pydantic) and field-scoped business rules (e.g. a duplicate recipient), so the two cannot drift in shape.

- `field` (string, required) — Path of the request field that failed, e.g. `to`, `attachments[0]`.
- `message` (string, required) — Human-readable explanation of this field error (safe to surface in a UI).
- `kind` (string, required) — Machine-readable CAUSE token (finer than the error `code`): a pydantic type (`missing`, `string_too_long`, `value_error`) for a schema failure, or a business cause — `duplicate`, `invalid_base64`, `unsupported_scheme`, `missing_host`, `unresolvable_host`, `private_address`, `size_exceeded`, `plan_restricted`. Branch on this, not `message`.

### StateError

One failed resource-state precondition — an entry of the ``state_errors`` array. Unlike ``invalid_params`` it points at a resource/account state (not a request field), e.g. an unverified sender domain or insufficient credits.

- `resource` (string, required) — The resource whose state blocked the request, e.g. `sender_domain`.
- `message` (string, required) — Human-readable explanation of the state problem (safe to surface in a UI).
- `kind` (string, required) — Machine-readable CAUSE token (finer than the error `code`), e.g. `unverified`.
- `resource_id` (string, optional, nullable) — Identifier of that resource, e.g. `example.com`.

## Examples

**Response**

```json
{
  "id": "msg_01M4ANAVD7EYMHY0PWSH5PBDJD",
  "status": "accepted",
  "from": "string",
  "workspace_id": "ws_01KYA3AWSZGCB9YMNKM5AQBA8G",
  "created_at": "2024-01-15T09:30:00Z",
  "object": "message",
  "subject": "string",
  "deliveries": [
    {
      "address": "billing@rray.app",
      "role": "to",
      "status": "accepted"
    }
  ],
  "attachments": [
    {
      "filename": "invoice-1042.pdf",
      "content_type": "application/pdf",
      "size": 20480
    }
  ],
  "events": [
    {
      "id": "evt_01M4ANAVDNW22V8M1EHEPQJ8DM",
      "type": "accepted",
      "created_at": "2024-01-15T09:30:00Z",
      "object": "delivery_event",
      "address": "billing@rray.app"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.rray.app/v1/messages/message_id"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.rray.app/v1/messages/message_id';
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);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.rray.app/v1/messages/message_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.rray.app/v1/messages/message_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.rray.app/v1/messages/message_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.rray.app/v1/messages/message_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.rray.app/v1/messages/message_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.rray.app/v1/messages/message_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```