Skip to main content
GET
/
api
/
idl
/
:projectId
Retrieve IDL
curl --request GET \
  --url https://api.example.com/api/idl/:projectId
{
  "404": {},
  "500": {},
  "projectId": "<string>",
  "projectName": "<string>",
  "programId": "<string>",
  "version": 123,
  "idl": {},
  "cpiMd": "<string>",
  "createdAt": "<string>",
  "source": "<string>"
}

Overview

Retrieves the IDL (Interface Description Language) file for a project. By default, returns the latest version. You can specify a version number to retrieve a specific version.

Authentication

This endpoint does not require authentication. Public projects can be accessed by anyone.

Path Parameters

projectId
string
required
The unique project identifier returned when the IDL was uploaded.

Query Parameters

version
number
Specific version number to retrieve. If omitted, returns the latest version.

Response

projectId
string
The project identifier.
projectName
string
Name of the project.
programId
string
Solana program ID associated with this IDL.
version
number
Version number of the returned IDL.
idl
object
The complete IDL JSON object conforming to Anchor IDL structure.
cpiMd
string
CPI documentation in Markdown format, if provided during upload.
createdAt
string
ISO 8601 timestamp of when this version was created.
source
string
Indicates data source. Value is "cache" when served from KV cache, omitted when from database.

Error Codes

404
Not Found
Project or specified version not found.
500
Internal Server Error
Server error during retrieval. Response includes error details.

Examples

curl https://api.orquestra.dev/api/idl/abc123def456

Success Response (200)

{
  "projectId": "abc123def456",
  "projectName": "My Token Program",
  "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
  "version": 1,
  "idl": {
    "version": "0.1.0",
    "name": "my_token_program",
    "instructions": [
      {
        "name": "initialize",
        "accounts": [
          {
            "name": "mint",
            "isMut": true,
            "isSigner": false
          },
          {
            "name": "authority",
            "isMut": false,
            "isSigner": true
          }
        ],
        "args": [
          {
            "name": "decimals",
            "type": "u8"
          }
        ]
      }
    ],
    "accounts": [],
    "types": [],
    "errors": [],
    "events": []
  },
  "cpiMd": "# CPI Documentation\n\nHow to call this program from another program...",
  "createdAt": "2026-03-03T10:30:00.000Z"
}

Success Response (200 - From Cache)

{
  "projectId": "abc123def456",
  "idl": {
    "version": "0.1.0",
    "name": "my_token_program",
    "instructions": [],
    "accounts": [],
    "types": [],
    "errors": [],
    "events": []
  },
  "source": "cache"
}

Error Response (404)

{
  "error": "IDL not found"
}

Caching Behavior

  • IDLs are cached in KV storage for 7 days after access
  • Cache keys are formatted as idl:{projectId}:latest or idl:{projectId}:{version}
  • Cached responses include a source: "cache" field
  • Cache misses automatically populate the cache from the database
  • Updates to IDL (PUT requests) automatically invalidate and refresh the cache

Version Management

  • Each project maintains a history of IDL versions
  • Versions are numbered sequentially starting from 1
  • Use the List Versions endpoint to see all available versions
  • The latest version is always accessible without specifying a version parameter

Build docs developers (and LLMs) love