# Identities

The following endpoints are used to insert and retrieve entries representing `identities` from the database.

* [Create identity](#create-an-identity)
* [Get an identity](#get-an-identity)
* [Get an identity document presign url](#get-identity-document-presign-url)
* [Get identities](#get-identities)
* [Update an identity](#update-an-identity)
* [Delete an identity](#delete-an-identity)
* [Get operations](#get-operations)

## The `identity` object

The `identity` object represents the identity of an individual (or company) in the database.&#x20;

#### Identity entity model

| Name              |    Type    | Description                             | Constraints                 |
| ----------------- | :--------: | --------------------------------------- | --------------------------- |
| address           |  `Object`  | Address information.                    | `Not Null`                  |
| appId             |  `String`  | Application ID. Format: `uuid`.         | `Not Null`                  |
| birthday          |  `String`  | Identity birthday. Format: `Date`.      | `Between 18 and 99 years`   |
| blocked           |  `Boolean` | Identity blocked status.                | `Not Null`                  |
| createdAt         | `DateTime` | Identity created at date.               | `Not Null`                  |
| email             |  `String`  | Identity email. Format: `email`         | `Not Null`                  |
| gender            |  `String`  | Identity gender.                        | `[male, female, undefined]` |
| id                |  `String`  | Identity identifier. Format: `uuid`.    | `Not Null`                  |
| identityConfirmed |  `Boolean` | Identity with info confirmed.           | `Not Null`                  |
| identityOwner     |  `String`  | Identity company owner. Format: `uuid`. | `Nullable`                  |
| name              |  `String`  | Identity name.                          | `Not Null`                  |
| phone             |  `Object`  | Identity phone information.             | `Not Null`                  |
| tax               |  `Object`  | Identity tax information.               | `Not Null`                  |
| type              |  `String`  | Identity type.                          | `[person, company]`         |
| kycStatus         |   `Array`  | Identity kyc information.               |                             |
| updatedAt         | `DateTime` | Identity updated at date.               | `Not Null`                  |

#### Address information <a href="#user-content-address-information" id="user-content-address-information"></a>

| Name       |   Type   | Description           | Constraints                   |
| ---------- | :------: | --------------------- | ----------------------------- |
| city       | `String` | Address city.         | `Not Null`                    |
| country    | `String` | Address country code. | `Not Null`                    |
| postalCode | `String` | Address postalCode.   | `Not Null`                    |
| state      | `String` | Address state.        | `Required when country is US` |
| street     | `String` | Address street.       | `Not Null`                    |

#### Phone information <a href="#user-content-phone-information" id="user-content-phone-information"></a>

| Name   |    Type   | Description        | Constraints |
| ------ | :-------: | ------------------ | ----------- |
| number |  `String` | Phone number.      | `Not Null`  |
| sms    | `Boolean` | Available for sms. | `Not Null`  |

#### Tax information <a href="#user-content-tax-information" id="user-content-tax-information"></a>

| Name            |   Type   | Description               | Constraints                              |
| --------------- | :------: | ------------------------- | ---------------------------------------- |
| country         | `String` | Tax country code.         | `Not Null`                               |
| idNumber        | `String` | Tax id number.            | `Not Null`                               |
| state           | `String` | Tax state.                | `Required when country is US`            |
| formationRegion | `String` | Company formation region. | `Required when identity type is company` |

## Create an identity <a href="#create_an_identity" id="create_an_identity"></a>

## POST /identities

<mark style="color:green;">`POST`</mark> `[ENVIRONMENT HOSTNAME]/identities`

This endpoint allows you to create a new `identity`.&#x20;

### **Request Parameters**

None

### **Body parameters**

| Name          |       Type      | Description                             | Constraints                 |            Required           |
| ------------- | :-------------: | --------------------------------------- | --------------------------- | :---------------------------: |
| address       |     `Object`    | Address information.                    | `Not null`                  |             `true`            |
| birthday      |     `String`    | Identity birthday. Format: `Date`.      | `Between 18 and 99 years`   |  `Required if type is person` |
| documents     |     `Array`     | Identity documents.                     | `Not null`                  |                               |
| faceImages    | `Array[String]` | Identity face images. Format: `uri`     | `Not null`                  |                               |
| email         |     `String`    | Identity email. Format: `email`         | `Not null`                  |             `true`            |
| gender        |     `String`    | Identity gender                         | `[Male, Female, Undefined]` |  `Required if type is person` |
| identityOwner |     `String`    | Identity company owner. Format: `uuid`. |                             | `Required if type is company` |
| name          |     `String`    | Identity name.                          | `Not null`                  |           `Required`          |
| phone         |     `Object`    | Identity phone information.             | `Not null`                  |           `Required`          |
| tax           |     `Object`    | Identity tax information.               | `Not null`                  |           `Required`          |
| type          |     `String`    | Identity type.                          | `Not null`                  |      `[person, company]`      |

#### **Body address parameters**

| Name       |   Type   | Description         | Constraints |           Required          |
| ---------- | :------: | ------------------- | ----------- | :-------------------------: |
| city       | `String` | Address city.       | `Not null`  |            `true`           |
| country    | `String` | Address country.    | `Not null`  |            `true`           |
| postalCode | `String` | Address postal code | `Not null`  |            `true`           |
| state      | `String` | Address state       | `Not null`  | `Required if country is US` |
| street     | `String` | Address street.     | `Not null`  |          `Required`         |

#### **Body documents parameters**

| Name        |   Type   | Description                | Constraints                                                               | Required |
| ----------- | :------: | -------------------------- | ------------------------------------------------------------------------- | :------: |
| description | `String` | Document description.      |                                                                           |          |
| label       | `String` | Document label.            |                                                                           |          |
| side        | `String` | Document side.             | `[FrontSide, BackSide]`                                                   |  `true`  |
| type        | `String` | Document type              | `[DriverLicense,IdentityCard,Other,Passport,ResidencePermit,UtilityBill]` |  `true`  |
| url         | `String` | DocumentUrl. Format: `uri` | `Not null`                                                                |  `true`  |

#### **Body phone parameters**

| Name   |   Type   | Description        | Constraints | Required |
| ------ | :------: | ------------------ | ----------- | :------: |
| number | `String` | Phone number.      | `Not null`  |          |
| sms    | `String` | Available for sms. |             |          |

#### **Body tax parameters**

| Name            |   Type   | Description               | Constraints |            Required           |
| --------------- | :------: | ------------------------- | ----------- | :---------------------------: |
| country         | `String` | Tax country code.         | `Not null`  |             `true`            |
| idNumber        | `String` | Tax id number.            | `Not null`  |             `true`            |
| state           | `String` | Tax state.                | `Not null`  |  `Required if country is US`  |
| formationRegion | `String` | Company formation region. | `Not null`  | `Required if type is company` |

### **Response Options**

**400 Bad Request**

* validation\_failed
  * If the required parameters are not provided.
  * If additional parameters are provided.
  * If some of the parameters type is invalid.
  * If some of the parameters constraints is not respected.
* email\_already\_in\_use

**404 Not Found**

* identity\_owner\_not\_found
  * If a non existent identity owner `id` is provided.

**422 Unprocessable entity**

* identity\_owner\_must\_be\_of\_type\_person
  * If identity owner is not of type person.

**200 OK**

### Example Call

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

```javascript
POST [ENVIRONMENT HOSTNAME]/identities

{
  "address": {
    "city": "Braga",
    "country": "PT",
    "postalCode": "4444-333",
    "state": "Braga",
    "street": "Avenida D. João I,  40"
  },
  "birthday": "2000-11-11",
  "email": "foobar@publicmint.com",
  "gender": "Male",
  "name": "João Pedro Soares",
  "phone": {
    "number": "910000000",
    "sms": false
  },
  "tax": {
    "country": "PT",
    "idNumber": "1111111111",
    "state": "Braga"
  },
  "type": "person",
  "documents": [{
    "description": "ID card",
    "label": "id card",
    "side": "FrontSide",
    "type": "IdentityCard",
    "url": "https://[pmint_aws_s3_bucket].s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"
  }],
  "faceImages": ["https://[pmint_aws_s3_bucket].s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"]
}
```

{% endtab %}

{% tab title="CURL" %}

```bash
curl --location --request POST 'https://api.sandbox.publicmint.io/identities' \
--header 'apiKey: dfQ0ouwt0R14TPd2wxBzKtslWrBN5zfm' \
--header 'Content-Type: application/json' \
--data-raw '{
  "address": {
    "city": "Braga",
    "country": "PT",
    "postalCode": "4444-333",
    "state": "Braga",
    "street": "Avenida D. João I,  40"
  },
  "birthday": "2000-11-11",
  "email": "foobar@publicmint.com",
  "gender": "Male",
  "name": "João Pedro Soares",
  "phone": {
    "number": "910000000",
    "sms": false
  },
  "tax": {
    "country": "PT",
    "idNumber": "1111111111",
    "state": "Braga"
  },
  "type": "person",
  "documents": [{
    "description": "ID card",
    "label": "id card",
    "side": "FrontSide",
    "type": "IdentityCard",
    "url": "https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"
  }],
  "faceImages": ["https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"]
}
'
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "data": {
        "documents": [
            {
                "createdAt": "2022-03-31T13:08:52.049Z",
                "deletedAt": null,
                "description": "ID card",
                "id": "bfca84a4-3e52-4a7d-92da-b17c6a5e59ac",
                "identityId": "38882f21-ce8f-4e18-8b83-e43e082912ef",
                "label": "id card",
                "side": "frontSide",
                "type": "identityCard",
                "updatedAt": "2022-03-31T13:08:52.049Z",
                "url": "https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"
            },
            {
                "createdAt": "2022-03-31T13:08:52.114Z",
                "deletedAt": null,
                "description": null,
                "id": "0b12e957-5643-4943-9eeb-6755c02721e0",
                "identityId": "38882f21-ce8f-4e18-8b83-e43e082912ef",
                "label": null,
                "side": "frontSide",
                "type": "faceImage",
                "updatedAt": "2022-03-31T13:08:52.114Z",
                "url": "https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"
            }
        ],
        "address": {
            "city": "Braga",
            "state": "Braga",
            "street": "Avenida D. João I,  40",
            "country": "PT",
            "postalCode": "4444-333"
        },
        "appId": "80937bc6-9578-45c8-b691-ea6b8a5d17e9",
        "birthday": "2000-11-11",
        "blocked": false,
        "createdAt": "2022-03-31T13:08:52.030Z",
        "email": "foobar@publicmint.com",
        "gender": "Male",
        "id": "38882f21-ce8f-4e18-8b83-e43e082912ef",
        "identityConfirmed": false,
        "identityOwner": null,
        "name": "João Pedro Soares",
        "phone": {
            "sms": false,
            "number": "910000000"
        },
        "tax": {
            "state": "Braga",
            "country": "PT",
            "idNumber": "1111111111"
        },
        "type": "person",
        "updatedAt": "2022-03-31T13:08:52.030Z"
    }
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
On the **Sandbox** environment, you can use the [approve KYC ](/api/sandbox.md#approve-kyc)endpoint to simulate and approve or reject the identity you created.
{% endhint %}

## Get an identity

## GET /identities/:id

<mark style="color:blue;">`GET`</mark> `[ENVIRONMENT HOSTNAME]/identities/:id`

This endpoint retrieves and returns an `identity` owned by you from the database.

### **Request Parameters**

#### **Path parameters**

| Name |   Type   | Description                          | Constraints | Required |
| ---- | :------: | ------------------------------------ | ----------- | :------: |
| id   | `String` | Identity identifier. Format: `uuid`. |             |  `true`  |

### Example Call

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

```javascript
GET [ENVIRONMENT HOSTNAME]/identities/38882f21-ce8f-4e18-8b83-e43e082912ef
```

{% endtab %}

{% tab title="CURL" %}

```
curl --location --request GET 'https://api.sandbox.publicmint.io/identities/38882f21-ce8f-4e18-8b83-e43e082912ef' \
--header 'apiKey: dfQ0ouwt0R14TPd2wxBzKtslWrBN5zfm'
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "data": {
        "address": {
            "city": "Braga",
            "state": "Braga",
            "street": "Avenida D. João I,  40",
            "country": "PT",
            "postalCode": "4444-333"
        },
        "appId": "80937bc6-9578-45c8-b691-ea6b8a5d17e9",
        "birthday": "2000-11-11",
        "blocked": false,
        "createdAt": "2022-03-31T13:08:52.030Z",
        "email": "foobar@publicmint.com",
        "gender": "Male",
        "id": "38882f21-ce8f-4e18-8b83-e43e082912ef",
        "identityConfirmed": false,
        "identityOwner": null,
        "name": "João Pedro Soares",
        "phone": {
            "sms": false,
            "number": "910000000"
        },
        "tax": {
            "state": "Braga",
            "country": "PT",
            "idNumber": "1111111111"
        },
        "type": "person",
        "updatedAt": "2022-03-31T13:08:52.030Z"
    }
}
```

{% endtab %}
{% endtabs %}

## Get identities

## GET /identities

<mark style="color:blue;">`GET`</mark> `[ENVIRONMENT HOSTNAME]/identities`

This endpoint returns a paginated list of all `identities` owned by you.

#### **Available filters**

| Name          |       Type       | Example                              |
| ------------- | :--------------: | ------------------------------------ |
| appId         |     `default`    | `filter[appId]=foobar`               |
| blocked       |     `default`    | `filter[blocked]=true`               |
| email         |  `default,like`  | `filter[email]=like:@publicmint.com` |
| id            |   `id, default`  | `filter[id]=in:foobar`               |
| identityOwner |   `in,default`   | `filter[identityOwner]=biz`          |
| name          |     `default`    | `filter[name]=fred`                  |
| riskRating    | `in,nin,default` | `filter[riskRating]=nin:foo,bar`     |
| type          |     `default`    | `filter[type]=person`                |

#### **Available sorts**

| Name      | Example                                                            |
| --------- | ------------------------------------------------------------------ |
| createdAt | <p><code>sort=createdAt</code><br><code>sort=-createdAt</code></p> |
| updatedAt | <p><code>sort=updatedAt</code><br><code>sort=-updatedAt</code></p> |

#### **Paginate options**

| Name   | Description                                             | Example          |
| ------ | ------------------------------------------------------- | ---------------- |
| size   | Defines the number of results per page. Default = 30.   | `page[size]=2`   |
| number | Defines the number of the page to retrieve. Default = 1 | `page[number]=2` |
| all    | Return all identities without pagination                | `all=true`       |

### **Response Options**

**200 OK**

### Example Call

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

```javascript
GET [ENVIRONMENT HOSTNAME]/identities

// PAGINATED

GET [ENVIRONMENT HOSTNAME]/identities?page[number]=1&page[size]=1
```

{% endtab %}

{% tab title="CURL" %}

```bash
curl --location --request GET 'https://api.sandbox.publicmint.io/identities' \
--header 'apiKey: dfQ0ouwt0R14TPd2wxBzKtslWrBN5zfm'
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "data": [
        {
            "address": {
                "city": "Braga",
                "state": "Braga",
                "street": "Avenida D. João I,  40",
                "country": "PT",
                "postalCode": "4444-333"
            },
            "appId": "80937bc6-9578-45c8-b691-ea6b8a5d17e9",
            "birthday": "2000-11-11",
            "blocked": false,
            "createdAt": "2022-03-31T13:08:52.030Z",
            "email": "foobar@publicmint.com",
            "gender": "Male",
            "id": "38882f21-ce8f-4e18-8b83-e43e082912ef",
            "identityConfirmed": false,
            "identityOwner": null,
            "name": "João Pedro Soares",
            "phone": {
                "sms": false,
                "number": "910000000"
            },
            "tax": {
                "state": "Braga",
                "country": "PT",
                "idNumber": "1111111111"
            },
            "type": "person",
            "updatedAt": "2022-03-31T13:08:52.030Z"
        }
    ],
    "total": 1
}
```

{% endtab %}
{% endtabs %}

## Get identity document presign url

Returns a presign url to view a specific identity document.

## GET /identities/:identityId/documents/:id/presign-url

<mark style="color:blue;">`GET`</mark> `[ENVIRONMENT HOSTNAME]identities/:identityId/documents/:id/presign-url`

This endpoint returns a paginated list of all `identities` owned by you.**Available filtersAvailable sorts**

### **Path parameters**

<table><thead><tr><th width="206">Name</th><th width="216" align="center">Type</th><th>Description</th><th>Constraints</th><th align="center">Required</th></tr></thead><tbody><tr><td>identityId</td><td align="center"><code>String</code></td><td>Identity identifier. Format: <code>uuid</code>.</td><td></td><td align="center"><code>true</code></td></tr><tr><td>id</td><td align="center"><code>String</code></td><td>Document identifier.Format: <code>uuid</code>.</td><td></td><td align="center"><code>true</code></td></tr></tbody></table>

### **Response Options**

**200 OK**

### Example Call

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

```javascript
GET [ENVIRONMENT HOSTNAME]/identities/:identityId/documents/:id/presign-url

```

{% endtab %}

{% tab title="CURL" %}

```bash
curl --location --request GET 'https://api.sandbox.publicmint.io/identities/38882f21-ce8f-4e18-8b83-e43e082912ef/documents/2fe368e4-38ea-4329-bd2c-f8785d92ee57/presign-url' \
--header 'apiKey: dfQ0ouwt0R14TPd2wxBzKtslWrBN5zfm'
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "data": {
        "presignUrl": "https://ik.imagekit.io/p7reuy1mvbpd/aws-prod/2021/11/06/12/1c05077d-ad00-49c0-94de-4323ed8f9ad5/rn_image_picker_lib_temp_239e3a8b-6129-4d14-8fe7-ed9565cfc204.jpg"
    }
}
```

{% endtab %}
{% endtabs %}

## Update an identity

## PATCH /identities/:id

<mark style="color:purple;">`PATCH`</mark> `[ENVIRONMENT_HOSTNAME]/identities/:id`

Updates the identity information.

### **Path parameters**

<table><thead><tr><th width="330">Name</th><th width="324" align="center">Type</th><th>Description</th><th>Constraints</th><th align="center">Required</th></tr></thead><tbody><tr><td>id</td><td align="center"><code>String</code></td><td>Identity identifier. Format: <code>uuid</code>.</td><td></td><td align="center"><code>true</code></td></tr></tbody></table>

### **Request Parameters**

#### **Body parameters**

| Name          |       Type      | Description                             | Constraints                 | Required |
| ------------- | :-------------: | --------------------------------------- | --------------------------- | :------: |
| address       |     `Object`    | Address information.                    | `Not null`                  |          |
| birthday      |     `String`    | Identity birthday. Format: `Date`.      | `Between 18 and 99 years`   |          |
| documents     |     `Array`     | Identity documents.                     | `Not null`                  |          |
| email         |     `String`    | Identity email. Format: `email`         | `Not null`                  |          |
| faceImages    | `Array[String]` | Identity face images. Format: `uri`     | `Not null`                  |          |
| gender        |     `String`    | Identity gender                         | `[Male, Female, Undefined]` |          |
| identityOwner |     `String`    | Identity company owner. Format: `uuid`. |                             |          |
| name          |     `String`    | Identity name.                          | `Not null`                  |          |
| phone         |     `Object`    | Identity phone information.             | `Not null`                  |          |
| tax           |     `Object`    | Identity tax information.               | `Not null`                  |          |
| type          |     `String`    | Identity type.                          | `Not null`                  |          |

*Note: Fields name, birthday, gender, tax.country and tax.idNumber can't be updated if identity is already confirmed (identityConfirmed = true)*

#### **Body address parameters**

| Name       |   Type   | Description         | Constraints |           Required          |
| ---------- | :------: | ------------------- | ----------- | :-------------------------: |
| city       | `String` | Address city.       | `Not null`  |            `true`           |
| country    | `String` | Address country.    | `Not null`  |            `true`           |
| postalCode | `String` | Address postal code | `Not null`  |            `true`           |
| state      | `String` | Address state       | `Not null`  | `Required if country is US` |
| street     | `String` | Address street.     | `Not null`  |          `Required`         |

#### **Body documents parameters**

| Name        |   Type   | Description                | Constraints                                                               | Required |
| ----------- | :------: | -------------------------- | ------------------------------------------------------------------------- | :------: |
| description | `String` | Document description.      |                                                                           |          |
| label       | `String` | Document label.            |                                                                           |          |
| side        | `String` | Document side.             | `[FrontSide, BackSide]`                                                   |  `true`  |
| type        | `String` | Document type              | `[DriverLicense,IdentityCard,Other,Passport,ResidencePermit,UtilityBill]` |  `true`  |
| url         | `String` | DocumentUrl. Format: `uri` | `Not null`                                                                |  `true`  |

#### **Body phone parameters**

| Name   |   Type   | Description        | Constraints | Required |
| ------ | :------: | ------------------ | ----------- | :------: |
| number | `String` | Phone number.      | `Not null`  |          |
| sms    | `String` | Available for sms. |             |          |

#### **Body tax parameters**

| Name            |   Type   | Description               | Constraints |            Required           |
| --------------- | :------: | ------------------------- | ----------- | :---------------------------: |
| country         | `String` | Tax country code.         | `Not null`  |             `true`            |
| idNumber        | `String` | Tax id number.            | `Not null`  |             `true`            |
| state           | `String` | Tax state.                | `Not null`  |  `Required if country is US`  |
| formationRegion | `String` | Company formation region. | `Not null`  | `Required if type is company` |

### **Response Options**

**400 Bad Request**

* validation\_failed
  * If the required parameters are not provided.
  * If additional parameters are provided.
  * If some of the parameters type is invalid.
  * If some of the parameters constraints is not respected.
* email\_already\_in\_use

**404 Not Found**

* identity\_owner\_not\_found
  * If a non existent identity owner `id` is provided.

**422 Unprocessable entity**

* identity\_owner\_must\_be\_of\_type\_person
  * If identity owner is not of type person.

**200 OK**

### **Example Call**

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

```json
PATCH [ENVIRONMENT HOSTNAME]/identities/38882f21-ce8f-4e18-8b83-e43e082912ef

{
  "address": {
    "city": "Braga",
    "country": "PT",
    "postalCode": "4444-333",
    "state": "Braga",
    "street": "Avenida D. João I,  40"
  },
  "birthday": "2000-11-11",
  "email": "foobar@publicmint.com",
  "gender": "Male",
  "name": "João Pedro Soares",
  "phone": {
    "number": "910000000",
    "sms": false
  },
  "tax": {
    "country": "PT",
    "idNumber": "1111111111",
    "state": "Braga"
  },
  "documents": [{
    "description": "ID card",
    "label": "id card",
    "side": "FrontSide",
    "type": "IdentityCard",
    "url": "https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"
  }],
  "faceImages": ["https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"]
}js
```

{% endtab %}

{% tab title="CURL" %}

```shell
curl --location --request PATCH 'https://api.sandbox.publicmint.io/identities/38882f21-ce8f-4e18-8b83-e43e082912ef' \
--header 'apiKey: dfQ0ouwt0R14TPd2wxBzKtslWrBN5zfm' \
--header 'Content-Type: application/json' \
--data-raw '{
  "address": {
    "city": "Braga",
    "country": "PT",
    "postalCode": "4444-333",
    "state": "Braga",
    "street": "Avenida D. João I,  40"
  },
  "birthday": "2000-11-11",
  "email": "foobar@publicmint.com",
  "gender": "Male",
  "name": "João Pedro Soares",
  "phone": {
    "number": "910000000",
    "sms": false
  },
  "tax": {
    "country": "PT",
    "idNumber": "1111111111",
    "state": "Braga"
  },
  "documents": [{
    "description": "ID card",
    "label": "id card",
    "side": "FrontSide",
    "type": "IdentityCard",
    "url": "https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"
  }],
  "faceImages": ["https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"]
}'
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "data": {
        "documents": [
            {
                "createdAt": "2022-03-31T15:17:56.812Z",
                "deletedAt": null,
                "description": "ID card",
                "id": "d25be7eb-510b-4400-ae10-45991a9ebd86",
                "identityId": "38882f21-ce8f-4e18-8b83-e43e082912ef",
                "label": "id card",
                "side": "frontSide",
                "type": "identityCard",
                "updatedAt": "2022-03-31T15:17:56.812Z",
                "url": "https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"
            },
            {
                "createdAt": "2022-03-31T15:17:56.823Z",
                "deletedAt": null,
                "description": null,
                "id": "1e802b4b-4f89-49f6-ae8a-6e1ebc731dfb",
                "identityId": "38882f21-ce8f-4e18-8b83-e43e082912ef",
                "label": null,
                "side": "frontSide",
                "type": "faceImage",
                "updatedAt": "2022-03-31T15:17:56.823Z",
                "url": "https://pmint-custodial-api-sandbox-identity-docs.s3.amazonaws.com/fd/fc/09/dd/4nHVF9Hz9FArIrUo.jpeg"
            }
        ],
        "address": {
            "city": "Braga",
            "state": "Braga",
            "street": "Avenida D. João I,  40",
            "country": "PT",
            "postalCode": "4444-333"
        },
        "appId": "80937bc6-9578-45c8-b691-ea6b8a5d17e9",
        "birthday": "2000-11-11",
        "blocked": false,
        "createdAt": "2022-03-31T13:08:52.030Z",
        "email": "foobar@publicmint.com",
        "gender": "Male",
        "id": "38882f21-ce8f-4e18-8b83-e43e082912ef",
        "identityConfirmed": false,
        "identityOwner": null,
        "name": "João Pedro Soares",
        "phone": {
            "sms": false,
            "number": "910000000"
        },
        "tax": {
            "state": "Braga",
            "country": "PT",
            "idNumber": "1111111111"
        },
        "type": "person",
        "updatedAt": "2022-03-31T15:17:56.711Z"
    }
}
```

{% endtab %}
{% endtabs %}

## Get operations

#### `GET /identities/:id/operations`

Returns a list of all enabled operations for the active KYC providers and the current status of each one, depending on the KYC status of the identity.

**Request Parameters**

**Path parameters**

| Name |   Type   | Description                          | Constraints | Required |
| ---- | :------: | ------------------------------------ | ----------- | :------: |
| id   | `String` | Identity identifier. Format: `uuid`. |             |  `true`  |

**Response Options**

**200 OK**

Request example:

```
GET <hostname>/identities/e7941059-74c6-4b3f-b029-d3aa03d1ea44/operation
```

Response example:

```
{
  "data": [{
    "action": "create",
    "active": false,
    "code": "deposit:wire",
    "reason": "kyc_required_status_not_reached"
  }, {
    "action": "create",
    "active": true,
    "code": "deposit:stablecoin"
  }, {
    "action": "create",
    "active": false,
    "code": "withdrawal:wire",
    "reason": "operation_not_active_due_to_extra_kyc_missing"
  }, {
    "action": "confirm",
    "active": false,
    "code": "withdrawal:stablecoin",
    "reason": "identity_kyc_is_missing"
  }]
}
```

## Delete an identity

## DELETE /identities/:id

<mark style="color:red;">`DELETE`</mark> `[ENVIRONMENT_HOSTNAME]/identities/:id`

Deletes the identity with the given `Id`.

### **Path parameters**

| Name |   Type   | Description                          | Constraints | Required |
| ---- | :------: | ------------------------------------ | ----------- | :------: |
| id   | `String` | Identity identifier. Format: `uuid`. |             |  `true`  |

### **Response Options**

**400 Bad Request**

* validation\_failed
  * If an invalid identity `id` is provided.

**404 Not Found**

* identity\_not\_found
  * If a non existent identity `id` is provided.&#x20;

**204 OK**

### **Example Call**

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

```json
DELETE [ENVIRONMENT HOSTNAME]/identities/38882f21-ce8f-4e18-8b83-e43e082912ef
```

{% endtab %}

{% tab title="CURL" %}

```shell
curl --location --request DELETE 'https://api.sandbox.publicmint.io/identities/38882f21-ce8f-4e18-8b83-e43e082912ef' \
--header 'apiKey: dfQ0ouwt0R14TPd2wxBzKtslWrBN5zfm'
```

{% endtab %}
{% endtabs %}


---

# 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://developers.publicmint.io/api/reference/identities.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.
