> ## Documentation Index
> Fetch the complete documentation index at: https://docs.talaria.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# Store an encrypted message

> Ask a Cache node to temporarily retain one policy-compliant DDN envelope

This endpoint stores the same encrypted [DDN envelope](/guides/ddn-envelope) accepted by a Relay. The Cache validates the outer format and public policy without decrypting the message.

Storage is allowed only when the recipient exists, is active, permits Cache use, permits the message tag, and lists this Cache endpoint in an appropriate public service.

## Request

<RequestExample>
  ```bash Request theme={null}
  curl --request POST \
    --url "https://cache.example.com/cache/store" \
    --header "Content-Type: application/json" \
    --data '{
      "message_id": "9f8d6f08-bce5-4df5-b22b-bf8c6bd4e143",
      "to": "did:talaria:1111111111111111111111",
      "timestamp": "2026-07-24T16:30:00Z",
      "ttl": "24h",
      "payload": {"ciphertext_b64":"<encrypted-message>"},
      "encrypted_header": "<base64-encrypted-header>",
      "header_nonce": "<base64-nonce>",
      "header_key_id": "recipient-key-1",
      "schema_version": "1"
    }'
  ```
</RequestExample>

## Response

<ResponseField name="accepted" type="boolean" required>
  `true` when the envelope is accepted.
</ResponseField>

<ResponseField name="deduped" type="boolean" required>
  `true` when this Cache already held the same message ID.
</ResponseField>

<ResponseField name="expires_at" type="string" required>
  ISO-8601 expiration calculated from the message timestamp and applied TTL.
</ResponseField>

<ResponseField name="max_ttl" type="string" required>
  Maximum duration allowed by recipient and participation policy.
</ResponseField>

<ResponseField name="applied_ttl" type="string" required>
  Duration applied to this entry.
</ResponseField>

<ResponseExample>
  ```json 202 Response theme={null}
  {
    "accepted": true,
    "deduped": false,
    "message_id": "9f8d6f08-bce5-4df5-b22b-bf8c6bd4e143",
    "recipient": "did:talaria:1111111111111111111111",
    "expires_at": "2026-07-25T16:30:00Z",
    "max_ttl": "PT24H",
    "applied_ttl": "PT24H",
    "chunked": false,
    "proof": {
      "event_type": "delivery",
      "message_id": "9f8d6f08-bce5-4df5-b22b-bf8c6bd4e143",
      "recipient_did": "did:talaria:1111111111111111111111",
      "timestamp": "2026-07-24T16:30:01Z",
      "reason": null,
      "signature": null
    }
  }
  ```
</ResponseExample>

## Straight to the point

```http theme={null}
POST /cache/store
Content-Type: application/json

<encrypted DDN envelope>
```

* Accepted: `202`
* Same `message_id`: accepted with `deduped: true`
* Expired or policy-ineligible: rejected
