# Create Identities

In this example we'll show how to use our APIs to create a valid identity that can go through the KYC process on Public Mint's services.

## **Before you start**

Public Mint's service APIs offer a series of methods that can be used to integrate with Public Mint services and blockchain. Before you start, it's recommended that you review the full documentation available online on [developers.publicmint.io](https://developers.publicmint.io/).

### **Become a Partner**

To use Public Mint's services, you need to be registered as partner and have the API Key to access the APIs. Please contact <support@publicmint.com> to apply.

### **Environments**

Public Mint has two publicly available environments that can be used by anyone: *production* and *sandbox*

#### **Production**

The Production environment is Public Mint's main environment for partners and users. It's connected to real banks and KYC verification systems.&#x20;

{% embed url="<https://api.publicmint.io>" %}

**Sandbox**

The Sandbox environment is targeted for integration development by Partners and others that want to use Public Mint's services and blockchain. It's not connected to KYC verification systems or actual banking rails.&#x20;

{% embed url="<https://api.sandbox.publicmint.io>" %}

## **Creating Identities**

Creating a new identity is as simple as making a POST request to the /identities endpoint and passing all the required information. [Read here](https://developers.publicmint.io/api/identities/kyc-for-individuals) for more details.

**Example**

{% code title="Request" %}

```bash
curl -X POST \
  https://api.sandbox.publicmint.io/identities \
  -H 'Content-Type: application/json' \
  -H 'apiKey: [MY_API_KEY]' \
  -d '{
    "name": "John Doe",
    "email": "john.doe@mycompany.com",
    "companyOfficer": false,
    "birthday": "1998-09-09",
    "gender": "Male",
    "identityType": "person",
    "address": {
        "street": "24404 Karianne Club",
        "postalCode": "98605",
        "city": "Bingen",
        "country": "US",
        "state": "WA"
    },
    "phone": {
        "number": "5015321379",
        "sms": true
    },
    "tax": {
        "idNumber": "872343907",
        "state": "WA",
        "country": "US"
    }
}'
```

{% endcode %}

{% code title="Response" %}

```javascript
{
    "id": "4da8aa4f-4a01-4bf6-a72d-a8bac268c304",
    "app_id": "3f488bf9-52c1-4236-83d2-a99caacd3dc4",
    "verification_status": "pending",
    "blocked": false,
    "status": "active",
    ...
}
```

{% endcode %}

Take note of the `id` field from the response. That is the identity unique identifier and will be used on the remaining steps.

### Upload Identity documents

The identity verification process requires the confirmation of the personal details supplied: `identity` and `address`. That is done by uploading the necessary documents and linking them to the newly created identity. Learn more [here](https://developers.publicmint.io/api/identities/documents-and-kyc).

**Example**

{% code title="Request" %}

```bash
curl -X POST \
  https://api.sandbox.publicmint.io/documents \
  -H 'Content-Length: [TOTAL_SIZE]' \
  -H 'Content-Type: multipart/form-data; boundary=--------------------------943719922750551202326880' \
  -H 'apiKey: [MY_API_KEY]' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F description=Passport \
  -F label=passport \
  -F identityId=4da8aa4f-4a01-4bf6-a72d-a8bac268c304 \
  -F documentType=Passport \
  -F documentSide=FrontSide \
  -F file=@[PATH_TO_FILE]/passport.jpeg
```

{% endcode %}

{% code title="Response" %}

```javascript
{
    "id": "2f0a3fad-3e1c-4628-a757-70aa3bfef3cd",
    "identity_id": "4da8aa4f-4a01-4bf6-a72d-a8bac268c304",
    "status": "active",
    ...
}
```

{% endcode %}

You should upload as many documents as necessary (making one POST request per document) to prove and confirm the `identity` created.

#### **Verify Identity**

With the identity created and the documents uploaded, the KYC process will start automatically. When the process ends, the identity's `verification_status` field will be updated to reflect the final result. Only identities with `verification_status` tagged as `approved` can execute fiat operations.

#### **Sandbox**

In the sandbox environment you can override the standard KYC process and do a manual approval of the identity. To do that, you must make a POST request to the `/identities/:id/sandbox-approve-kyc` endpoint. Note that this is only possible in the sandbox environment.

**Example**

{% code title="Request" %}

```bash
https://api.sandbox.publicmint.io/identities/4da8aa4f-4a01-4bf6-a72d-a8bac268c304/sandbox-approve-kyc \
  -H 'apiKey: [MY_API_KEY]'
```

{% endcode %}

{% code title="Response" %}

```javascript
{
    "message": "Identity sent for approval"
}
```

{% endcode %}


---

# 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/tutorials/create-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.
