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

# Add an alias

> Add a public alias to a DID.

Add a public alias to a DID.

An alias is a human-friendly public name. It does not replace the DID and must not be used as the cryptographic identity without resolving it first.

## Path parameters

<ParamField path="did" type="string" required>
  The DID that owns the alias.
</ParamField>

## Request body

<ParamField body="did" type="string" required>
  The DID that owns the alias. It must match the path.
</ParamField>

<ParamField body="action" type="string" required>
  The operation name. Use `add_alias`.
</ParamField>

<ParamField body="alias" type="string" required>
  The lowercase alias to add. It cannot contain `@` or `#`; those characters are reserved for delivery-target and DID-document syntax.
</ParamField>

<ParamField body="nonce" type="string" required>
  The request nonce.
</ParamField>

<ParamField body="valid_until" type="string" required>
  The authorization expiration as an ISO-8601 timestamp or unsigned Unix-millisecond string. The canonical payload encodes it as `u64` milliseconds.
</ParamField>

<ParamField body="signer_key_id" type="string">
  The public signing-key identifier. Defaults to `root`.
</ParamField>

<ParamField body="canonical_payload" type="string" required>
  The canonical SCALE `AliasAuthorizationPayload`, encoded as `0x`-prefixed hex or Base64.
</ParamField>

<ParamField body="signature" type="string" required>
  The authorization signature.
</ParamField>

<RequestExample>
  ```bash Request theme={null}
  curl --request POST \
    --url "https://directory.example.com/dids/did%3Aopenpayload%3A1111111111111111111111/aliases" \
    --header "Content-Type: application/json" \
    --data '{
    "did": "did:openpayload:1111111111111111111111",
    "action": "add_alias",
    "alias": "river.stone",
    "nonce": "<nonce>",
    "valid_until": "<future-epoch-milliseconds>",
    "signer_key_id": "root",
    "canonical_payload": "<payload>",
    "signature": "<signature>"
  }'
  ```
</RequestExample>

## Response

<ResponseField name="status" type="string" required>The submission status.</ResponseField>
<ResponseField name="did" type="string" required>The affected DID.</ResponseField>
<ResponseField name="action" type="string" required>The alias operation.</ResponseField>
<ResponseField name="tx_hash" type="string" required>The transaction hash.</ResponseField>
<ResponseField name="message" type="string" required>A human-readable submission result.</ResponseField>

<ResponseExample>
  ```json 202 Response theme={null}
  {
    "status": "accepted",
    "did": "did:openpayload:1111111111111111111111",
    "action": "add_alias",
    "alias": "river.stone",
    "tx_hash": "<transaction-hash>",
    "message": "Alias update submitted"
  }
  ```
</ResponseExample>

<Note>
  `202 Accepted` means the Directory accepted the request for processing. It does not confirm final settlement.
</Note>

## Straight to the point

* Method: `POST`
* Action: `add_alias`
* Alias normalization: lowercase, maximum 64 characters
* Reserved characters: `@` and `#` are prohibited
* Signed payload: canonical SCALE alias authorization bytes


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