> For the complete documentation index, see [llms.txt](https://docs.fetcch.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fetcch.xyz/how-to-integrate/guides/identity/how-to-create-identity.md).

# How to create identity?

Process of creating an identity

### Arrange Identity

Arrange identity in the format

```json
{
  "id": "string",
  "identifier": "string",
  "provider": "string",
  "default": {
    "address": "address",
    "chain": number,
    "isMultisig": boolean,
    "isSmartContractWallet": boolean
  },
  "secondary": [
    {
      "address": "address",
      "chain": number,
      "isMultisig": boolean,
      "isSmartContractWallet": boolean
    },
    {
      "address": "address",
      "chain": number,
      "isMultisig": boolean,
      "isSmartContractWallet": boolean
    }
  ]
}

```

### Generate Message

Using the above arranged identity, generate a message using the below endpoint and sign it using `default` address by following [guide for respective chains](/how-to-integrate/guides/utility.md)

{% openapi src="/files/xjcYh3sZCi10eHJaNA7T" path="/identity/generate-message" method="post" %}
[openapi.yml](https://2219691098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxaHazojZlIts4pidXQC6%2Fuploads%2FfnFyuZwzFVn93GBdO4kv%2Fopenapi.yml?alt=media\&token=7e1414fc-c6b1-4244-9549-9bb061a79cc5)
{% endopenapi %}

After generating message, you need to sign `message` using appropriate functions for respective chains, check our guide for each blockchain [here](/how-to-integrate/guides/utility.md)

### Create Identity

After signing the message, add the generated signature in the [arranged identity](#arrange-identity), at `currentSignature`

Now, data should look something like this

```json
{
  "id": "string",
  "identifier": "string",
  "provider": "string",
  "default": {
    "address": "address",
    "chain": number,
    "isMultisig": boolean,
    "isSmartContractWallet": boolean
  },
  "secondary": [
    {
      "address": "address",
      "chain": number,
      "isMultisig": boolean,
      "isSmartContractWallet": boolean
    },
    {
      "address": "address",
      "chain": number,
      "isMultisig": boolean,
      "isSmartContractWallet": boolean
    }
  ],
  "currentSignature": "string"
}
```

Call **Create Identity** API

#### Important Note

If `default` chain is `APTOS`, then while calling this API, swap `default` address with public key of the same address, so that we can easily verify signatures

{% openapi src="/files/xjcYh3sZCi10eHJaNA7T" path="/identity" method="post" %}
[openapi.yml](https://2219691098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxaHazojZlIts4pidXQC6%2Fuploads%2FfnFyuZwzFVn93GBdO4kv%2Fopenapi.yml?alt=media\&token=7e1414fc-c6b1-4244-9549-9bb061a79cc5)
{% endopenapi %}

Identity should now be created, if faced with any error, check our [troubleshooting guide](/how-to-integrate/api-reference/troubleshooting-errors.md) or ask in our discord

### Resolve Identity

{% openapi src="/files/xjcYh3sZCi10eHJaNA7T" path="/identity" method="get" %}
[openapi.yml](https://2219691098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxaHazojZlIts4pidXQC6%2Fuploads%2FfnFyuZwzFVn93GBdO4kv%2Fopenapi.yml?alt=media\&token=7e1414fc-c6b1-4244-9549-9bb061a79cc5)
{% endopenapi %}


---

# 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.fetcch.xyz/how-to-integrate/guides/identity/how-to-create-identity.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.
