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

# Set DID delivery constraints

> Publish clock-time retention, message, chunk, and replica limits for a DID

Set the delivery limits controlled by a DID operator. A policy rule may narrow these values but cannot increase them.

This mutation uses an authorized DID proof and the current Policy V2 `policy_nonce`. See [Authorize a Directory update](/guides/authorization).

## Request

<ParamField path="did" type="string" required>
  The URL-encoded DID. It must equal the signed body `did`.
</ParamField>

<ParamField body="delivery_constraints" type="object" required>
  Requested delivery limits. Active values must be positive and at or below their network maxima.
</ParamField>

<ParamField body="delivery_constraints.requested_cache_seconds" type="integer" required>
  Operator-requested Cache retention in clock-time seconds, stored as a positive `u32`. The chain preserves this request but derives an effective maximum of `172800` seconds.
</ParamField>

<ParamField body="delivery_constraints.max_http_envelope_bytes" type="integer" required>
  Maximum raw HTTP request envelope. Maximum `26214400`.
</ParamField>

<ParamField body="delivery_constraints.max_unchunked_message_bytes" type="integer" required>
  Maximum decoded encrypted message sent without chunking. Maximum `16777216`.
</ParamField>

<ParamField body="delivery_constraints.max_chunk_bytes" type="integer" required>
  Maximum decoded bytes in one chunk. Maximum `2097152`.
</ParamField>

<ParamField body="delivery_constraints.max_message_bytes" type="integer">
  Deprecated Policy V2 wire-compatibility field. Omit it. The Directory encodes the unbounded compatibility sentinel `4294967295`.
</ParamField>

<ParamField body="delivery_constraints.max_chunks" type="integer">
  Deprecated Policy V2 wire-compatibility field. Omit it. The Directory encodes the unbounded compatibility sentinel `65535`.
</ParamField>

<ParamField body="delivery_constraints.max_replicas" type="integer" required>
  Maximum Cache replicas. Maximum `4`.
</ParamField>

Omit `effective_ttl_seconds`; it is chain-derived and read-only. The active byte limits must satisfy the consistency rules described in [Delivery policies](/concepts/delivery-policies#constraints-and-network-ceilings).

<RequestExample>
  ```bash Request theme={null}
  curl --request PUT \
    --url "https://directory.example.com/dids/did%3Aopenpayload%3A1111111111111111111111/delivery-constraints" \
    --header "Content-Type: application/json" \
    --data '{
      "did": "did:openpayload:1111111111111111111111",
      "action": "set_did_delivery_constraints",
      "delivery_constraints": {
        "requested_cache_seconds": 86400,
        "max_http_envelope_bytes": 26214400,
        "max_unchunked_message_bytes": 16777216,
        "max_chunk_bytes": 2097152,
        "max_replicas": 2
      },
      "nonce": "<policy-nonce>",
      "valid_until": "<epoch-milliseconds>",
      "signer_key_id": "did:openpayload:1111111111111111111111#keys-1",
      "canonical_payload": "<encoded-scale-payload>",
      "signature": "<base64-ed25519-signature>"
    }'
  ```
</RequestExample>

## Response

```json 202 Response theme={null}
{
  "status": "accepted",
  "did": "did:openpayload:1111111111111111111111",
  "extrinsic": "set_did_delivery_constraints",
  "tx_hash": "<transaction-hash>",
  "message": "Chain extrinsic submitted"
}
```

`202 Accepted` confirms submission for processing, not final settlement. Read the constraints from finalized state before relying on them.

## Straight to the point

```http theme={null}
PUT /dids/{url-encoded-did}/delivery-constraints
```

* Proof: authorized DID key
* Action: `set_did_delivery_constraints`
* Nonce: Policy V2 `policy_nonce`
* Above-network active byte or replica values: `400 invalid_delivery_constraints`
* TTL above 48 hours: accepted as requested, effective value clamped to 48 hours
* Accepted submission: `202`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.