# Aliases

Use Aliases to assign unique codes to Accounts, i.e iBAN number, or to Identities, i.e phone number.  You can assign multiple Aliases to a single Account or identity. Each Alias can be assigned only once. Both Account and Identity cannot share the same Alias. &#x20;

{% hint style="info" %}
IMPORTANT: Both Accounts and Identities share the same realm-wide alias directory.
{% endhint %}

## Account Aliases

To create Alias for account you must add `type: "account"` in your Request.

{% tabs %}
{% tab title="cURL" %}

```shell
echo 'create account alias'

curl --location --request POST 'https://api.orangepill.cloud/v1/aliases' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json'
--data-raw '{
    "alias": "IBAN1234567890",
    "type": "account",
    "account": "daeb815cb436563ab92d694b",
    "data": {
        "field1": "value1"
    },
}'
```

{% endtab %}
{% endtabs %}

In response you will get new Alias.

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "id": "63ab92d694bdaeb815cb4365",
    "alias": "IBAN1234567890",
    "type": "account",
    "account": "daeb815cb436563ab92d694b",
    "data": {
        "field1": "value1"
    },
    "owner": "639675ab191e9023f356dfa6",
    "created_at": 1672188630240,
    "error": null,
    "deleted": false

}
</code></pre>

## Identity Aliases

To create Alias for account you must add `type: "identity"` in your Request.

{% tabs %}
{% tab title="cURL" %}

```shell
echo 'create identity alias'

curl --location --request GET 'https://api.orangepill.cloud/v1/aliases' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json'
--data-raw '{
    "alias": "+11234567890",
    "type": "identity",
    "identity": "daeb815cb436563ab92d694b",
    "data": {
        "field1": "value1"
    },
}'
```

{% endtab %}
{% endtabs %}

In response you will get new alias.

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "id": "63ab92d694bdaeb815cb4365",
    "alias": "+11234567890",
    "type": "identity",
    "identity": "daeb815cb436563ab92d694b",
    "data": {
        "field1": "value1"
    },
    "owner": "639675ab191e9023f356dfa6",
    "created_at": 1672188630240,
    "error": null,
    "deleted": false

}
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.orangepill.cloud/orangepill-api/aliases.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
