---
title: "Get a numscript"
method: GET
path: "/v3/{ledgerName}/numscripts/{name}"
tags: ["Numscript Library"]
---

# Get a numscript

`GET /v3/{ledgerName}/numscripts/{name}`

## Request

- Base URL: `http://localhost:9000`
- URL: `http://localhost:9000/v3/{ledgerName}/numscripts/{name}`
- Auth: one of:
  - HTTP bearer
  - none

Retrieves a numscript by name from a ledger. Use the `version` query parameter to get a specific
semver version. If omitted or empty, the latest version is returned.

## Path parameters

- `ledgerName` string, required
- `name` string, required

## Query parameters

- `version` string

## Headers

- `X-Consistency` 'linearizable' | 'stale'

## Response `200`

Numscript retrieved successfully

- GetNumscriptResponse
  - `data` NumscriptInfo, required
    - `name` string, required: Name of the numscript
    - `content` string: The numscript source code
    - `version` string: Semver version string (e.g. "1.0.0")
    - `createdAt` string, date-time: Creation/update timestamp (ISO 8601 format)
    - `ledger` string: Ledger name this numscript belongs to

## Other responses

- `400`: Bad request
- `401`: Authentication required (missing or invalid JWT token)
- `403`: Insufficient permissions (missing required scope)
- `404`: Numscript not found
- `405`: Method not allowed
- `500`: Internal server error
- `503`: Service unavailable — the server cannot serve the request right now but an immediate retry can succeed. The `errorCode` field discriminates the cause: `NO_LEADER` (no elected Raft leader), `CACHE_HORIZON_EXCEEDED` (admission snapshot too old, retry against a fresh one), `UNAVAILABLE` (an internal forwarded stream was torn down mid-transfer), or the reason of any domain error of the unavailable kind (e.g. `INDEX_BUILDING`).

## Changes

- **2026-11-03** `f5e817eca038`: 1 info
  - api operation id `getNumscript` removed and replaced with `v3GetNumscript`
- **2026-10-08** `3da23d327316`: 3 info
  - the endpoint scheme security `BearerAuth` was added to the API
  - added the non-success response with the status `401`
  - added the non-success response with the status `403`
- **2026-10-08** `b3ee1959d86a`: 1 info
  - added the new optional `header` request parameter `X-Consistency`
- **2026-09-30** `b747efd5cd77`: 1 info
  - endpoint added
- **2026-09-29** `6ff73ac9a6bd`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/formancehq/apis/ledger-api/changes/v3/:ledgerName/numscripts/:name/get.md)

---

[API](https://skmtc.dev/formancehq/apis/ledger-api.md) - [All operations](https://skmtc.dev/formancehq/apis/ledger-api/llms.txt) - [OpenAPI document](https://skmtc.dev/formancehq/apis/ledger-api/revisions/f5e817eca038?raw)
