# Hovi Connect API: Polygon

> Issue and verify Iden3 JSON-LD credentials for Privado ID.

Source: https://docs-dev.hovi.id/api/privado-id

OpenAPI spec (JSON): https://hovi.blob.core.windows.net/api-swagger/1.0.0/privado-id.json

Version: v0.8.9

The Hovi API integrates with the Polygon ecosystem, enabling the issuance and verification of JSON-LD Verifiable Credentials using the Iden3 protocol on the Polygon Amoy network. This documentation covers all API endpoints, streamlining the development of secure and scalable digital identity solutions.

Base URL: `https://api.hovi.id`

## Endpoints

- Organization
  - `POST /organization/create`: Create Organization
  - `GET /organization/`: Get All Organization
  - `GET /organization/public-did`: Get Public DID
  - `PATCH /organization/update`: Update Organization
  - `POST /organization/rotate-key`: Rotate Organization Key
  - `DELETE /organization/delete`: Delete Organization
- Webhooks
  - `POST /webhook/add`: Add Webhook
  - `GET /webhook/`: Get All Webhooks
  - `DELETE /webhook/`: Remove Webhooks
  - `POST /webhook/rotate-secret`: Rotate Webhook Secret
- Connections
  - `POST /connection/create`: Create Connection Invitation
  - `GET /connection/`: Get All Connections
  - `DELETE /connection/`: Delete Connection
  - `GET /connection/find`: Find Completed Connection by Invitation ID or Connection ID
  - `GET /connection/invitations`: Get All Invitations
  - `GET /connection/invitation/find`: Get Invitation By Invitation Id
- Credential Templates
  - `POST /credential-template/jsonld/create`: Create Template (JSON-LD)
  - `POST /credential-template/jsonld/import`: Import Template (JSON-LD)
  - `GET /credential-template/`: Get Ecosystem Templates
  - `GET /credential-template/organization`: Get Organization Templates
  - `DELETE /credential-template/delete`: Delete Template
  - `PATCH /credential-template/update`: Update Template
- Credentials
  - `GET /credential/`: Get Credentials
  - `GET /credential/find`: Get Credential by Id
  - `POST /credential/jsonld/offer`: Offer Credential (JSON-LD)
- Verification Templates
  - `POST /verification-template/jsonld/create`: Create Template (JSON-LD)
  - `GET /verification-template/`: Get Ecosystem Templates
  - `GET /verification-template/organization`: Get Organization Templates
  - `DELETE /verification-template/delete`: Delete Template by Verification Template Id
  - `PATCH /verification-template/update`: Update Template by Verification Template Id
- Verifications
  - `POST /verification/send-proof-request`: Send Proof Request
  - `GET /verification/proof-request`: Get Proof Requests
  - `GET /verification/proof-request/find`: Find Proof Request by Proof Exchange Id
  - `GET /verification/proof-response`: Get Proof Responses
  - `GET /verification/proof-response/find`: Find Proof Response by Presentation Id
- Other
  - `GET /verification/session/document-coverage`
  - `GET /verification/session/{sessionId}/redirect-target`
  - `POST /verification/session/{sessionId}/id-verification/document`
  - `POST /verification/session/{sessionId}/id-verification/passive-liveness`
  - `POST /verification/session/{sessionId}/id-verification/face-match`
  - `POST /verification/session/{sessionId}/id-verification/ip-risk`
  - `GET /verification/session/{sessionId}/evidence`

## Organization

Manages organizations (tenants) within Hovi — the primary actors that create credential templates, issue JSON-LD credentials, and initiate Iden3-based proof requests on the Polygon network.

### Create Organization

`POST /organization/create`

This route allows for the creation of a new organization within an ecosystem.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for creating a new organization (tenant). Auto-provisions a `did:iden3:polygon:amoy` DID and optional webhook endpoints.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | Yes | Human-readable name of the organization. |
| `label` | string | Yes | Short identifier label for this organization. |
| `secret` | string | Yes | Secret passphrase for organization management operations (rotate key, delete). |
| `imageUrl` | string (url) | No | Optional URL of the organization's logo image. |
| `webhooks` | array of string (url) | No | Optional array of webhook URLs to register during tenant creation. |

```json
{
  "name": "Acme Corp",
  "label": "acme-corp",
  "secret": "acme-corp-secret",
  "imageUrl": "https://acme-corp.com/logo.png",
  "webhooks": [
    "https://acme-corp.com/webhook1",
    "https://acme-corp.com/webhook2"
  ]
}
```

**Responses**

- `201`: Success
- `400`: Invalid params
- `403`: Forbidden
- `500`: Internal Server Error

Example `201` response:

```json
{
  "success": true,
  "response": {
    "organizationId": "1abbaba4-8604-4ef8-a01f-fa788a771795",
    "tenantId": "1abbaba4-8604-4ef8-a01f-fa788a771795",
    "setting": {
      "organizationName": "Acme Corp",
      "defaultLabel": "acme-corp",
      "image": "https://acme-corp.com/logo.png",
      "id": "1abbaba4-8604-4ef8-a01f-fa788a771795"
    },
    "accessToken": "eyJhbGciOiJIUzI1NiJ9.ZXlKMFpXNWhiblJKWkNJNklqRmhZbUpoWW1FMExUZzJNRFF0TkdWbU9DMWhNREZtTFdaaE15NjRiRzQ4WVRjM01UYzVOVElzSW1saGRDSTZNVGMzT0RRNk5UQXpPSDA9.zwwmiaG5xwWz0ZmPNo4KOoQo8LwMZE3oerFZkoK8VVk",
    "dids": [
      {
        "did": "did:iden3:polygon:amoy:xDmMUg1z43pTTy6u2W8wSsq65arWgEwVdvJiDTwQG",
        "method": "iden3",
        "privateKey": "f6vUOXNZM8aCdPLB8w51oUhDfJ6nQotB"
      }
    ],
    "webhooks": [
      {
        "webhookUrl": "https://acme-corp.com/webhook1",
        "webhookId": "96438837-9a60-42c5-b7de-95ff4ed7ec88"
      },
      {
        "webhookUrl": "https://acme-corp.com/webhook2",
        "webhookId": "e8db92af-aa89-463e-b8c9-d9d617971461"
      }
    ]
  }
}
```

### Get All Organization

`GET /organization/`

Retrieves a list of organizations. By default, all organizations are returned.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `organizationId` | query | string | No | Filters the result by a specific organization id. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "organizationId": "44266dea-aea5-421e-88ba-732bb774a0ea",
      "tenantId": "44266dea-aea5-421e-88ba-732bb774a0ea",
      "ecosystemId": "e245e890-5811-457e-aae2-f4d4cf5ade71",
      "dids": [
        {
          "did": "did:iden3:polygon:amoy:x9GJM81ZjQTtc56k7voGE9q788bYH8nGhxBFYJQoC",
          "method": "iden3"
        }
      ],
      "name": "Polygon Org",
      "label": "polygonorg",
      "image": "https://hovidevelopment.blob.core.windows.net/studio-assets/tenants/images/polygon-org-image-1778470746748.svg%2Bxml",
      "status": "active",
      "createdAt": "2026-05-11T03:39:10.931Z",
      "updatedAt": "2026-05-11T03:42:37.181Z"
    }
  ]
}
```

### Get Public DID

`GET /organization/public-did`

This route retrieves the Decentralized Identifiers (DIDs) associated with a specific organization, identified by their organization id. The response includes a list of all DIDs linked to the organization, along with relevant metadata.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "did": "did:iden3:polygon:amoy:2qSMDANYnqEdDF3s5HpmspaH5ep2rDKR1xE89gWNDn",
      "method": "iden3"
    }
  ]
}
```

### Update Organization

`PATCH /organization/update`

This route allows for the modification of a organization’s metadata, such as their label and image URL. The organization is identified by their organization id.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

The data required to update an organization's (tenant's) display settings. All fields are optional only the fields provided will be updated.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `label` | string | No | Updated short slug label for the organization (shown in DIDComm connection invitations). |
| `imageUrl` | string (url) | No | URL pointing to the organization logo (the image shown for this organization in the dashboard). |

```json
{
  "label": "acme-corp-updated",
  "imageUrl": "https://new-acme-corp.com/new-logo.png"
}
```

**Responses**

- `200`: Success
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true
}
```

### Rotate Organization Key

`POST /organization/rotate-key`

This route allows a organization to rotate their secret key, a critical security component used for authentication and encryption in the platform.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for rotating the organization's Ecosystem API Key. The previous token is immediately invalidated.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `accessToken` | string | Yes | Current organization access token (JWT) to be rotated. |
| `organizationSecret` | string | Yes | Organization secret passphrase. Required to authorize token rotation. |

```json
{
  "accessToken": "eyJhbGciOiJIUzI1NiJ9.ZXlKMFpXNWhiblJKWkNJNklt...(truncated)",
  "organizationSecret": "acme-corp-secret"
}
```

**Responses**

- `200`: Success
- `400`: Invalid organization secret
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": {
    "accessToken": "eyJhbGciOiJIUzI1NiJ9.ZXlKMFpxNWhiblJKWkNJNklqZGhORFpsT1RneUxUUTVNemt0TkRobVpDMDRabUl6TFRNeVpEaGxaVEV4T1RZMk5TSXNJbWxoZENJNk1UY3lNamcyTkRVMU5uMD0.VUejpKgvZWDHrO1SogCxixRM1S4ykQAHqpIu0XmrTvI"
  }
}
```

### Delete Organization

`DELETE /organization/delete`

This route allows for the permanent deletion of a organization from the ecosystem, identified by their organization id. Deleting a organization removes all their associated data, including credential templates, verification templates, issued credentials, and proof requests.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for deleting an organization and all its associated resources. This action is irreversible.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `organizationSecret` | string | Yes | Secret passphrase provided during tenant creation. Required to authorize deletion. |

```json
{
  "organizationSecret": "acme-corp-secret"
}
```

**Responses**

- `200`: Success
- `400`: Invalid organization secret
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true
}
```

## Webhooks

Configures asynchronous HTTP callbacks that Hovi POSTs to your server when events occur (e.g., credential issued, proof verified) — no polling required.

### Add Webhook

`POST /webhook/add`

This route allows a organization to create a webhook URL that will be triggered by Hovi upon the successful issuance of a credential.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Creates a webhook endpoint for receiving Hovi event notifications. Hovi automatically generates a signing secret and returns it in the response. Store this secret securely and use it to verify incoming webhook requests. Each request includes `x-webhook-timestamp` and `x-webhook-signature`. The signature is generated using HMAC-SHA256 over `{timestamp}.{rawBody}`. See the Webhooks guide for complete verification instructions. [See more](https://docs.hovi.id/api-guide/business-wallet-api/webhooks)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `webhookUrl` | string (url) | Yes | Publicly accessible HTTP(S) endpoint URL that will receive Hovi event notification POST requests. Must respond with a 2xx status code within the timeout window. |

```json
{
  "webhookUrl": "https://acme-corp.com/webhook1"
}
```

**Responses**

- `201`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `201` response:

```json
{
  "success": true,
  "response": {
    "webhookId": "7d3aae8bfbe4b8472511db2a957158e8",
    "webhookUrl": "https://kindi10.requestcatcher.com",
    "webhookSecret": "4FME20TvYrxqTHJmjOvM1OG7_amYukdYbsT8MjQUN-s"
  }
}
```

### Get All Webhooks

`GET /webhook/`

Retrieves webhooks for a specific organization. By default, all webhooks are returned.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `webhookId` | query | string | No | Filters the result by a specific webhook id. Example: `b1b8b362-7937-4f97-bc91-708472a9ddd6` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "webhookId": "305b56ab8064dfdd801d1697795e7ab0",
      "organizationId": "9def09fb-19a1-49b5-bda5-f1954c179b2d",
      "ecosystemId": "e6e31de2-83ad-4af9-8cd9-d9861b6ee5d5",
      "url": "https://kindi10.requestcatcher.com",
      "createdAt": "2024-06-21T06:31:26.415Z",
      "updatedAt": "2024-06-21T06:31:26.415Z"
    },
    {
      "webhookId": "0f8fad7f93e617ff0e548725678e81a8",
      "organizationId": "9def09fb-19a1-49b5-bda5-f1954c179b2d",
      "ecosystemId": "e6e31de2-83ad-4af9-8cd9-d9861b6ee5d5",
      "url": "https://kindi10.requestcatcher.com",
      "createdAt": "2024-06-21T06:31:26.487Z",
      "updatedAt": "2024-06-21T06:31:26.487Z"
    }
  ]
}
```

### Remove Webhooks

`DELETE /webhook/`

This route allows a organization to delete a webhook URL that is no longer needed. Deleting a webhook ensures that the tenant will no longer receive event notifications on the specified webhook endpoint.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for deregistering a webhook endpoint.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `webhookId` | string | Yes | Unique identifier of the webhook to delete. |

```json
{
  "webhookId": "7d3aae8bfbe4b8472511db2a957158e8"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "message": "Webhook with id 6d98b1a8-32d9-4bd3-bd31-c4fa364d18ff deleted successfully"
}
```

### Rotate Webhook Secret

`POST /webhook/rotate-secret`

This route allows an organization to rotate the signing secret for an existing webhook.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for rotating the signing secret of an existing webhook. A signing secret is generated automatically.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `webhookId` | string | Yes | Unique identifier of the webhook whose secret should be rotated. |

```json
{
  "webhookId": "7d3aae8bfbe4b8472511db2a957158e8"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not Found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": {
    "webhookId": "7d3aae8bfbe4b8472511db2a957158e8",
    "webhookSecret": "your-new-webhook-secret"
  }
}
```

## Connections

Establishes and manages Iden3comm peer-to-peer channels between the organizational agent and holder wallets. Connections use the `iden3comm://` protocol and QR/URL-based invitation flows.

### Create Connection Invitation

`POST /connection/create`

This route allows a tenant to establish a connection with a wallet by creating a connection invitation. Once the wallet accepts the invitation, a secure connection is established, enabling tenants to issue credentials.

**Related webhook events**

A later action in the flow can cause Hovi to send the following event to the registered webhook URL:

- [Connection Established](#tag/webhook-events/webhook/post/polygon-connection-completed)

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for generating an Iden3comm connection invitation. The `invitationUri` (`iden3comm://`) is encoded into a QR code or deep link for a Polygon ID-compatible holder wallet to scan.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `label` | string | Yes | Human-readable label for this connection invitation. |
| `alias` | string | No | Optional alias name for the connection. |
| `autoAcceptConnection` | boolean | No | Whether to automatically accept incoming connection responses without manual approval. |
| `multiUseInvitation` | boolean | No | `true` — reusable invitation; multiple wallets may connect. `false` — single-use, expires after first connection. |
| `domain` | string | No | Optional domain name associated with this connection invitation. |
| `imageUrl` | string (url) | No | Optional URL of an image displayed on the connection invitation screen. |

```json
{
  "label": "Acme Corp Connection",
  "alias": "acme-connection",
  "autoAcceptConnection": true,
  "multiUseInvitation": false,
  "domain": "xyz-domain.com",
  "imageUrl": "https://acme-corp.com/connection.png"
}
```

**Responses**

- `201`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `201` response:

```json
{
  "success": true,
  "response": {
    "invitationId": "e53e1006-5ba3-4656-b1b0-d154d2ec6f5d",
    "multiParty": true,
    "createdRequest": {
      "id": "e53e1006-5ba3-4656-b1b0-d154d2ec6f5d",
      "thid": "e53e1006-5ba3-4656-b1b0-d154d2ec6f5d",
      "typ": "application/iden3comm-plain-json",
      "type": "https://iden3-communication.io/authorization/1.0/request",
      "from": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk",
      "body": {
        "callbackUrl": "https://polygon-agent.hovi.id/connection/did-exchange/e53e1006-5ba3-4656-b1b0-d154d2ec6f5d",
        "scope": []
      }
    },
    "invitationUri": "iden3comm://?i_m=eyJpZCI6ImU1M2UxMDA2LTViYTMtNDY1Ni1iMWIwLWQxNTRkMmVjNmY1ZCIsInRoaWQiOiJlNTNlMTAwNi01YmEzLTQ2NTYtYjFiMC1kMTU0ZDJlYzZmNWQiLCJ0eXAiOiJhcHBsaWNhdGlvbi9pZGVuM2NvbW0tcGxhaW4tanNvbiIsInR5cGUiOiJodHRwczovL2lkZW4zLWNvbW11bmljYXRpb24uaW8vYXV0aG9yaXphdGlvbi8xLjAvcmVxdWVzdCJ9",
    "invitationUrl": "https://hovi.id/connection?data=eyJ1cmkiOiJpZGVuM2NvbW06Ly8...fQ=="
  }
}
```

### Get All Connections

`GET /connection/`

This route retrieves a list of all connections established between the organization and various wallets. Each connection represents a secure link through which the organization can issue credentials or interact with the connected wallets.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `page` | query | integer | No | Page number for paginated results. Each page returns up to 100 results. Defaults to 1 if not provided. Example: `1` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "connectionId": "89c02ee6-c60f-4e2c-b762-45810a566376",
      "invitationId": "e53e1006-5ba3-4656-b1b0-d154d2ec6f5d",
      "response": {
        "id": "a45c227e-90c3-4054-ab03-d5bff2b89b65",
        "typ": "application/iden3-zkp-json",
        "type": "https://iden3-communication.io/authorization/1.0/response",
        "thid": "e53e1006-5ba3-4656-b1b0-d154d2ec6f5d",
        "body": {
          "did_doc": {
            "context": [
              "https://www.w3.org/ns/did/v1"
            ],
            "id": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT",
            "service": [
              {
                "id": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT#mobile",
                "type": "Iden3MobileServiceV1",
                "serviceEndpoint": "iden3comm:v0.1:callbackHandler"
              },
              {
                "id": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT#push",
                "type": "push-notification",
                "serviceEndpoint": "https://push-staging.polygonid.com/api/v1",
                "metadata": {
                  "devices": [
                    {
                      "ciphertext": "EGYmomYE...(truncated)",
                      "alg": "RSA-OAEP-512"
                    }
                  ]
                }
              }
            ]
          },
          "message": null,
          "scope": []
        },
        "from": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT",
        "to": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk"
      },
      "isVerified": true,
      "state": "completed",
      "createdAt": "2024-08-05T10:27:51.189Z",
      "updatedAt": "2024-08-05T10:27:51.189Z",
      "myDid": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk",
      "theirDid": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT"
    }
  ]
}
```

### Delete Connection

`DELETE /connection/`

This route allows the organization to permanently delete an existing connection invitation, identified by its unique out of band ID.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for deleting a specific connection record.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `connectionId` | string (uuid) | Yes | UUID of the connection to delete. |

```json
{
  "connectionId": "89c02ee6-c60f-4e2c-b762-45810a566376"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "message": "Connection deleted successfully"
}
```

### Find Completed Connection by Invitation ID or Connection ID

`GET /connection/find`

This route retrieves detailed information about connections, identified by a unique connection ID or invitation ID. If both provided, invitationId gets priority over connectionId during the search.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `invitationId` | query | string | No | Find a completed connection by the OOB invitation ID that initiated the handshake. Only available in the Privado.id ecosystem. Takes priority over connectionId if both parameters are provided. Example: `c971d3ba-09a8-4fc3-9de0-8f04d94390b0` |
| `connectionId` | query | string | No | Find a completed connection by its unique connection ID. Ignored if invitationId is also provided. Example: `d2e8903d-e65e-4543-bfbe-ede68fb88fb2` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `400`: Bad Request
- `404`: Not Found — the specified organization does not exist
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "connectionId": "5f3d9cc9-6ce1-434e-af8e-c7df69a46bcb",
      "myDid": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk",
      "createdAt": "2024-08-07T08:35:16.911Z",
      "updatedAt": "2024-08-07T08:35:32.939Z",
      "theirDid": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT",
      "state": "completed",
      "invitationId": "ab209278-db43-45dc-b74e-56a0d83c6f50"
    }
  ]
}
```

### Get All Invitations

`GET /connection/invitations`

This route retrieves a list of all invitations created by the organization. Each invitation can be provided as a scannable QR code that facilitates the establishment of a connection with a wallet.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `page` | query | integer | No | Page number for paginated results. Each page returns up to 100 results. Defaults to 1 if not provided. Example: `1` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "createdAt": "2024-08-05T10:18:14.374Z",
      "updatedAt": "2024-08-05T10:27:51.442Z",
      "invitationId": "e53e1006-5ba3-4656-b1b0-d154d2ec6f5d",
      "multiParty": true,
      "numberOfResponses": 1,
      "state": "pending"
    },
    {
      "createdAt": "2024-08-06T05:53:25.274Z",
      "updatedAt": "2024-08-06T05:54:25.177Z",
      "invitationId": "x69z004-5ba3-4656-b1b0-d154d2ec6e2d",
      "multiParty": true,
      "numberOfResponses": 2,
      "state": "pending"
    }
  ]
}
```

### Get Invitation By Invitation Id

`GET /connection/invitation/find`

This route retrieves the details of a specific connection invitation created by the organization.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `invitationId` | query | string | Yes | Retrive connection invitation by invitation id Example: `c971d3ba-09a8-4fc3-9de0-8f04d94390b0` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `400`: Bad Request
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": {
    "invitationId": "18e3739d-7f6e-4865-a0b8-092e72119f6c",
    "createdAt": "2024-07-29T11:06:35.166Z",
    "updatedAt": "2024-07-29T11:12:34.642Z",
    "invitationUri": "iden3comm://?i_m=eyJpZCI6IjE4ZTM3MzlkLTdmNmUtNDg2NS1hMGI4LTA5MmU3MjExOWY2YyIsInRoaWQiOiIxOGUzNzM5ZC03ZjZlLTQ4NjUtYTBiOC0wOTJlNzIxMTlmNmMi...(truncated)",
    "invitationUrl": "https://hovi.id/connection?data=eyJ1cmkiOiJpZGVuM2NvbW06Ly8...(truncated)",
    "multiParty": true,
    "numberOfResponses": 1,
    "state": "pending",
    "requestType": "did_exchange",
    "request": {
      "id": "18e3739d-7f6e-4865-a0b8-092e72119f6c",
      "thid": "18e3739d-7f6e-4865-a0b8-092e72119f6c",
      "typ": "application/iden3comm-plain-json",
      "type": "https://iden3-communication.io/authorization/1.0/request",
      "from": "did:iden3:polygon:amoy:2qUNf93PcLdfieMRDaiuGEzwfZvWZL6EbGWvSbiFUF",
      "body": {
        "callbackUrl": "https://polygon-agent.hovi.id/connection/did-exchange/18e3739d-7f6e-4865-a0b8-092e72119f6c",
        "scope": []
      }
    }
  }
}
```

## Credential Templates

Defines the JSON-LD schema blueprint (fields, types, required flags) for a credential type. Templates generate IPFS-hosted schema context documents referenced during Iden3 credential issuance.

### Create Template (JSON-LD)

`POST /credential-template/jsonld/create`

This route enables a organization to create a JSON-LD credential template, specifying the schema type, attributes, and structure for issuing JSON-LD credentials.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for creating a JSON-LD credential template. The schema context document is published to IPFS and the template is stored for use in Iden3 credential issuance flows. Attributes support primitive types (`string`, `integer`, `double`, `boolean`) and nested `object` types for structured claim hierarchies.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `categoryId` | string (uuid) | No | Optional industry or sector category UUID to classify this credential template within Hovi Studio (e.g., healthcare, education). If omitted, the template is created without a category. |
| `name` | string | Yes | Human-readable name of the credential template as it will appear in Hovi Studio and the holder's wallet (e.g., `"Patient ID 2"`). |
| `version` | string | Yes | Semantic version string for this template (e.g., `"1.0.1"`). Each unique `name` and `version` combination results in a distinct schema context document published to IPFS. Increment the version to publish schema changes since published schemas are immutable. |
| `image` | string (url) | No | Optional URL of the credential card background image displayed in the holder's wallet when this credential is issued and stored. |
| `description` | string | Yes | Plain-text description of what this credential represents (e.g., `"Patient ID Card"`). |
| `attributes` | array of object | Yes | Ordered list of `credentialSubject` claim field definitions for this JSON-LD credential template. Supports primitive types (`string`, `integer`, `double`, `boolean`) and structured `object` types with nested `attributes` for multi-level claim hierarchies (e.g., `address.street`, `organization.department.departmentName`). |
| `attributes[].name` | string | No | Programmatic field identifier used as the key in the JSON-LD `credentialSubject` (e.g., `"fullName"`, `"postalCode"`). Must be camelCase and unique within its parent attribute scope. |
| `attributes[].type` | string: `string`, `integer`, `double`, `boolean`, `object` | No | Data type of this claim field. `string` — plain text value. `integer` — whole number. `double` — floating-point number. `boolean` — true/false flag. `object` — structured nested claim; must include a child `attributes` array defining its sub-fields. |
| `attributes[].label` | string | No | Human-readable display label for this claim field shown in the holder's wallet UI and Hovi Studio (e.g., `"Full Name"`, `"Postal Code"`). |
| `attributes[].description` | string | No | Semantic description of this claim field explaining what data it represents (e.g., `"Full legal name"`, `"ZIP or postal code"`). |
| `attributes[].required` | boolean | No | Whether this claim field must be provided with a value during credential issuance. `true` — the field is mandatory and issuance will fail if omitted. `false` — the field is optional and may be left unpopulated. |
| `attributes[].attributes` | array of object | No | Nested sub-claim definitions for `object`-type attributes. Required when `type` is `"object"`. Supports recursive nesting — sub-attributes may themselves be of `type: "object"` with their own `attributes` array (e.g., `organization.department.departmentName`). |
| `schemaType` | string | Yes | The JSON-LD `@type` value embedded in all credentials issued from this template (e.g., `"Patient Record"`). This value is encoded into the IPFS-published schema context document and becomes the credential's semantic type identifier used by verifiers during presentation validation. |
| `credentialTheme` | object | No | Visual rendering metadata for the JSON-LD credential card displayed in Polygon ID-compatible wallets. |
| `credentialTheme.title` | string | No | Display title shown on the credential card. If omitted, the credential-template name is used. |
| `credentialTheme.description` | string | No | Short descriptive text shown on the credential card. |
| `credentialTheme.textColor` | string | No | Hex color code for the card text overlay. If omitted, `#000000` is used. |
| `credentialTheme.backgroundImageUrl` | string (url) | No | URL of the credential card background image. If omitted, a standard background image may be used. |
| `credentialTheme.logoUrl` | string (url) | No | URL of the issuer's logo image. If both logo fields are omitted, the organization's logo may be used. Required when `logoAlt` is provided. |
| `credentialTheme.logoAlt` | string | No | Accessibility alt-text for the logo image. If omitted when `logoUrl` is provided, the organization's display name is used. |
| `privadoCredentialType` | string | Yes | The Polygon ecosystem credential type identifier for this template (e.g., `"Patient Record"`). Used by the Polygon network to categorize and route credentials within its ecosystem. Typically matches `schemaType` but is stored and referenced independently within the Polygon registry. |

```json
{
  "categoryId": "9636b597-cbe2-492a-bf92-87641729e6e4",
  "name": "Patient ID 2",
  "version": "1.0.1",
  "image": "https://acme-corp.com/patient.png",
  "description": "Patient ID Card",
  "attributes": [
    {
      "name": "fullName",
      "type": "string",
      "label": "Full Name",
      "description": "Full legal name",
      "required": true,
      "attributes": [
        {}
      ]
    }
  ],
  "schemaType": "Patient Record",
  "credentialTheme": {
    "title": "Patient ID Card",
    "description": "Proof of admission in the hospital",
    "textColor": "#000000",
    "backgroundImageUrl": "https://static.vecteezy.com/system/resources/thumbnails/011/020/176/small/abstract-white-and-light-gray-wave-modern-soft-luxury-texture-with-smooth-and-clean-background-free-vector.jpg",
    "logoUrl": "https://1000logos.net/wp-content/uploads/2016/10/ACME-Logo-1981.png",
    "logoAlt": "Acme Corp"
  },
  "privadoCredentialType": "Patient Record"
}
```

**Responses**

- `201`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Internal Server Error

Example `201` response:

```json
{
  "success": true,
  "response": {
    "credentialTemplateId": "01b8e82f-6596-432f-85fb-4e1025bbac35",
    "schemaId": "b18ba975-bd6f-44dc-b23c-9560d2030e7a",
    "ecosystemId": "1d6e0184-e137-4a3b-bbb0-1a39216321bc",
    "organizationId": "0db20e29-b535-41f4-bff6-e4b607f59a52",
    "name": "Patient ID",
    "version": "1.0.1",
    "description": "Patient ID Card",
    "type": "jsonld",
    "image": "https://acme-corp.com/patient.png",
    "attributes": [
      {
        "name": "name",
        "label": "Name",
        "type": "string",
        "description": "Name of the patient",
        "required": true
      },
      {
        "name": "age",
        "label": "Age",
        "type": "string",
        "description": "Age of the patient",
        "required": true
      }
    ],
    "schemaUrl": "https://hovi.id/schemas/bafkreidnsspsutlwmuqhckkesbfukldxvl22ihje4wtoxo7btiqzzlsqwy",
    "schemaContext": "https://hovi.id/schemas/bafkreiajlvdphn5d53gzo4z6k6qw7us6rnphlwtyujdufdrtzds3g5tduq",
    "schemaType": "Patient",
    "createdAt": "2025-02-27T16:28:14.826Z",
    "updatedAt": "2025-02-27T16:28:14.826Z"
  }
}
```

### Import Template (JSON-LD)

`POST /credential-template/jsonld/import`

This route enables a organization to import a JSON-LD credential template by providing the schema URL. The schema is fetched from the provided URL, validated, and then resolved into a credential template within the ecosystem.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for importing an existing JSON-LD credential template by referencing a publicly hosted schema URL.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `categoryId` | string (uuid) | No | Optional industry/sector category UUID for the imported template. |
| `schemaUrl` | string (url) | Yes | Public URL of the JSON-LD schema document to import (e.g., IPFS gateway URL). |
| `image` | string (url) | No | Optional URL of the credential card image displayed in the holder's wallet. |

```json
{
  "categoryId": "2e5f483f-8970-4c5e-baf7-991ff24c120d",
  "schemaUrl": "https://hovi.id/schemas/QmRF7nnhYTsWu8sqA2jeLWbWP9LuuARS9RrWsL2akvwD7v",
  "image": "https://acme-corp.com/patient.png"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": {
    "credentialTemplateId": "7471bb29-e875-4462-996a-69b2379a5049",
    "schemaId": "ceff35e7-8625-40f3-a0f3-316784593e29",
    "ecosystemId": "c9ba491b-988f-481d-9c33-a5cc5aaff4ed",
    "organizationId": "99f009f6-aefa-4c13-bbe9-e5e314a64b1c",
    "categoryId": "2e5f483f-8970-4c5e-baf7-991ff24c120d",
    "name": "University Degree",
    "version": "2.0.2",
    "description": "University Degree credential template",
    "type": "jsonld",
    "image": "https://brandslogos.com/wp-content/uploads/images/large/acme-logo.png",
    "attributes": [
      {
        "name": "university",
        "type": "object",
        "label": "University title",
        "description": "name of the university",
        "required": true,
        "attributes": [
          {
            "name": "batch",
            "type": "object",
            "label": "Batch title",
            "description": "batch of the student",
            "required": true,
            "attributes": [
              {
                "name": "passingYear",
                "type": "integer",
                "label": "PassingYear title",
                "description": "passing year of the student",
                "required": true
              }
            ]
          },
          {
            "name": "branch",
            "type": "string",
            "label": "Branch",
            "description": "branch of the university",
            "required": true
          }
        ]
      },
      {
        "name": "fullName",
        "type": "string",
        "label": "Full Name",
        "description": "full name of the student",
        "required": true
      }
    ],
    "schemaUrl": "https://hovi.id/schemas/QmRF7nnhYTsWu8sqA2jeLWbWP9LuuARS9RrWsL2akvwD7v",
    "schemaType": "University Degree",
    "createdAt": "2024-08-12T11:21:32.464Z",
    "updatedAt": "2024-08-12T11:21:32.464Z"
  }
}
```

### Get Ecosystem Templates

`GET /credential-template/`

This route retrieves all credential templates or find a specific credential template by the credential template id. The templates provide a detailed structure of the credentials, including the attributes, their types, and requirements, as defined in the schema.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `credentialTemplateId` | query | string | No | By default, this endpoint returns a list of all your credential templates from current Ecosystem. You can pass a specific credentialTemplateId (in UUID format) here to filter the results and retrieve details for only that single credential template. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "credentialTemplateId": "ae5717a4-7f04-46a2-bf42-591cd226a7e2",
      "schemaId": "ee473b74-c97a-49f9-962e-eb84b493f644",
      "ecosystemId": "1d6e0184-e137-4a3b-bbb0-1a39216321bc",
      "organizationId": "de7e7ab5-109e-44d0-966d-78aa74d81ca7",
      "name": "Patient ID",
      "version": "1.0.1",
      "description": "Patient ID Card",
      "type": "jsonld",
      "image": "https://acme-corp.com/patient.png",
      "attributes": [
        {
          "name": "name",
          "label": "Name",
          "type": "string",
          "description": "Name of the patient",
          "required": true
        },
        {
          "name": "age",
          "label": "Age",
          "type": "string",
          "description": "Age of the patient",
          "required": true
        }
      ],
      "schemaUrl": "https://hovi.id/schemas/bafkreicqmxe3l6xraujo7ovdanrwxeh5q5uy32prku5ma2ziogofzsydya",
      "schemaContext": "https://hovi.id/schemas/bafkreigts7qmpygexrikxf3ypmm6tvb26plf2dlv744u2vzdlbdxm24ctm",
      "schemaType": "Patient",
      "privadoCredentialType": "jsonld-sig",
      "createdAt": "2024-11-12T13:22:36.153Z",
      "updatedAt": "2024-11-12T13:22:36.153Z"
    }
  ]
}
```

### Get Organization Templates

`GET /credential-template/organization`

This route retrieves all credential templates or find a specific credential template by the credential template id created by an organization.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `credentialTemplateId` | query | string | No | By default, this endpoint returns a list of all your credential templates from current organization. You can pass a specific credentialTemplateId (in UUID format) here to filter the results and retrieve details for only that single credential template. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "credentialTemplateId": "ae5717a4-7f04-46a2-bf42-591cd226a7e2",
      "schemaId": "ee473b74-c97a-49f9-962e-eb84b493f644",
      "ecosystemId": "1d6e0184-e137-4a3b-bbb0-1a39216321bc",
      "organizationId": "de7e7ab5-109e-44d0-966d-78aa74d81ca7",
      "name": "Patient ID",
      "version": "1.0.1",
      "description": "Patient ID Card",
      "type": "jsonld",
      "image": "https://acme-corp.com/patient.png",
      "attributes": [
        {
          "name": "name",
          "label": "Name",
          "type": "string",
          "description": "Name of the patient",
          "required": true
        },
        {
          "name": "age",
          "label": "Age",
          "type": "string",
          "description": "Age of the patient",
          "required": true
        }
      ],
      "schemaUrl": "https://hovi.id/schemas/bafkreicqmxe3l6xraujo7ovdanrwxeh5q5uy32prku5ma2ziogofzsydya",
      "schemaContext": "https://hovi.id/schemas/bafkreigts7qmpygexrikxf3ypmm6tvb26plf2dlv744u2vzdlbdxm24ctm",
      "schemaType": "Patient",
      "privadoCredentialType": "jsonld-sig",
      "createdAt": "2024-11-12T13:22:36.153Z",
      "updatedAt": "2024-11-12T13:22:36.153Z"
    }
  ]
}
```

### Delete Template

`DELETE /credential-template/delete`

This route allows a organization to delete a specific credential template by providing the credential template ID. The specified template is removed from the ecosystem, ensuring that it is no longer available for issuing credentials.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for deleting a credential template by its UUID.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `credentialTemplateId` | string (uuid) | Yes | UUID of the credential template to delete. |

```json
{
  "credentialTemplateId": "9636b597-cbe2-492a-bf92-87641729e6e4"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "message": "Credential template deleted successfully"
}
```

### Update Template

`PATCH /credential-template/update`

This route allows a organization to update a specific credential template by providing the schema ID. The specified template is updated with the new details provided by the organization, ensuring that the credential template remains accurate and up-to-date.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for updating an existing credential template.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `credentialTemplateId` | string (uuid) | Yes | UUID of the credential template to update. |
| `categoryId` | string (uuid) | No | Optional updated industry/sector category UUID. |
| `image` | string (url) | No | Optional updated credential card image URL. |

```json
{
  "credentialTemplateId": "9636b597-cbe2-492a-bf92-87641729e6e4",
  "categoryId": "9636b597-cbe2-492a-bf92-87641729e6e4",
  "image": "https://brandslogos.com/wp-content/uploads/images/large/acme-logo.png"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "message": "Credential Template updated successfully"
}
```

## Credentials

Issues JSON-LD Verifiable Credentials to holders via the Iden3 credential offer protocol. Holders claim credentials by scanning a QR code or deep link (`iden3comm://`) with a Polygon ID-compatible wallet.

### Get Credentials

`GET /credential/`

This route retrieves a list of all verifiable credentials issued by the organization.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `page` | query | integer | No | Page number for paginated results. Each page returns up to 100 results. Defaults to 1 if not provided. Example: `1` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "credentialExchangeId": "cf37f0fd-47a0-4f50-869f-b162c61a7270",
      "credentialType": "jsonld-sig",
      "state": "done",
      "revoked": false,
      "createdAt": "2024-08-05T10:58:05.907Z",
      "updatedAt": "2024-08-05T10:58:52.617Z"
    }
  ]
}
```

### Get Credential by Id

`GET /credential/find`

This route retrieves detailed information about a specific verifiable credential issued by the organization, identified by its unique credential exchange ID.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `credentialExchangeId` | query | string | Yes | Retrive detailed record credential by credential exchange id Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": {
    "credentialExchangeId": "cf37f0fd-47a0-4f50-869f-b162c61a7270",
    "credentialType": "jsonld-sig",
    "state": "done",
    "revoked": false,
    "requestType": "credential_exchange_request",
    "createdAt": "2024-08-05T10:58:05.907Z",
    "updatedAt": "2024-08-05T10:58:52.617Z",
    "credentialOfferUrl": "https://hovi.id/credential?data=eyJ1cmkiOiJpZGVuM2NvbW06Ly8...(truncated)",
    "credentialOfferUri": "iden3comm://?i_m=eyJpZCI6ImNmMzdmMGZkLTQ3YTAtNGY1MC04NjlmLWIxNjJjNjFhNzI3MCIsInRoaWQiOiJjZjM3ZjBmZC00N2EwLTRmNTAtODY5Zi1iMTYyYzYxYTcyNzAi...(truncated)",
    "credential": {
      "id": "urn:d5052970-901b-4693-a920-e41b4f1da749",
      "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://schema.iden3.io/core/jsonld/iden3proofs.jsonld",
        "https://hovi.id/schemas/QmPxUiou4B8A5ee8udcfY1GUxU4CehTi8ZtuSh1wivhqmx"
      ],
      "type": [
        "VerifiableCredential",
        "University Degree Record"
      ],
      "credentialSubject": {
        "university": {
          "batch": {
            "passingYear": 2021
          },
          "branch": "KHI"
        },
        "fullName": "John Doe",
        "id": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT",
        "type": "University Degree Record"
      },
      "issuer": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk",
      "issuanceDate": "2024-08-05T10:57:54.845Z",
      "expirationDate": null,
      "credentialSchema": {
        "id": "https://hovi.id/schemas/QmRF7nnhYTsWu8sqA2jeLWbWP9LuuARS9RrWsL2akvwD7v",
        "type": "JsonSchema2023"
      },
      "credentialStatus": {
        "id": "https://rhs-staging.polygonid.me/node?state=cd83bd788807c4ec304cc17b6b773b6ad4a68ad0ca6244ecaa0bf60f2abe1b19",
        "type": "Iden3ReverseSparseMerkleTreeProof",
        "revocationNonce": 4215561986
      },
      "proof": [
        {
          "type": "BJJSignature2021",
          "issuerData": {
            "id": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk",
            "state": {
              "rootOfRoots": "0000000000000000000000000000000000000000000000000000000000000000",
              "revocationTreeRoot": "0000000000000000000000000000000000000000000000000000000000000000",
              "claimsTreeRoot": "bedcfe8dac6fb708f2567023b9703e2c404894ce362e98b78540fffb73eb0908",
              "value": "cd83bd788807c4ec304cc17b6b773b6ad4a68ad0ca6244ecaa0bf60f2abe1b19"
            },
            "mtp": {
              "existence": true,
              "siblings": [],
              "nodeAux": null
            },
            "authCoreClaim": "cca3371a6cb1b715004407e325bd993c...(truncated)",
            "credentialStatus": {
              "id": "https://rhs-staging.polygonid.me/node?state=cd83bd788807c4ec304cc17b6b773b6ad4a68ad0ca6244ecaa0bf60f2abe1b19",
              "type": "Iden3ReverseSparseMerkleTreeProof",
              "revocationNonce": 0
            }
          },
          "coreClaim": "58aa9e5a86a0c14d8bca91d04c08dc30...(truncated)",
          "signature": "cb30f31a2bcec895ba7d4c70df1eaf81588c99d6ae09c3b64ce67c8239aa8c8f...(truncated)"
        }
      ]
    }
  }
}
```

### Offer Credential (JSON-LD)

`POST /credential/jsonld/offer`

This route allows the organization to generate a credential offer using the JSON-LD format. The credential issuance is based on a credential template that specifies the necessary attributes, types, and requirements.

**Related webhook events**

A later action in the flow can cause Hovi to send the following event to the registered webhook URL:

- [Credential Issued](#tag/webhook-events/webhook/post/polygon-credential-issued)

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for issuing a JSON-LD Verifiable Credential to a holder via the Iden3 credential offer protocol. The holder claims the credential by scanning the `credentialOfferUri` with a Polygon ID-compatible wallet.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `connectionId` | string (uuid) | Yes | UUID of the established Iden3comm connection to the holder's wallet. |
| `credentialTemplateId` | string (uuid) | Yes | UUID of the credential template to use for issuance. |
| `credentialValues` | object | Yes | Key-value pairs mapping claim field names (from the template) to their values. Supports nested objects. |
| `comment` | string | No | Optional plain-text comment attached to the credential offer. |

```json
{
  "connectionId": "89c02ee6-c60f-4e2c-b762-45810a566376",
  "credentialTemplateId": "ae5717a4-7f04-46a2-bf42-591cd226a7e2",
  "credentialValues": {
    "name": "John Doe",
    "age": "30"
  },
  "comment": "This is a comment"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": {
    "credentialExchangeId": "cf37f0fd-47a0-4f50-869f-b162c61a7270",
    "credentialType": "jsonld-sig",
    "credentialOfferUri": "iden3comm://?i_m=eyJpZCI6ImNmMzdmMGZkLTQ3YTAtNGY1MC04NjlmLWIxNjJjNjFhNzI3MCIsInRoaWQiOiJjZjM3ZjBmZC00N2EwLTRmNTAtODY5Zi1iMTYyYzYxYTcyNzAi...(truncated)",
    "credentialOfferUrl": "https://hovi.id/credential?data=eyJ1cmkiOiJpZGVuM2NvbW06Ly8...(truncated)",
    "createdAt": "2024-08-05T10:58:05.907Z",
    "updatedAt": "2024-08-05T10:58:05.907Z",
    "credentialOfferRequest": {
      "id": "cf37f0fd-47a0-4f50-869f-b162c61a7270",
      "thid": "cf37f0fd-47a0-4f50-869f-b162c61a7270",
      "typ": "application/iden3comm-plain-json",
      "type": "https://iden3-communication.io/credentials/1.0/offer",
      "from": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk",
      "to": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT",
      "body": {
        "url": "https://polygon-agent.hovi.id/credential/issue-credential/cf37f0fd-47a0-4f50-869f-b162c61a7270",
        "credentials": [
          {
            "id": "urn:d5052970-901b-4693-a920-e41b4f1da749",
            "description": ""
          }
        ]
      }
    },
    "credential": {
      "id": "urn:d5052970-901b-4693-a920-e41b4f1da749",
      "@context": [
        "https://www.w3.org/2018/credentials/v1",
        "https://schema.iden3.io/core/jsonld/iden3proofs.jsonld",
        "https://hovi.id/schemas/QmPxUiou4B8A5ee8udcfY1GUxU4CehTi8ZtuSh1wivhqmx"
      ],
      "type": [
        "VerifiableCredential",
        "University Degree Record"
      ],
      "credentialSubject": {
        "university": {
          "batch": {
            "passingYear": 2021
          },
          "branch": "KHI"
        },
        "fullName": "John Doe",
        "id": "did:iden3:polygon:amoy:2qWFZnE6b4NQRmWpeVAaHwMGYv2ccYNoLDakLX1LiT",
        "type": "University Degree Record"
      },
      "issuer": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk",
      "issuanceDate": "2024-08-05T10:57:54.845Z",
      "credentialSchema": {
        "id": "https://hovi.id/schemas/QmRF7nnhYTsWu8sqA2jeLWbWP9LuuARS9RrWsL2akvwD7v",
        "type": "JsonSchema2023"
      },
      "credentialStatus": {
        "id": "https://rhs-staging.polygonid.me/node?state=cd83bd788807c4ec304cc17b6b773b6ad4a68ad0ca6244ecaa0bf60f2abe1b19",
        "type": "Iden3ReverseSparseMerkleTreeProof",
        "revocationNonce": 4215561986
      },
      "proof": [
        {
          "type": "BJJSignature2021",
          "coreClaim": "58aa9e5a86a0c14d8bca91d04c08dc30...(truncated)",
          "signature": "cb30f31a2bcec895ba7d4c70df1eaf81588c99d6ae09c3b64ce67c8239aa8c8f...(truncated)"
        }
      ]
    }
  }
}
```

## Verification Templates

Defines Polygon proof request blueprints using `privadoProofScopes` — Iden3 `credentialAtomicQuerySigV2` circuit conditions that specify which credential attributes and query operators the holder must satisfy.

### Create Template (JSON-LD)

`POST /verification-template/jsonld/create`

This route allows a organization to create a JSON-LD verification template, outlining the policy for verifying issued JSON-LD credentials.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for creating a JSON-LD verification template. The `conditions` array maps to Iden3 `privadoProofScopes` — `credentialAtomicQuerySigV2` circuit conditions defining the ZK proof request.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `categoryId` | string (uuid) | No | Optional industry/sector category UUID for this verification template. |
| `contextUrl` | string (url) | No | Optional JSON-LD `@context` URL for the credential schema being verified (e.g., IPFS gateway URL). |
| `name` | string | Yes | Human-readable name of the verification template. |
| `version` | string | Yes | Semantic version string for this template. |
| `description` | string | Yes | Plain-text description of what this template verifies. |
| `image` | string (url) | No | Optional URL of an image displayed on the proof request screen. |
| `conditions` | array of object | No | Proof condition array. Each condition maps to one Iden3 `privadoProofScope` — a `credentialAtomicQuerySigV2` circuit query defining the ZK proof requirement. |
| `conditions[].allowedIssuers` | array of string | No | Accepted issuer DIDs. `["*"]` accepts credentials from any issuer. |
| `conditions[].credentialSubject` | object | No | Iden3 query conditions on credential subject fields. Supports `$eq`, `$in`, `$gt`, `$lt`, `$gte`, `$lte` operators on dot-notation field paths (e.g., `university.batch.passingYear`). |
| `restrictions` | object | No | Optional restrictions narrowing the acceptable credential types for this verification template. |
| `restrictions.credentialTemplateId` | string (uuid) | No | Optional UUID of a specific credential template to restrict verification to. |
| `restrictions.schemaType` | string | No | Optional JSON-LD `@type` value to restrict verification to (e.g., `"Patient Record"`). |

```json
{
  "categoryId": "9636b597-cbe2-492a-bf92-87641729e6e4",
  "contextUrl": "https://hovi.id/schemas/QmPxUiou4B8A5ee8udcfY1GUxU4CehTi8ZtuSh1wivhqmx",
  "name": "Patient ID Verification",
  "version": "1.0.1",
  "description": "Patient ID verification template",
  "image": "https://acme-corp.com/patient.png",
  "conditions": [
    {
      "allowedIssuers": [
        "*"
      ],
      "credentialSubject": {
        "university.batch.passingYear": {
          "$in": [
            2000,
            2021,
            2022
          ]
        }
      }
    },
    {
      "allowedIssuers": [
        "*"
      ],
      "credentialSubject": {
        "fullName": {
          "$eq": "John Doe"
        }
      }
    }
  ],
  "restrictions": {
    "credentialTemplateId": "ae5717a4-7f04-46a2-bf42-591cd226a7e2",
    "schemaType": "Patient Record"
  }
}
```

**Responses**

- `201`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Internal Server Error

Example `201` response:

```json
{
  "success": true,
  "response": {
    "verificationTemplateId": "796dbd9d-8b61-4180-b94d-df4a4e138378",
    "ecosystemId": "259c9647-5f27-49a7-9762-42d9231709a2",
    "organizationId": "c7a3c4ae-63d4-41d8-9d17-0fb402d4a6fd",
    "categoryId": "9636b597-cbe2-492a-bf92-87641729e6e4",
    "name": "University Degree Verification",
    "image": "https://picsum.photos/200",
    "version": "2.0.8",
    "description": "University Degree verification template",
    "type": "jsonld",
    "credentialType": "jsonld-sig",
    "privadoProofScopes": [
      {
        "circuitId": "credentialAtomicQuerySigV2",
        "id": 1,
        "query": {
          "allowedIssuers": [
            "*"
          ],
          "type": "University Degree Record",
          "credentialSubject": {
            "university.batch.passingYear": {
              "$in": [
                2000,
                2021,
                2022
              ]
            }
          }
        }
      },
      {
        "circuitId": "credentialAtomicQuerySigV2",
        "id": 2,
        "query": {
          "allowedIssuers": [
            "*"
          ],
          "type": "University Degree Record",
          "credentialSubject": {
            "fullName": {
              "$eq": "John Doe"
            }
          }
        }
      }
    ],
    "createdAt": "2024-08-05T11:01:31.997Z",
    "updatedAt": "2024-08-05T11:01:31.997Z"
  }
}
```

### Get Ecosystem Templates

`GET /verification-template/`

Retrieves verification templates from the current ecosystem. By default, all verification templates are returned.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `verificationTemplateId` | query | string | No | Filters the result by a specific verification template id. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "verificationTemplateId": "796dbd9d-8b61-4180-b94d-df4a4e138378",
      "ecosystemId": "259c9647-5f27-49a7-9762-42d9231709a2",
      "organizationId": "c7a3c4ae-63d4-41d8-9d17-0fb402d4a6fd",
      "categoryId": "9636b597-cbe2-492a-bf92-87641729e6e4",
      "name": "University Degree Verification",
      "image": "https://picsum.photos/200",
      "version": "2.0.8",
      "description": "University Degree verification template",
      "type": "jsonld",
      "credentialType": "jsonld-sig",
      "privadoProofScopes": [
        {
          "circuitId": "credentialAtomicQuerySigV2",
          "id": 1,
          "query": {
            "allowedIssuers": [
              "*"
            ],
            "type": "University Degree Record",
            "credentialSubject": {
              "university.batch.passingYear": {
                "$in": [
                  2000,
                  2021,
                  2022
                ]
              }
            }
          }
        },
        {
          "circuitId": "credentialAtomicQuerySigV2",
          "id": 2,
          "query": {
            "allowedIssuers": [
              "*"
            ],
            "type": "University Degree Record",
            "credentialSubject": {
              "fullName": {
                "$eq": "John Doe"
              }
            }
          }
        }
      ],
      "createdAt": "2024-08-05T11:01:31.997Z",
      "updatedAt": "2024-08-05T11:01:31.997Z"
    }
  ]
}
```

### Get Organization Templates

`GET /verification-template/organization`

Retrieves verification templates for a specific organization. By default, all verification templates are returned.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `verificationTemplateId` | query | string | No | Filters the result by a specific verification template id for a specific organization. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "verificationTemplateId": "796dbd9d-8b61-4180-b94d-df4a4e138378",
      "ecosystemId": "259c9647-5f27-49a7-9762-42d9231709a2",
      "organizationId": "c7a3c4ae-63d4-41d8-9d17-0fb402d4a6fd",
      "categoryId": "9636b597-cbe2-492a-bf92-87641729e6e4",
      "name": "University Degree Verification",
      "image": "https://picsum.photos/200",
      "version": "2.0.8",
      "description": "University Degree verification template",
      "type": "jsonld",
      "credentialType": "jsonld-sig",
      "privadoProofScopes": [
        {
          "circuitId": "credentialAtomicQuerySigV2",
          "id": 1,
          "query": {
            "allowedIssuers": [
              "*"
            ],
            "type": "University Degree Record",
            "credentialSubject": {
              "university.batch.passingYear": {
                "$in": [
                  2000,
                  2021,
                  2022
                ]
              }
            }
          }
        },
        {
          "circuitId": "credentialAtomicQuerySigV2",
          "id": 2,
          "query": {
            "allowedIssuers": [
              "*"
            ],
            "type": "University Degree Record",
            "credentialSubject": {
              "fullName": {
                "$eq": "John Doe"
              }
            }
          }
        }
      ],
      "createdAt": "2024-08-05T11:01:31.997Z",
      "updatedAt": "2024-08-05T11:01:31.997Z"
    }
  ]
}
```

### Delete Template by Verification Template Id

`DELETE /verification-template/delete`

This route is used to delete a specific verification template by its unique id.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for deleting a verification template by its UUID.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `verificationTemplateId` | string (uuid) | Yes | UUID of the verification template to delete. |

```json
{
  "verificationTemplateId": "9636b597-cbe2-492a-bf92-87641729e6e4"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "message": "Verification Template deleted successfully"
}
```

### Update Template by Verification Template Id

`PATCH /verification-template/update`

This route is used to update a specific verification template by its unique id.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for updating an existing verification template.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `verificationTemplateId` | string (uuid) | Yes | UUID of the verification template to update. |
| `categoryId` | string (uuid) | No | Optional updated industry/sector category UUID. |
| `name` | string | No | Optional updated name. |
| `description` | string | No | Optional updated description. |
| `image` | string (url) | No | Optional updated image URL. |

```json
{
  "verificationTemplateId": "796dbd9d-8b61-4180-b94d-df4a4e138378",
  "categoryId": "9636b597-cbe2-492a-bf92-87641729e6e4",
  "name": "Updated Verification Template Name",
  "description": "Updated description",
  "image": "https://acme-corp.com/updated-image.png"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "message": "Verification Template updated successfully"
}
```

## Verifications

Sends Iden3-based proof requests to holders and validates the submitted ZK proofs. Holders respond by scanning the `proofRequestUri` or `verificationUrl` with a Polygon ID-compatible wallet.

### Send Proof Request

`POST /verification/send-proof-request`

Create a proof request for a credential holder using verification template.

**Related webhook events**

A later action in the flow can cause Hovi to send the following event to the registered webhook URL:

- [Presentation Verified](#tag/webhook-events/webhook/post/polygon-presentation-verified)

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Request body** (`application/json`)

Request body for sending a Polygon proof request to a holder wallet. The `proofRequestUri` (`iden3comm://`) and `verificationUrl` are encoded into a QR code or deep link for the holder to scan and submit a ZK proof.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `verificationTemplateId` | string (uuid) | Yes | UUID of the verification template defining the proof scopes for this request. |
| `connectionId` | string (uuid) | No | UUID of the established Iden3comm connection to the holder's wallet. |

```json
{
  "verificationTemplateId": "796dbd9d-8b61-4180-b94d-df4a4e138378",
  "connectionId": "89c02ee6-c60f-4e2c-b762-45810a566376"
}
```

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": {
    "proofExchangeId": "ac63dbf7-29dd-44e3-bf0d-3788b09e12b5",
    "verificationUrl": "https://hovi.id/verification?data=eyJ1cmkiOiJpZGVuM2NvbW06Ly8...(truncated)",
    "proofRequestUri": "iden3comm://?i_m=eyJpZCI6ImFjNjNkYmY3...(truncated)",
    "createdRequest": {
      "id": "ac63dbf7-29dd-44e3-bf0d-3788b09e12b5",
      "thid": "ac63dbf7-29dd-44e3-bf0d-3788b09e12b5",
      "typ": "application/iden3comm-plain-json",
      "type": "https://iden3-communication.io/authorization/1.0/request",
      "from": "did:iden3:polygon:amoy:2qQSaniB8hK6VRqwJVy5ch56JfYNAGFXKzKj81nQkk",
      "body": {
        "callbackUrl": "https://polygon-agent-dev.hovi.id/proof/verify-presentation/ac63dbf7-29dd-44e3-bf0d-3788b09e12b5",
        "scope": [
          {
            "circuitId": "credentialAtomicQuerySigV2",
            "id": 1,
            "query": {
              "allowedIssuers": [
                "*"
              ],
              "type": "University Degree Record 7",
              "credentialSubject": {
                "university.batch.passingYear": {
                  "$in": [
                    2000,
                    2021,
                    2022
                  ]
                }
              }
            }
          },
          {
            "circuitId": "credentialAtomicQuerySigV2",
            "id": 2,
            "query": {
              "allowedIssuers": [
                "*"
              ],
              "type": "University Degree Record 7",
              "credentialSubject": {
                "fullName": {
                  "$eq": "John Doe"
                }
              }
            }
          }
        ]
      }
    }
  }
}
```

### Get Proof Requests

`GET /verification/proof-request`

This route retrieves all proof requests initiated by a specific organization. Proof requests are used to verify credentials that have been issued to credential holders.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `state` | query | string: `pending`, `done`, `abandoned` | No | Filter proof requests by state Example: `pending` |
| `page` | query | integer | No | Page number for paginated results. Each page returns up to 100 results. Defaults to 1 if not provided. Example: `1` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "proofExchangeId": "acd42bba-891b-4577-9218-a51ce3f67e37",
      "state": "done",
      "isVerified": true,
      "createdAt": "2024-08-02T11:35:13.926Z",
      "updatedAt": "2024-08-02T11:38:54.481Z",
      "numberOfResponses": 1
    },
    {
      "proofExchangeId": "5896d0ce-8b0b-4de4-a76e-ab01c0bb72f8",
      "state": "pending",
      "isVerified": false,
      "createdAt": "2024-08-02T11:42:54.065Z",
      "updatedAt": "2024-08-02T11:42:54.065Z",
      "numberOfResponses": 0
    }
  ]
}
```

### Find Proof Request by Proof Exchange Id

`GET /verification/proof-request/find`

This route retrieves a specific proof request by its proof exchange id. The proof request contains details about the verification process initiated by the tenant.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `proofExchangeId` | query | string | Yes | Specifies the proof exchange id used to retrieve a specific proof request. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": {
    "proofExchangeId": "acd42bba-891b-4577-9218-a51ce3f67e37",
    "state": "done",
    "isVerified": true,
    "createdAt": "2024-08-02T11:35:13.926Z",
    "updatedAt": "2024-08-02T11:38:54.481Z",
    "isMultiParty": false,
    "numberOfResponses": 1,
    "requestType": "presentation_exchange_request",
    "verificationUrl": "https://hovi.id/verification?data=eyJ1cmkiOiJpZGVuM2NvbW06Ly8...(truncated)",
    "proofRequestUri": "iden3comm://?i_m=eyJpZCI6ImFjZDQyYmJhLTg5MWItNDU3Ny05MjE4...(truncated)",
    "request": {
      "id": "acd42bba-891b-4577-9218-a51ce3f67e37",
      "thid": "acd42bba-891b-4577-9218-a51ce3f67e37",
      "typ": "application/iden3comm-plain-json",
      "type": "https://iden3-communication.io/authorization/1.0/request",
      "from": "did:iden3:polygon:amoy:2qUNf93PcLdfieMRDaiuGEzwfZvWZL6EbGWvSbiFUF",
      "body": {
        "callbackUrl": "https://polygon-agent-dev.hovi.id/proof/verify-presentation/acd42bba-891b-4577-9218-a51ce3f67e37",
        "scope": [
          {
            "circuitId": "credentialAtomicQuerySigV2",
            "id": 1722589673,
            "query": {
              "allowedIssuers": [
                "*"
              ],
              "context": "https://hovi.id/schemas/QmPxUiou4B8A5ee8udcfY1GUxU4CehTi8ZtuSh1wivhqmx",
              "type": "University Degree Record 7",
              "credentialSubject": {
                "university.batch.passingYear": {
                  "$gt": 2000
                }
              }
            }
          }
        ]
      }
    }
  }
}
```

### Get Proof Responses

`GET /verification/proof-response`

This route retrieves all responses received from credential holders in response to the proof requests issued by a organization. Proof responses contain the presentation submitted by the credential holder to fulfill the proof request.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `page` | query | integer | No | Page number for paginated results. Each page returns up to 100 results. Defaults to 1 if not provided. Example: `1` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "createdAt": "2024-08-06T11:29:03.807Z",
      "updatedAt": "2024-08-06T11:29:03.807Z",
      "proofExchangeId": "b030a308-8ede-4339-be4c-7c91651056fd",
      "isVerified": true,
      "presentationId": "0f6bf2a7-4f99-4253-bd44-5299cf904ac5",
      "response": {
        "id": "140f5673-8c4d-49df-ad98-693ad0278554",
        "typ": "application/iden3-zkp-json",
        "type": "https://iden3-communication.io/authorization/1.0/response",
        "thid": "b030a308-8ede-4339-be4c-7c91651056fd",
        "from": "did:iden3:polygon:amoy:2qUts7TyXR7TPD4EfEtvh9EvCuR8NEjokpkWzGMRdN",
        "to": "did:iden3:polygon:amoy:2qUNf93PcLdfieMRDaiuGEzwfZvWZL6EbGWvSbiFUF",
        "body": {
          "did_doc": {
            "context": [
              "https://www.w3.org/ns/did/v1"
            ],
            "id": "did:iden3:polygon:amoy:2qUts7TyXR7TPD4EfEtvh9EvCuR8NEjokpkWzGMRdN",
            "service": [
              {
                "id": "did:iden3:polygon:amoy:2qUts7TyXR7TPD4EfEtvh9EvCuR8NEjokpkWzGMRdN#mobile",
                "type": "Iden3MobileServiceV1",
                "serviceEndpoint": "iden3comm:v0.1:callbackHandler"
              },
              {
                "id": "did:iden3:polygon:amoy:2qUts7TyXR7TPD4EfEtvh9EvCuR8NEjokpkWzGMRdN#push",
                "type": "push-notification",
                "serviceEndpoint": "https://push-staging.polygonid.com/api/v1",
                "metadata": {
                  "devices": [
                    {
                      "ciphertext": "0dy1wf8F5b...(truncated)",
                      "alg": "RSA-OAEP-512"
                    }
                  ]
                }
              }
            ]
          },
          "message": null,
          "scope": []
        }
      }
    }
  ]
}
```

### Find Proof Response by Presentation Id

`GET /verification/proof-response/find`

This route retrieves a specific proof response by its unique presentation id or proof exchange id. The proof response contains the presentation data submitted by the credential holder in response to a particular proof request.

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `x-organization-id` | header | string | Yes | The unique identifier of the organization (tenant) in UUID format. Example: `123e4567-e89b-12d3-a456-426614174000` |
| `presentationId` | query | string | No | Retrive detailed proof presentation by presentation id Example: `123e4567-e89b-12d3-a456-426614174000` |
| `proofExchangeId` | query | string | No | Retrive detailed proof presentation by proof exchange id Example: `123e4567-e89b-12d3-a456-426614174000` |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `200`: Success
- `400`: Bad Request
- `401`: Unauthorized
- `404`: Not found
- `500`: Internal Server Error

Example `200` response:

```json
{
  "success": true,
  "response": [
    {
      "createdAt": "2024-08-02T11:38:54.237Z",
      "updatedAt": "2024-08-02T11:38:54.237Z",
      "proofExchangeId": "acd42bba-891b-4577-9218-a51ce3f67e37",
      "isVerified": true,
      "presentationId": "d78c9b23-427e-402c-a8d6-25bbee602597"
    }
  ]
}
```

## Other

### GET /verification/session/document-coverage

`GET /verification/session/document-coverage`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `default`: No description

### GET /verification/session/{sessionId}/redirect-target

`GET /verification/session/{sessionId}/redirect-target`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sessionId` | path | string | Yes |  |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `500`: Internal Server Error

### POST /verification/session/{sessionId}/id-verification/document

`POST /verification/session/{sessionId}/id-verification/document`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sessionId` | path | string | Yes |  |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `500`: Internal Server Error

### POST /verification/session/{sessionId}/id-verification/passive-liveness

`POST /verification/session/{sessionId}/id-verification/passive-liveness`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sessionId` | path | string | Yes |  |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `500`: Internal Server Error

### POST /verification/session/{sessionId}/id-verification/face-match

`POST /verification/session/{sessionId}/id-verification/face-match`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sessionId` | path | string | Yes |  |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `500`: Internal Server Error

### POST /verification/session/{sessionId}/id-verification/ip-risk

`POST /verification/session/{sessionId}/id-verification/ip-risk`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sessionId` | path | string | Yes |  |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `500`: Internal Server Error

### GET /verification/session/{sessionId}/evidence

`GET /verification/session/{sessionId}/evidence`

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `sessionId` | path | string | Yes |  |
| `Authorization` | header | string | Yes | Ecosystem API Key. Must be prefixed with "Bearer ". Example: `Bearer YOUR_ECOSYSTEM_API_KEY` |

**Responses**

- `default`: No description
