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

# Prepare Application authorization

> Prepare a domain or linked DID change for a registered Application

An active Application's control DID can register a domain for `Call` or authorize a linked DID as a `Send` target. The Application must already exist in finalized state.

## Request

<ParamField path="applicationId" type="string" required>
  Registered Application ID.
</ParamField>

<ParamField body="action" type="string" required>
  `set_domain` or `set_linked_did`.
</ParamField>

<ParamField body="control_signer_key_id" type="string" required>
  Verification-method ID under the Application's control DID.
</ParamField>

For `set_domain`, supply `domain`, a canonical DNS name. It must be backed by an active DNS-verified Persona under the same control DID before a `Call` can execute. A `null` domain clears the registered domain.

For `set_linked_did`, supply an active `linked_did`, its `linked_signer_key_id`, and a Boolean `enabled`. Both DID owners must sign the prepared payload for submission. `enabled: false` removes the authorization.

```bash theme={null}
curl --request POST \
  --url "https://directory.example.com/applications/example/authorization/prepare" \
  --header "Content-Type: application/json" \
  --data '{"action":"set_linked_did","control_signer_key_id":"did:openpayload:1111111111111111111111#signing","linked_did":"did:openpayload:2222222222222222222222","linked_signer_key_id":"did:openpayload:2222222222222222222222#signing","enabled":true}'
```

The `200` response supplies the current `nonce` and `canonical_payload` as `0x`-prefixed hexadecimal, along with the normalized action fields. Decode and sign the exact payload bytes locally. Continue with [Submit Application authorization](/api-reference/directory/applications/authorize).

## Straight to the point

```text theme={null}
POST /applications/{applicationId}/authorization/prepare
Actions: set_domain or set_linked_did
Success: 200 with nonce and canonical_payload
```


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