> For the complete documentation index, see [llms.txt](https://docs.ltonetwork.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ltonetwork.com/node/identity-node/rest-api.md).

# REST API

{% hint style="info" %}
In the following examples, replace`https://lto.example.com` with the domain or IP address of **your** node.&#x20;
{% endhint %}

### Authorization

A node can be configured with an authorization token. This can be done in case the api of the node is exposed publicly. Once the token is configured the anchoring of hash on the chain requires an authorization header

```
Authorization: bearer <token>
```

## Decentralized identifiers (DID)

## Resolve DID

<mark style="color:blue;">`GET`</mark> `https://lto.example.com/identities/:address`

Resolve a DID into a DID document

#### Path Parameters

| Name    | Type   | Description        |
| ------- | ------ | ------------------ |
| address | string | DID or LTO address |

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

```
```

{% endtab %}
{% endtabs %}

## Resolve derived DID

<mark style="color:blue;">`GET`</mark> `https://lto.example.com/identities/:address/derived/:secret`

#### Path Parameters

| Name    | Type   | Description                  |
| ------- | ------ | ---------------------------- |
| address | string | DID or LTO address           |
| secret  | string | Base58 encoded random secret |

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

```
```

{% endtab %}
{% endtabs %}

## Trust network

## Get all the roles of an identity

<mark style="color:blue;">`GET`</mark> `https://lto.example.com/trust/:address`

Resolves the roles from an identity

#### Query Parameters

| Name    | Type   | Description                        |
| ------- | ------ | ---------------------------------- |
| address | string | Account's address in Base58 format |

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

```
{
  "roles": [
    "authority",
    "notary"
  ],
  "issues_roles": [
    { "type": 100, "role": "notary" }
  ],
  "issues_authorization": [
    "https://www.w3.org/2018/credentials/examples/v1"
  ]
}
```

{% endtab %}

{% tab title="400 " %}

```
{
  "error": "invalid address"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ltonetwork.com/node/identity-node/rest-api.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
