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

# JSON API

> HTTP/JSON interface to the Canton Ledger API

The JSON API provides an HTTP/REST interface to the Canton Ledger API. In Canton 3.x, it is integrated directly into the participant node and translates JSON HTTP requests into gRPC Ledger API calls.

## Quick Reference

| Property           | Value                |
| ------------------ | -------------------- |
| **Protocol**       | HTTP/1.1 + JSON      |
| **Default port**   | 7575                 |
| **Underlying API** | Ledger API v2 (gRPC) |
| **Authentication** | JWT Bearer tokens    |

## When to Use the JSON API

The JSON API is the recommended access method when:

* You're building browser-based frontends or web applications
* Your language/framework works better with HTTP/JSON than gRPC
* You want simpler tooling for development and debugging (curl, Postman, etc.)
* You're using the TypeScript/JavaScript Wallet SDK

Use gRPC directly when:

* You need maximum performance for high-throughput streaming
* You're using Java and want the native gRPC experience
* You need access to gRPC-specific features not exposed via JSON

## Key Endpoints

### Version Check

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl http://localhost:7575/v2/version
```

### Command Submission

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl localhost:7575/v2/commands/submit-and-wait \
  -H "Content-Type: application/json" \
  -d '{
    "commands": [
      {
        "CreateCommand": {
          "createArguments": {
            "issuer": "<partyId>",
            "owner": "<partyId>",
            "name": "Example Asset Name"
          },
          "templateId": "#json-tests:Main:Asset"
        }
      }
    ],
    "userId": "ledger-api-user",
    "commandId": "example-app-create-1234",
    "actAs": ["<partyId>"],
    "readAs": ["<partyId>"]
  }'
```

Other submission endpoints include `/v2/commands/submit-and-wait-for-transaction` (returns the full transaction) and `/v2/commands/async/submit` (returns immediately).

### Active Contract Queries

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl localhost:7575/v2/state/active-contracts \
  -H "Content-Type: application/json" \
  -d '{
    "eventFormat": {
      "filtersByParty": {},
      "filtersForAnyParty": {
        "cumulative": [
          {
            "identifierFilter": {
              "WildcardFilter": {
                "value": {
                  "includeCreatedEventBlob": true
                }
              }
            }
          }
        ]
      },
      "verbose": false
    },
    "verbose": false,
    "activeAtOffset": 20
  }'
```

### Transaction Streaming

The JSON API supports both HTTP POST and WebSocket connections for streaming updates. Use `/v2/updates` or `/v2/updates/flats` for flat transaction streams, and `/v2/updates/trees` for transaction trees. WebSocket connections use the `daml.ws.auth` subprotocol.

### Ledger End

`GET /v2/state/ledger-end` returns the latest absolute offset on the participant. Use it as the `activeAtOffset` value when querying the ACS to get the most recent state, or pass an older non-pruned offset to read state at a historical point.

### Interactive Submission

External-party command submission goes through two endpoints rather than the standard `submit-and-wait` flow:

* `POST /v2/interactive-submission/prepare` — produces a prepared transaction the external party signs off-participant.
* `POST /v2/interactive-submission/execute` — submits the signed prepared transaction back to the participant for ledger execution.

See [Validator API](/sdks-tools/api-reference/splice-validator-api) for the surrounding external-signing flow.

## Configuration

The JSON API is configured via the `http-ledger-api` section of the participant node's configuration. In cn-quickstart LocalNet deployments, it is pre-configured and available at `http://localhost:7575`.

The OpenAPI and AsyncAPI specifications are available at runtime:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl http://localhost:7575/docs/openapi
curl http://localhost:7575/docs/asyncapi
```

## Authentication

Pass a JWT Bearer token in the `Authorization` header:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -H "Authorization: Bearer <token>" http://localhost:7575/v2/...
```

The token must be valid for the OIDC provider configured for your deployment.

## Related Pages

* [Ledger API](/sdks-tools/api-reference/ledger-api) — gRPC Ledger API overview
* [Ledger API Reference (AppDev)](/api-reference) — Detailed service documentation
* [Wallet Configuration](/integrations/wallet/configuration) — SDK configuration including JSON API endpoints
