> ## 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.

# Resolve a delivery policy

> Ask the Directory for the chain-selected winning rule and effective constraints

Resolve the delivery behavior for one recipient, optional Persona, and optional tag. The Directory queries finalized chain state and returns the deterministic winning rule rather than reproducing priority logic locally.

The response provides the decision used for original client messages and ordinary DID-service fall-through. One applied decision remains fixed for that delivery attempt. Compatible clients can also call this endpoint to identify limits before submitting a large encrypted payload.

## Request

<ParamField body="recipient" type="string" required>
  Canonical recipient DID. Resolve an alias before calling this endpoint.
</ParamField>

<ParamField body="persona" type="string">
  Persona parsed from the optional `@persona` target suffix.
</ParamField>

<ParamField body="tag" type="string">
  Exact public top-level envelope tag. Tags are case-sensitive.
</ParamField>

<RequestExample>
  ```bash Request theme={null}
  curl --request POST \
    --url "https://directory.example.com/delivery-policies/resolve" \
    --header "Content-Type: application/json" \
    --data '{
      "recipient": "did:openpayload:1111111111111111111111",
      "persona": "example.com",
      "tag": "Legal"
    }'
  ```
</RequestExample>

## Winning policy response

```json 200 Response theme={null}
{
  "recipient": "did:openpayload:1111111111111111111111",
  "persona": "example.com",
  "tag": "Legal",
  "applied": true,
  "source": "persona",
  "policy_id": "0x<64-hex-policy-id>",
  "policy_revision": 4,
  "policy_ttl_seconds": 60,
  "rule_id": "legal-delivery",
  "action": {
    "type": "DeliveryPlan/v1",
    "entry_step": "inspection",
    "steps": [
      {
        "id": "inspection",
        "operation": "Forward",
        "targets": [
          {
            "service_did": "did:openpayload:1111111111111111111111",
            "service_id": "did:openpayload:1111111111111111111111#inspection",
            "priority": 100,
            "weight": 100
          }
        ]
      }
    ],
    "transitions": []
  },
  "effective_constraints": {
    "requested_cache_seconds": 7200,
    "effective_ttl_seconds": 7200,
    "max_http_envelope_bytes": 12582912,
    "max_unchunked_message_bytes": 8388608,
    "max_chunk_bytes": 1048576,
    "max_message_bytes": 4294967295,
    "max_chunks": 65535,
    "max_replicas": 2
  },
  "block_number": 123456,
  "block_hash": "0x<finalized-block-hash>"
}
```

`source` is `persona` or `did` when a rule wins.

## Fall-through response

A valid recipient with no matching rule still returns `200`:

```json 200 Response theme={null}
{
  "recipient": "did:openpayload:1111111111111111111111",
  "persona": null,
  "tag": null,
  "applied": false,
  "source": "none",
  "effective_constraints": {
    "requested_cache_seconds": 172800,
    "effective_ttl_seconds": 172800,
    "max_http_envelope_bytes": 26214400,
    "max_unchunked_message_bytes": 16777216,
    "max_chunk_bytes": 2097152,
    "max_message_bytes": 4294967295,
    "max_chunks": 65535,
    "max_replicas": 4
  },
  "block_number": 123456,
  "block_hash": "0x<finalized-block-hash>"
}
```

`applied: false` instructs a Relay to use ordinary DID services. It is not equivalent to a failed lookup.

Fall-through does not discard scope limits. `effective_constraints` remains the network-clamped minimum of the recipient DID constraints and, when addressed, the active Persona constraints.

`max_message_bytes` and `max_chunks` are deprecated Policy V2 compatibility fields. Their sentinel values mean the resolver does not impose an aggregate-size or group-cardinality limit.

## Errors

| Status | Meaning |
| - | - |
| `400` | Malformed recipient, Persona, tag, or request body |
| `404` | Recipient DID or supplied Persona does not exist |
| `409` | Persona is revoked, expired, or not active for resolution |
| `502` | Finalized chain state could not be queried |

Do not treat `409` or `502` as a policy-free result.

## Straight to the point

```http theme={null}
POST /delivery-policies/resolve
Content-Type: application/json
```

* Authentication: none
* Selection: Persona rule, then DID rule, then no-policy fall-through
* State: finalized block identified in the response
* No matching policy: `200` with `applied: false`


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