# 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
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.herodotus.dev/herodotus-docs/developers/api-docs/program-registry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
