Levain LabsLevain Labs
API ReferenceOrganization

Publish Recipe Version

Publish a version of an org agent from a source archive.

Publish a version of an org agent from a source archive.

Upload a gzipped tar whose single top-level directory contains the agent's recipe package. The first publish under a slug creates the org agent; later publishes append versions and make the newest one active. Slugs are global, so a slug already taken by another publisher is refused, and a recipe that fails validation is refused with 422.

The agent's contract is derived from the recipe: input_schema from the graph.tla state (what the adopted agent's GET /api/v1/agents/{id}/state-schema reports) and required_integrations / optional_integrations from its @mcp_servers names.

Any workspace in the org can then adopt the agent via POST /api/v1/managed-agents/{slug}/adopt, which links the workspace integrations those names match (by display name or provider) and is refused with 409 while a required one is missing; adopting workspaces follow the active version.

POST
/api/v1/org/agents/{slug}/versions

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

slug*Slug

Header Parameters

X-API-Key?string|null

Request Body

multipart/form-data

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.levainlabs.com/api/v1/org/agents/string/versions" \  -F sdist="string"
{
  "version": 0,
  "status": "string",
  "s3_content_hash": "string",
  "created_at": "string",
  "last_commit_at": "string"
}