Prompt Library API Overview
Programmatically create and manage prompts and prompt folders in your ajan workspace
The Prompt Library API lets you manage prompts and prompt folders programmatically. Use it to sync prompts from a repository, bulk-update templates, and keep folder sharing in step with your content workflow.
Base URL
https://api.ajan.ioAPI Key Scope
All Prompt Library API endpoints require an API key with the PROMPT_API scope.
Available Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /prompts/v1 | List prompts |
POST | /prompts/v1 | Create a prompt |
GET | /prompts/v1/{promptId} | Get a prompt |
PATCH | /prompts/v1/{promptId} | Update a prompt |
DELETE | /prompts/v1/{promptId} | Delete a prompt |
GET | /prompts/v1/folders | List prompt folders |
POST | /prompts/v1/folders | Create a prompt folder |
GET | /prompts/v1/folders/{folderId} | Get a prompt folder |
PATCH | /prompts/v1/folders/{folderId} | Update a prompt folder |
DELETE | /prompts/v1/folders/{folderId} | Delete a prompt folder |
Prompt Object
Prompt endpoints return the same prompt object:
{
id: string;
title: string;
prompt: string;
createdBy: string | null;
promptFolderId: string | null;
sharedWithWorkspace: boolean;
createdAt: string | null;
updatedAt: string | null;
}Folder Object
Folder endpoints return the same folder object:
{
id: string;
name: string;
createdBy: string;
sharedWithWorkspace: boolean;
sharedWithGroupId: string | null;
createdAt: string;
updatedAt: string;
}Permissions
Requests use the user who created the API key for permissions and access:
| Action | Required access |
|---|---|
| List or get prompts | Access through ownership, workspace sharing, or a shared folder |
| Create prompts | Active workspace membership |
| Update or delete prompts | Creator, workspace editor, or group editor of the prompt's folder |
| Share a prompt with the workspace | sharePrompts permission |
| List or get folders | Access through ownership, workspace sharing, or group sharing |
| Create folders | Active workspace membership |
| Update folders | Creator, workspace editor, sharePrompts for workspace-shared folders, or group editor |
| Delete folders | Creator, workspace editor, or group editor |
A prompt cannot be shared with the workspace and assigned to a folder at the same time. A folder cannot be shared with the workspace and a group at the same time. Deleting a folder also deletes the prompts in it.
Private folders stay creator-only. Workspace sharing of folders uses the sharePrompts permission or workspace editor access.
Rate Limits
The Prompt Library API follows standard API rate limits. If you exceed the limit, you'll receive a 429 response. Wait and retry with exponential backoff.