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

# API Reference

> Moca Network REST API reference — server-to-server endpoints for credential issuance, issuance status, catalog browsing, and partner operations.

The Moca Network REST API enables server-to-server operations that do not require user presence. Use it for backend automation, credential issuance into encrypted DStorage, programmatic status checks, and browsing the credential catalog. Issuers sign credentials with their own keys and encrypt them to the holder; AIR stores and routes opaque ciphertext and metadata only.

## Base URLs

| Environment | Base URL                                    |
| ----------- | ------------------------------------------- |
| Sandbox     | `https://api.sandbox.mocachain.org/v1`      |
| Production  | `https://mocachain-mainnet.api.air3.com/v1` |

## Authentication

Authentication depends on the credential surface:

* Direct AIR endpoints (`initialize-user` and `dstorage/vcs`) use a **Partner JWT** in `x-partner-auth`.
* AIR calls issuer-hosted `available-vc` and `issue-vc` endpoints with `x-api-key`.
* Public credential-status endpoints do not require authentication.
* Self-hosted admin endpoints use `x-admin-api-key`.

For direct AIR endpoints, sign the Partner JWT with your private key (RS256 or ES256) and include:

| Claim       | Required | Description                                    |
| ----------- | -------- | ---------------------------------------------- |
| `partnerId` | Yes      | Your Partner ID from the Developer Dashboard   |
| `scope`     | Yes      | Operation scope (e.g. `"issue"` or `"verify"`) |
| `exp`       | Yes      | Expiration timestamp (recommended: 5 minutes)  |

For direct issuance, do not put the recipient email in the v1 Partner JWT. Send it in the `POST /auth/initialize-user` request body instead. Other operations, such as custom user authentication, have their own claim requirements.

The JWT header must include `kid` (Key ID) matching a key in your JWKS endpoint and `typ: "JWT"`.

For full setup instructions, key generation, and code examples see [Partner Authentication](/airkit/usage/partner-authentication).

**Catalog endpoints** are public and require no authentication.

**API Playground:** Requests from the Try it out playground are sent directly from your browser to the API. Your API must allow CORS from your docs origin (e.g. your Mintlify subdomain or custom domain) for the playground to work. If you see 403 from the playground, check that the API allows the request origin and that your Partner JWT is valid.

## Credentials

Server-side credential issuance resolves the recipient and stores an issuer-signed, holder-encrypted credential in DStorage. See the [Issuance API Reference](/airkit/usage/credential/issuance-api) for the `initialize-user` and `dstorage/vcs` endpoints, request and response details, and code examples.

## Catalog

<Warning>
  **Sandbox only at this stage.** Catalog endpoints are available exclusively on `https://api.sandbox.mocachain.org/v1` during the pilot. They are under active development and may change without notice — not yet available in production.
</Warning>

<CardGroup cols={2}>
  <Card title="Browse schemas" icon="table-layout" href="/api-reference/catalog/browse-schemas">
    Paginated list of credential schemas with credential count and number of issuers. Sortable by popularity or title.
  </Card>

  <Card title="Schema detail" icon="table-layout" href="/api-reference/catalog/schema-detail">
    Single schema with every credential built on it, including issuer info and traction metrics.
  </Card>

  <Card title="Credential detail" icon="id-badge" href="/api-reference/catalog/credential-detail">
    Full credential profile: data points, issuer identity, holder/issuance/verification metrics, linked programs, and availability window.
  </Card>

  <Card title="Browse programs" icon="list-check" href="/api-reference/catalog/browse-programs">
    Paginated list of verification programs with verification counts and accepted credential types.
  </Card>

  <Card title="Program detail" icon="list-check" href="/api-reference/catalog/program-detail">
    Verification program with verifier identity, pricing model, accepted credentials, and ZK verification conditions.
  </Card>

  <Card title="Search catalog" icon="magnifying-glass" href="/api-reference/catalog/search-catalog">
    Full-text search across credentials, issuers, and programs with relevance-ranked grouped results.
  </Card>
</CardGroup>

## Code examples

For end-to-end integration examples including issue-and-poll flows, webhook-driven issuance, and retry logic, see [Issuance API Reference](/airkit/usage/credential/issuance-api).
