> ## Documentation Index
> Fetch the complete documentation index at: https://docs.world.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Unique Document Issuer

> Unique Document Issuer endpoints and internal documentation.

The Unique Document issuer exposes endpoints for issuing and migrating credentials. For product-level credential semantics, Sybil-resistance guarantees, and validity details, see [Proof of Attributes](https://docs.world.org/world-id/credentials/9303.md).

> [!NOTE]
>
> The base URL is environment-specific. Contact your World ID point of contact for
> environment endpoints and access.

## Migration

> [!WARNING]
>
> This endpoint is intended for World ID v3 holders to obtain v4 credentials. It is not a general re-issuance endpoint for v4 holders.

**method** `POST`

/v2/migrate

**Content-Type:** `application/json`

### Request

#### Headers

<table>
  <thead>
    <tr>
      <th>Header</th>
      <th>Required</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `x-zkp-proof`

        `string`
      </td>

      <td>yes</td>
      <td>Base64-encoded JSON containing the ZKP proof and identity commitment.</td>
    </tr>

    <tr>
      <td>
        `attestation-gateway-token`

        `string`
      </td>

      <td>yes</td>
      <td>Attestation gateway token for device integrity verification.</td>
    </tr>
  </tbody>
</table>

#### Body fields

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Required</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `identityCommitment`

        `string`
      </td>

      <td>yes</td>

      <td>
        The holder's identity commitment (decimal or hex with `0x`&#x20;
        prefix). Must match the ZKP header.
      </td>
    </tr>

    <tr>
      <td>
        `sub`

        `string`
      </td>

      <td>yes</td>

      <td>
        World ID 4.0 blinded subject identifier (hex with `0x`&#x20;
        prefix, 256-bit). Must match previous migrations for this identity.
      </td>
    </tr>

    <tr>
      <td>
        `credential`

        `object`
      </td>

      <td>yes</td>

      <td>
        Flow-specific credential data (see below). The client decrypts PCP data
        locally before submission.
      </td>
    </tr>
  </tbody>
</table>

#### Credential fields

**Passport / eID**

The `credential` object contains data extracted and decrypted from the user's Personal Custody Package (PCP) by the client.

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `credential.sod`

        `string`
      </td>

      <td>
        Base64-encoded SOD (Security Object Document) in DER format from
        the identity document.
      </td>
    </tr>

    <tr>
      <td>
        `credential.verification_metadata`

        `string`
      </td>

      <td>
        Base64-encoded verification metadata from the original document
        check.
      </td>
    </tr>
  </tbody>
</table>

```json theme={"system"}
{
  "identityCommitment": "0x000000000000000000000000000000000000000000000000000000000000000c",
  "sub": "0x000000000000000000000000000000000000000000000000000000000000002a",
  "credential": {
    "sod": "<base64-sod-der>",
    "verification_metadata": "<base64-json>"
  }
}
```

**MNC (My Number Card)**

<table>
  <thead>
    <tr>
      <th>Field</th>
      <th>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `credential.sd_jwt`

        `string`
      </td>

      <td>SD-JWT (Selective Disclosure JWT) from the MNC verification flow.</td>
    </tr>
  </tbody>
</table>

```json theme={"system"}
{
  "identityCommitment": "0x000000000000000000000000000000000000000000000000000000000000000c",
  "sub": "0x000000000000000000000000000000000000000000000000000000000000002a",
  "credential": {
    "sd_jwt": "<sd-jwt-string>"
  }
}
```

### Response

#### Success response

```json theme={"system"}
{
  "result": {
    "credential": "<base64-encoded World ID v4 credential>"
  }
}
```

#### Error responses

| Status | Error | Description |
| - | - | - |
| 400 | `invalid_data` | Request payload is malformed or missing required fields. |
| 400 | `sub_mismatch` | `sub` does not match the one used in previous migrations for this identity. |
| 400 | `document_expired` | The identity document has expired and cannot be used for migration. |
| 401 | `unauthorized` | Authentication failed. |
| 404 | `not_found` | No matching enrollment record found for this credential. |

## Planned Endpoints

### Enrollment Coming soon

Details coming soon.

### Re-issuance Coming soon

Details coming soon.

## Implementation Notes

> [!NOTE]
>
> This is advanced documentation about the internal workings of the credential and is not relevant for RP integration.

### Associated Data

The associated data of this credential contains different data groups found in the original document. More information coming soon.

#### Associated Data Commitment

To ensure the associated data has guaranteed integrity and can be re-used in the future for credential re-issuance, the commitment is computed as follows:

1. For ICAO-9303 documents, the message digest of the `EF.SOD` signature is used. The message digest is obtained from `SignedData.SignerInfos[0].SignedAttrs` where the signed attribute for the digest is identified by the Object Identifier `1.2.840.113549.1.9.4`. This digest is then hashed with the `blake3` hashing function from the raw bytes. Finally, the `blake3` hash is converted to a field element with modulo reduction.
2. Information on MNC documents coming soon.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.