Hadrian is experimental alpha software. Do not use in production.
Hadrian

Prompts

Manage reusable system prompt templates. Prompts can be owned by organizations, teams, projects, or users and include metadata for configuration.

List prompts by project

GET
/admin/v1/organizations/{org_slug}/projects/{project_slug}/prompts
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

org_slug*string

Organization slug

project_slug*string

Project slug

Query Parameters

limit?integer|null

Maximum number of results to return

Formatint64
cursor?string|null

Cursor for keyset pagination. Encoded as base64 string.

direction?string|null

Pagination direction: "forward" (default) or "backward".

include_deleted?boolean|null

Include soft-deleted records in results

Response Body

application/json

application/json

application/json

curl -X GET "https://loading/admin/v1/organizations/string/projects/string/prompts"
{
  "data": [
    {
      "content": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "description": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "metadata": {
        "property1": null,
        "property2": null
      },
      "name": "string",
      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
      "owner_type": "organization",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 100,
    "next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
    "prev_cursor": "string"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

List prompts by organization

GET
/admin/v1/organizations/{org_slug}/prompts
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

org_slug*string

Organization slug

Query Parameters

limit?integer|null

Maximum number of results to return

Formatint64
cursor?string|null

Cursor for keyset pagination. Encoded as base64 string.

direction?string|null

Pagination direction: "forward" (default) or "backward".

include_deleted?boolean|null

Include soft-deleted records in results

Response Body

application/json

application/json

application/json

curl -X GET "https://loading/admin/v1/organizations/string/prompts"
{
  "data": [
    {
      "content": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "description": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "metadata": {
        "property1": null,
        "property2": null
      },
      "name": "string",
      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
      "owner_type": "organization",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 100,
    "next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
    "prev_cursor": "string"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

List prompts by team

GET
/admin/v1/organizations/{org_slug}/teams/{team_slug}/prompts
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

org_slug*string

Organization slug

team_slug*string

Team slug

Query Parameters

limit?integer|null

Maximum number of results to return

Formatint64
cursor?string|null

Cursor for keyset pagination. Encoded as base64 string.

direction?string|null

Pagination direction: "forward" (default) or "backward".

include_deleted?boolean|null

Include soft-deleted records in results

Response Body

application/json

application/json

application/json

curl -X GET "https://loading/admin/v1/organizations/string/teams/string/prompts"
{
  "data": [
    {
      "content": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "description": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "metadata": {
        "property1": null,
        "property2": null
      },
      "name": "string",
      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
      "owner_type": "organization",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 100,
    "next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
    "prev_cursor": "string"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Create a prompt template

POST
/admin/v1/prompts
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Request Body

application/json

content*string

The actual prompt content

description?string|null

Optional description

metadata?|null

Optional metadata

name*string

Name of the prompt template (unique per owner)

owner*|||

Owner of the prompt

Response Body

application/json

application/json

application/json

curl -X POST "https://loading/admin/v1/prompts" \  -H "Content-Type: application/json" \  -d '{    "content": "string",    "name": "string",    "owner": {      "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",      "type": "organization"    }  }'
{
  "content": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "description": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "metadata": {
    "property1": null,
    "property2": null
  },
  "name": "string",
  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
  "owner_type": "organization",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Get a prompt by ID

GET
/admin/v1/prompts/{id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

id*string

Prompt ID

Formatuuid

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/prompts/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "content": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "description": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "metadata": {
    "property1": null,
    "property2": null
  },
  "name": "string",
  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
  "owner_type": "organization",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Update a prompt

PATCH
/admin/v1/prompts/{id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

id*string

Prompt ID

Formatuuid

Request Body

application/json

content?string|null

New content

description?string|null

New description

metadata?|null

New metadata (replaces existing)

name?string|null

New name (unique per owner)

Response Body

application/json

application/json

application/json

curl -X PATCH "https://loading/admin/v1/prompts/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{
  "content": "string",
  "created_at": "2019-08-24T14:15:22Z",
  "description": "string",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "metadata": {
    "property1": null,
    "property2": null
  },
  "name": "string",
  "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
  "owner_type": "organization",
  "updated_at": "2019-08-24T14:15:22Z"
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

Delete a prompt

DELETE
/admin/v1/prompts/{id}
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

id*string

Prompt ID

Formatuuid

Response Body

application/json

curl -X DELETE "https://loading/admin/v1/prompts/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}

List prompts by user

GET
/admin/v1/users/{user_id}/prompts
AuthorizationBearer <token>

API key authentication using Bearer token format

In: header

Path Parameters

user_id*string

User ID

Formatuuid

Query Parameters

limit?integer|null

Maximum number of results to return

Formatint64
cursor?string|null

Cursor for keyset pagination. Encoded as base64 string.

direction?string|null

Pagination direction: "forward" (default) or "backward".

include_deleted?boolean|null

Include soft-deleted records in results

Response Body

application/json

application/json

curl -X GET "https://loading/admin/v1/users/497f6eca-6276-4993-bfeb-53cbbbba6f08/prompts"
{
  "data": [
    {
      "content": "string",
      "created_at": "2019-08-24T14:15:22Z",
      "description": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "metadata": {
        "property1": null,
        "property2": null
      },
      "name": "string",
      "owner_id": "8826ee2e-7933-4665-aef2-2393f84a0d05",
      "owner_type": "organization",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "has_more": true,
    "limit": 100,
    "next_cursor": "MTczMzU4MDgwMDAwMDphYmMxMjM0NS02Nzg5LTAxMjMtNDU2Ny0wMTIzNDU2Nzg5YWI",
    "prev_cursor": "string"
  }
}
{
  "error": {
    "code": "budget_exceeded",
    "message": "Budget limit exceeded for monthly period",
    "param": null,
    "request_id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "invalid_request_error"
  }
}