---
title: "Execute a Cadence Script"
method: POST
path: "/scripts"
tags: ["Scripts"]
---

# Execute a Cadence Script

`POST /scripts`

Executes a read-only Cadence script against the execution state at the given block height or ID. If block height or ID is not specified, then the script is executed at the latest sealed block height.

## Query parameters

- `block_id` string, hexadecimal — A 32-byte unique identifier for an entity.
- `block_height` union
  - string, uint64
  - 'final' | 'sealed'

## Request body

- ScriptsBody
  - `script` string, base64 — Base64 encoded content of the Cadence script.
  - `arguments` string[] — An list of arguments each encoded as Base64 passed in the [JSON-Cadence interchange format](https://docs.onflow.org/cadence/json-cadence-spec/).

## Response `200`

OK

- InlineResponse200
  - `value` string, byte

## Other responses

- `400` — Bad Request
- `500` — Internal Server Error

## Changes

> 50 revisions in range; 1 could not be searched.

- **2022-04-21** `ab44cd3bb026` — 1 breaking
  - the `script` request property type/format changed from `string`/`byte` to `string`/`base64`
- **2022-01-31** `7dfe2dc54c38` — 1 breaking
  - the `script` request property type/format changed from `string`/`base64` to `string`/`byte`

[Change history](https://skmtc.dev/onflow/apis/access-api/changes/scripts/post.md)

---

[API](https://skmtc.dev/onflow/apis/access-api.md) · [All operations](https://skmtc.dev/onflow/apis/access-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/onflow/access-api/revisions/fd121c1fddf8/schema)
