> For the complete documentation index, see [llms.txt](https://docs.herodotus.dev/herodotus-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.herodotus.dev/herodotus-docs/developers/api-docs/program-registry.md).

# Program Registry API

{% hint style="info" %}
Note that this program registry and module feature is beta.
{% endhint %}

## Program Registry API

The Program Registry is a server that accepts compiled Cairo programs (also known as CASM files), fetches the compiler version dynamically, computes the correct program hash, and stores the bytecode of the Cairo program along with the program hash.

To trigger a [Module](/herodotus-docs/developers/data-processor/jargon/what-is-module.md) task via the [Data Processor API](/herodotus-docs/developers/api-docs.md), the target module program should have already been uploaded.

### Submit Program (`/submit-program`)

```sh
curl --location 'https://sharp.api.herodotus.cloud/submit-program?apiKey={yourApiKey}' \
--form 'programFile=@"./hdp.json"' \
```

**Response:**

```sh
0x343995a543ac64616d33fa77670cfa4e498691c96c2d964a0a07181dff4ce81
```

### Get Program (`/get-program`)

```sh
curl --location --request GET 'https://hdp.api.herodotus.cloud/get-program?program_hash=0x343995a543ac64616d33fa77670cfa4e498691c96c2d964a0a07181dff4ce81' \
--header 'Content-Type: application/json'
```

The response will be a JSON file of the target program.

### Get Metadata (`/get-metadata`)

**Request:**

```sh
curl --location 'http://program-registery.api.herodotus.cloud/get-metadata?program_hash=0x1cdc17f32a75a973497d9e4cf282dfbe12ef03df994cc35e3a54f8b7b98d67d'
```

**Response:**

```json
{
  "layout": "recursive_with_poseidon",
  "version": 2
}
```
