# compliance (Coinbax API)

> Source: https://developers.coinbax.com/reference/coinbax-api/compliance/
> Staging base URL: https://api-staging.coinbax.com

## Create a new verification request

`POST /api/v1/api/v1/compliance/verifications`

- Auth: X-API-Key header
- Operation ID: `ComplianceController_createVerification`

### Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `userId` | string | yes | User ID to verify |
| `type` | enum ("identity", "document", "address", "phone", "email") | yes | Type of verification to perform |
| `metadata` | object | no | Additional metadata for verification |

```json
{
  "userId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "type": "identity",
  "metadata": {
    "email": "user@example.com",
    "country": "US"
  }
}
```

### Example request

```bash
curl -X POST https://api-staging.coinbax.com/api/v1/api/v1/compliance/verifications \
  -H "X-API-Key: $COINBAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "userId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "type": "identity",
  "metadata": {
    "email": "user@example.com",
    "country": "US"
  }
}'
```

### Responses

**201** Verification created successfully

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "platformId": "550e8400-e29b-41d4-a716-446655440001",
  "userId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "type": "identity",
  "status": "approved",
  "level": "basic",
  "riskRating": "low",
  "provider": "persona",
  "externalInquiryId": "inq_ABC123",
  "externalSessionToken": "session_token_xyz",
  "metadata": {
    "email": "user@example.com",
    "country": "US"
  },
  "rejectionReason": null,
  "verifiedAt": "2024-01-15T10:30:00Z",
  "expiresAt": "2025-01-15T10:30:00Z",
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}
```

**400** Invalid request data

**401** Invalid or missing API key

---

## Check verification status

`POST /api/v1/api/v1/compliance/verifications/check`

- Auth: X-API-Key header
- Operation ID: `ComplianceController_checkVerification`

### Request body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `userId` | string | yes | User ID to check verification status |
| `type` | enum ("identity", "document", "address", "phone", "email") | yes | Type of verification to check |

```json
{
  "userId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "type": "identity"
}
```

### Example request

```bash
curl -X POST https://api-staging.coinbax.com/api/v1/api/v1/compliance/verifications/check \
  -H "X-API-Key: $COINBAX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "userId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "type": "identity"
}'
```

### Responses

**200** Verification status retrieved

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "platformId": "550e8400-e29b-41d4-a716-446655440001",
  "userId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "type": "identity",
  "status": "approved",
  "level": "basic",
  "riskRating": "low",
  "provider": "persona",
  "externalInquiryId": "inq_ABC123",
  "externalSessionToken": "session_token_xyz",
  "metadata": {
    "email": "user@example.com",
    "country": "US"
  },
  "rejectionReason": null,
  "verifiedAt": "2024-01-15T10:30:00Z",
  "expiresAt": "2025-01-15T10:30:00Z",
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}
```

**404** Verification not found

---

## Get verification by ID

`GET /api/v1/api/v1/compliance/verifications/{id}`

- Auth: X-API-Key header
- Operation ID: `ComplianceController_getVerification`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes |  |

### Example request

```bash
curl https://api-staging.coinbax.com/api/v1/api/v1/compliance/verifications/<id> \
  -H "X-API-Key: $COINBAX_API_KEY"
```

### Responses

**200** Verification found

```json
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "platformId": "550e8400-e29b-41d4-a716-446655440001",
  "userId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "type": "identity",
  "status": "approved",
  "level": "basic",
  "riskRating": "low",
  "provider": "persona",
  "externalInquiryId": "inq_ABC123",
  "externalSessionToken": "session_token_xyz",
  "metadata": {
    "email": "user@example.com",
    "country": "US"
  },
  "rejectionReason": null,
  "verifiedAt": "2024-01-15T10:30:00Z",
  "expiresAt": "2025-01-15T10:30:00Z",
  "createdAt": "2024-01-15T10:00:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}
```

**404** Verification not found

---

## Webhook endpoint for Persona verification updates

`POST /api/v1/api/v1/compliance/webhooks/persona`

- Auth: X-API-Key header
- Operation ID: `ComplianceController_handlePersonaWebhook`

### Example request

```bash
curl -X POST https://api-staging.coinbax.com/api/v1/api/v1/compliance/webhooks/persona \
  -H "X-API-Key: $COINBAX_API_KEY"
```

### Responses

**200** Webhook processed successfully
