> ## 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 a Persona delivery policy

> Create or replace the ordered routing rules owned by a registered Persona

Create or replace the policy for an active Persona with one active Persona-controller signature. Persona v1 fixes `controller_threshold` at `1`; multi-signature threshold authorization is reserved for a future contract.

The policy `scope.id` is the canonical DNS Persona, not a DID. Rules can narrow the Persona's constraints and match a tag, recipient DID, or both.

## Request

<ParamField path="persona" type="string" required>
  The registered Persona. It must equal `policy.scope.id` after normalization.
</ParamField>

<ParamField body="policy.policy_id" type="string" required>
  Deterministic 32-byte policy identifier encoded as `0x` plus 64 hexadecimal characters.
</ParamField>

<RequestExample>
  ```bash Request theme={null}
  curl --request PUT \
    --url "https://directory.example.com/delivery-policies/personas/example.com" \
    --header "Content-Type: application/json" \
    --data '{
      "persona": "example.com",
      "action": "set_persona_policy_v2",
      "policy": {
        "policy_id": "0x<64-hex-policy-id>",
        "scope": {"type":"PERSONA","id":"example.com"},
        "revision": 4,
        "operator_did": "did:openpayload:1111111111111111111111",
        "ruleset": [
          {
            "id": "legal-delivery",
            "priority": 100,
            "conditions": [
              {"type":"TagEquals","value":"Legal"}
            ],
            "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": []
            }
          }
        ]
      },
      "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": "example.com",
  "extrinsic": "apply_policy_v2_with_proof",
  "tx_hash": "<transaction-hash>",
  "message": "Chain extrinsic submitted"
}
```

## Straight to the point

```http theme={null}
PUT /delivery-policies/personas/{persona}
```

* Persona must be active
* Action: `set_persona_policy_v2`
* Revision: `1` on creation, otherwise finalized revision plus one
* Authorization: one active Persona controller in Persona v1
* Complete create or replacement
* Invalid graph, incompatible service, or non-public route endpoint: `400 invalid_delivery_policy`
* Accepted submission: `202`


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