# Promptly ## List Runs **get** `/api/promptly/runs` Retrieve all task runs across all tasks for the organization ### Query Parameters - `organizationId: string` - `limit: optional number` ### Returns - `id: optional string` - `completedAt: optional string` - `costCents: optional number` Cost in cents - `createdAt: optional string` - `deliveryStatus: optional "pending" or "delivered" or "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs: optional number` Execution time in milliseconds - `error: optional string` Error message if failed - `output: optional string` AI-generated output - `startedAt: optional string` - `status: optional "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId: optional string` - `tokensUsed: optional number` Total tokens consumed ### Example ```http curl https://0ct.com/api/promptly/runs \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Get Stats **get** `/api/promptly/stats` Retrieve task execution statistics for the organization ### Query Parameters - `organizationId: string` ### Returns - `activeTasks: optional number` - `failedRuns: optional number` - `successfulRuns: optional number` - `totalCostCents: optional number` - `totalRuns: optional number` - `totalTasks: optional number` - `totalTokensUsed: optional number` ### Example ```http curl https://0ct.com/api/promptly/stats \ -H "Authorization: Bearer $0CT_API_KEY" ``` # Tasks ## List **get** `/api/promptly/tasks` Retrieve all tasks for the authenticated user's organization ### Query Parameters - `organizationId: string` Organization ID to filter tasks ### Returns - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" or "hourly" or "daily" or "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" or "paused" or "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression: optional string` Custom cron expression (overrides schedule settings) - `deliveryEmail: optional boolean` Email delivery enabled - `deliveryEmailAddress: optional string` Email address for delivery - `deliveryPhoneNumber: optional string` Phone number for SMS delivery - `deliverySms: optional boolean` SMS delivery enabled - `destinations: optional array of Destination` Where to deliver task results - `type: "email" or "sms" or "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label: optional string` Optional human-readable label - `lastRunAt: optional string` - `nextRunAt: optional string` - `organizationId: optional string` - `scheduleDays: optional array of "monday" or "tuesday" or "wednesday" or 4 more` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime: optional string` Time of day to run (HH:MM format) - `skillIds: optional array of string` IDs of attached skills - `skills: optional array of Skill` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` - `sourceIds: optional array of string` IDs of attached sources - `sources: optional array of Source` Attached data sources (when expanded) - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` - `timezone: optional string` IANA timezone (e.g., 'America/New_York') - `updatedAt: optional string` - `userId: optional string` Owner user ID ### Example ```http curl https://0ct.com/api/promptly/tasks \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Create **post** `/api/promptly/tasks` Create a new scheduled AI task ### Body Parameters - `name: string` Human-readable task name - `organizationId: string` Organization to create the task in - `prompt: string` The AI prompt to execute - `deliveryEmail: optional boolean` Enable email delivery - `deliveryEmailAddress: optional string` Email address for delivery - `deliveryPhoneNumber: optional string` Phone number for SMS delivery - `deliverySms: optional boolean` Enable SMS delivery - `destinations: optional array of Destination` Where to deliver task results - `type: "email" or "sms" or "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label: optional string` Optional human-readable label - `model: optional string` AI model identifier from /api/promptly/models - `schedule: optional "once" or "hourly" or "daily" or "weekly"` Execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `scheduleDays: optional array of "monday" or "tuesday" or "wednesday" or 4 more` Days to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime: optional string` Time of day to run (HH:MM in 24h format) - `skillIds: optional array of string` Skill IDs to attach to this task - `sourceIds: optional array of string` Source IDs to attach to this task - `timezone: optional string` IANA timezone identifier ### Returns - `Task = object { id, createdAt, model, 22 more }` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" or "hourly" or "daily" or "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" or "paused" or "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression: optional string` Custom cron expression (overrides schedule settings) - `deliveryEmail: optional boolean` Email delivery enabled - `deliveryEmailAddress: optional string` Email address for delivery - `deliveryPhoneNumber: optional string` Phone number for SMS delivery - `deliverySms: optional boolean` SMS delivery enabled - `destinations: optional array of Destination` Where to deliver task results - `type: "email" or "sms" or "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label: optional string` Optional human-readable label - `lastRunAt: optional string` - `nextRunAt: optional string` - `organizationId: optional string` - `scheduleDays: optional array of "monday" or "tuesday" or "wednesday" or 4 more` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime: optional string` Time of day to run (HH:MM format) - `skillIds: optional array of string` IDs of attached skills - `skills: optional array of Skill` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` - `sourceIds: optional array of string` IDs of attached sources - `sources: optional array of Source` Attached data sources (when expanded) - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` - `timezone: optional string` IANA timezone (e.g., 'America/New_York') - `updatedAt: optional string` - `userId: optional string` Owner user ID ### Example ```http curl https://0ct.com/api/promptly/tasks \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "name": "x", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "prompt": "x" }' ``` ## Retrieve **get** `/api/promptly/tasks/{taskId}` Retrieve a specific task by ID ### Path Parameters - `taskId: string` ### Returns - `Task = object { id, createdAt, model, 22 more }` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" or "hourly" or "daily" or "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" or "paused" or "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression: optional string` Custom cron expression (overrides schedule settings) - `deliveryEmail: optional boolean` Email delivery enabled - `deliveryEmailAddress: optional string` Email address for delivery - `deliveryPhoneNumber: optional string` Phone number for SMS delivery - `deliverySms: optional boolean` SMS delivery enabled - `destinations: optional array of Destination` Where to deliver task results - `type: "email" or "sms" or "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label: optional string` Optional human-readable label - `lastRunAt: optional string` - `nextRunAt: optional string` - `organizationId: optional string` - `scheduleDays: optional array of "monday" or "tuesday" or "wednesday" or 4 more` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime: optional string` Time of day to run (HH:MM format) - `skillIds: optional array of string` IDs of attached skills - `skills: optional array of Skill` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` - `sourceIds: optional array of string` IDs of attached sources - `sources: optional array of Source` Attached data sources (when expanded) - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` - `timezone: optional string` IANA timezone (e.g., 'America/New_York') - `updatedAt: optional string` - `userId: optional string` Owner user ID ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Update **patch** `/api/promptly/tasks/{taskId}` Update an existing task ### Path Parameters - `taskId: string` ### Body Parameters - `deliveryEmail: optional boolean` - `deliveryEmailAddress: optional string` - `deliveryPhoneNumber: optional string` - `deliverySms: optional boolean` - `destinations: optional array of Destination` - `type: "email" or "sms" or "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label: optional string` Optional human-readable label - `model: optional string` - `name: optional string` - `prompt: optional string` - `schedule: optional "once" or "hourly" or "daily" or "weekly"` - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `scheduleDays: optional array of "monday" or "tuesday" or "wednesday" or 4 more` - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime: optional string` - `skillIds: optional array of string` Replace all attached skills with these IDs - `sourceIds: optional array of string` Replace all attached sources with these IDs - `status: optional "active" or "paused" or "completed"` - `"active"` - `"paused"` - `"completed"` - `timezone: optional string` ### Returns - `Task = object { id, createdAt, model, 22 more }` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" or "hourly" or "daily" or "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" or "paused" or "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression: optional string` Custom cron expression (overrides schedule settings) - `deliveryEmail: optional boolean` Email delivery enabled - `deliveryEmailAddress: optional string` Email address for delivery - `deliveryPhoneNumber: optional string` Phone number for SMS delivery - `deliverySms: optional boolean` SMS delivery enabled - `destinations: optional array of Destination` Where to deliver task results - `type: "email" or "sms" or "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label: optional string` Optional human-readable label - `lastRunAt: optional string` - `nextRunAt: optional string` - `organizationId: optional string` - `scheduleDays: optional array of "monday" or "tuesday" or "wednesday" or 4 more` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime: optional string` Time of day to run (HH:MM format) - `skillIds: optional array of string` IDs of attached skills - `skills: optional array of Skill` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` - `sourceIds: optional array of string` IDs of attached sources - `sources: optional array of Source` Attached data sources (when expanded) - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` - `timezone: optional string` IANA timezone (e.g., 'America/New_York') - `updatedAt: optional string` - `userId: optional string` Owner user ID ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{}' ``` ## Delete **delete** `/api/promptly/tasks/{taskId}` Delete a task and all its run history ### Path Parameters - `taskId: string` ### Returns - `success: optional boolean` ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID \ -X DELETE \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Run **post** `/api/promptly/tasks/{taskId}/run` Execute a task immediately, regardless of its schedule ### Path Parameters - `taskId: string` ### Returns - `TaskRun = object { id, completedAt, costCents, 9 more }` - `id: optional string` - `completedAt: optional string` - `costCents: optional number` Cost in cents - `createdAt: optional string` - `deliveryStatus: optional "pending" or "delivered" or "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs: optional number` Execution time in milliseconds - `error: optional string` Error message if failed - `output: optional string` AI-generated output - `startedAt: optional string` - `status: optional "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId: optional string` - `tokensUsed: optional number` Total tokens consumed ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID/run \ -X POST \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## List Runs **get** `/api/promptly/tasks/{taskId}/runs` Retrieve run history for a specific task ### Path Parameters - `taskId: string` ### Query Parameters - `limit: optional number` Maximum number of runs to return ### Returns - `id: optional string` - `completedAt: optional string` - `costCents: optional number` Cost in cents - `createdAt: optional string` - `deliveryStatus: optional "pending" or "delivered" or "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs: optional number` Execution time in milliseconds - `error: optional string` Error message if failed - `output: optional string` AI-generated output - `startedAt: optional string` - `status: optional "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId: optional string` - `tokensUsed: optional number` Total tokens consumed ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID/runs \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Domain Types ### Destination - `Destination = object { type, value, label }` - `type: "email" or "sms" or "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label: optional string` Optional human-readable label ### Task - `Task = object { id, createdAt, model, 22 more }` - `id: string` - `createdAt: string` - `model: string` AI model identifier (e.g., 'gpt-4o-mini') - `name: string` Human-readable task name - `prompt: string` The AI prompt to execute - `schedule: "once" or "hourly" or "daily" or "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" or "paused" or "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression: optional string` Custom cron expression (overrides schedule settings) - `deliveryEmail: optional boolean` Email delivery enabled - `deliveryEmailAddress: optional string` Email address for delivery - `deliveryPhoneNumber: optional string` Phone number for SMS delivery - `deliverySms: optional boolean` SMS delivery enabled - `destinations: optional array of Destination` Where to deliver task results - `type: "email" or "sms" or "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label: optional string` Optional human-readable label - `lastRunAt: optional string` - `nextRunAt: optional string` - `organizationId: optional string` - `scheduleDays: optional array of "monday" or "tuesday" or "wednesday" or 4 more` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime: optional string` Time of day to run (HH:MM format) - `skillIds: optional array of string` IDs of attached skills - `skills: optional array of Skill` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` - `sourceIds: optional array of string` IDs of attached sources - `sources: optional array of Source` Attached data sources (when expanded) - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` - `timezone: optional string` IANA timezone (e.g., 'America/New_York') - `updatedAt: optional string` - `userId: optional string` Owner user ID ### Task Run - `TaskRun = object { id, completedAt, costCents, 9 more }` - `id: optional string` - `completedAt: optional string` - `costCents: optional number` Cost in cents - `createdAt: optional string` - `deliveryStatus: optional "pending" or "delivered" or "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs: optional number` Execution time in milliseconds - `error: optional string` Error message if failed - `output: optional string` AI-generated output - `startedAt: optional string` - `status: optional "pending" or "running" or "completed" or "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId: optional string` - `tokensUsed: optional number` Total tokens consumed # Sources ## Attach **post** `/api/promptly/tasks/{taskId}/sources` Connect a data source to provide context for task execution ### Path Parameters - `taskId: string` ### Body Parameters - `sourceId: string` ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID/sources \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "sourceId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }' ``` ## Detach **delete** `/api/promptly/tasks/{taskId}/sources/{sourceId}` Detach a source from a task ### Path Parameters - `taskId: string` - `sourceId: string` ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID/sources/$SOURCE_ID \ -X DELETE \ -H "Authorization: Bearer $0CT_API_KEY" ``` # Skills ## Attach **post** `/api/promptly/tasks/{taskId}/skills` Add reusable instructions to guide task execution ### Path Parameters - `taskId: string` ### Body Parameters - `skillId: string` ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID/skills \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "skillId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }' ``` ## Detach **delete** `/api/promptly/tasks/{taskId}/skills/{skillId}` Detach a skill from a task ### Path Parameters - `taskId: string` - `skillId: string` ### Example ```http curl https://0ct.com/api/promptly/tasks/$TASK_ID/skills/$SKILL_ID \ -X DELETE \ -H "Authorization: Bearer $0CT_API_KEY" ``` # Sources ## List **get** `/api/promptly/sources` Retrieve all data sources for the organization ### Query Parameters - `organizationId: string` ### Returns - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` ### Example ```http curl https://0ct.com/api/promptly/sources \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Create **post** `/api/promptly/sources` Create a new data source connection ### Body Parameters - `config: unknown` - `name: string` - `organizationId: string` - `type: "mcp" or "api" or "local"` - `"mcp"` - `"api"` - `"local"` - `authConfig: optional unknown` - `authType: optional string` - `description: optional string` - `iconUrl: optional string` - `slug: optional string` ### Returns - `Source = object { id, config, name, 14 more }` - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` ### Example ```http curl https://0ct.com/api/promptly/sources \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "config": {}, "name": "name", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e", "type": "mcp" }' ``` ## Retrieve **get** `/api/promptly/sources/{sourceId}` Retrieve a specific source by ID ### Path Parameters - `sourceId: string` ### Returns - `Source = object { id, config, name, 14 more }` - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` ### Example ```http curl https://0ct.com/api/promptly/sources/$SOURCE_ID \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Update **patch** `/api/promptly/sources/{sourceId}` Update a source ### Path Parameters - `sourceId: string` ### Body Parameters - `authConfig: optional unknown` - `authType: optional string` - `config: optional unknown` - `description: optional string` - `isActive: optional boolean` - `name: optional string` ### Returns - `Source = object { id, config, name, 14 more }` - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` ### Example ```http curl https://0ct.com/api/promptly/sources/$SOURCE_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{}' ``` ## Delete **delete** `/api/promptly/sources/{sourceId}` Delete a source ### Path Parameters - `sourceId: string` ### Example ```http curl https://0ct.com/api/promptly/sources/$SOURCE_ID \ -X DELETE \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Test **post** `/api/promptly/sources/{sourceId}/test` Verify the source connection is working properly ### Path Parameters - `sourceId: string` ### Returns - `message: optional string` - `success: optional boolean` - `tools: optional array of Tool` - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` ### Example ```http curl https://0ct.com/api/promptly/sources/$SOURCE_ID/test \ -X POST \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Domain Types ### Source - `Source = object { id, config, name, 14 more }` - `id: string` - `config: object { args, baseUrl, command, 3 more }` Source-specific configuration - `args: optional array of string` Command arguments - `baseUrl: optional string` Base URL for API sources - `command: optional string` Command to run for stdio transport - `env: optional map[string]` Environment variables - `transport: optional "stdio" or "http" or "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url: optional string` URL for http/websocket transport - `name: string` - `type: "mcp" or "api" or "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig: optional object { headerName, prefix, provider }` Authentication configuration - `headerName: optional string` - `prefix: optional string` - `provider: optional string` - `authType: optional "none" or "oauth" or "bearer" or 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected: optional boolean` Whether Composio OAuth is completed - `composioToolkit: optional string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt: optional string` - `description: optional string` - `iconUrl: optional string` - `isActive: optional boolean` Whether the source is connected and ready - `lastConnectedAt: optional string` - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `tools: optional array of Tool` Available tools from this source - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` - `updatedAt: optional string` ### Tool - `Tool = object { description, inputSchema, name }` - `description: optional string` - `inputSchema: optional unknown` JSON Schema for tool parameters - `name: optional string` # Skills ## List **get** `/api/promptly/skills` Retrieve all skills for the organization ### Query Parameters - `organizationId: string` ### Returns - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` ### Example ```http curl https://0ct.com/api/promptly/skills \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Create **post** `/api/promptly/skills` Create a new reusable instruction set ### Body Parameters - `content: string` - `name: string` - `organizationId: string` - `category: optional string` - `description: optional string` - `frontmatter: optional unknown` - `iconUrl: optional string` - `isPublic: optional boolean` - `slug: optional string` ### Returns - `Skill = object { id, content, name, 11 more }` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` ### Example ```http curl https://0ct.com/api/promptly/skills \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "content": "content", "name": "name", "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }' ``` ## Retrieve **get** `/api/promptly/skills/{skillId}` Get a skill ### Path Parameters - `skillId: string` ### Returns - `Skill = object { id, content, name, 11 more }` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` ### Example ```http curl https://0ct.com/api/promptly/skills/$SKILL_ID \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Update **patch** `/api/promptly/skills/{skillId}` Update a skill ### Path Parameters - `skillId: string` ### Body Parameters - `category: optional string` - `content: optional string` - `description: optional string` - `frontmatter: optional unknown` - `isPublic: optional boolean` - `name: optional string` ### Returns - `Skill = object { id, content, name, 11 more }` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` ### Example ```http curl https://0ct.com/api/promptly/skills/$SKILL_ID \ -X PATCH \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{}' ``` ## Delete **delete** `/api/promptly/skills/{skillId}` Delete a skill ### Path Parameters - `skillId: string` ### Example ```http curl https://0ct.com/api/promptly/skills/$SKILL_ID \ -X DELETE \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Domain Types ### Skill - `Skill = object { id, content, name, 11 more }` - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category: optional string` - `createdAt: optional string` - `description: optional string` - `frontmatter: optional object { author, requiredSources, tags }` Skill metadata - `author: optional string` - `requiredSources: optional array of string` Source slugs this skill depends on - `tags: optional array of string` - `iconUrl: optional string` - `isPublic: optional boolean` Whether the skill is shared publicly - `isUserInvocable: optional boolean` Whether users can manually attach this skill - `organizationId: optional string` - `slug: optional string` URL-friendly identifier - `updatedAt: optional string` - `version: optional number` # Models ## List **get** `/api/promptly/models` Retrieve all available AI models for task execution ### Returns - `id: optional string` - `codingIndex: optional number` Coding benchmark score - `contextLength: optional number` Maximum context window size - `intelligenceIndex: optional number` Intelligence benchmark score - `name: optional string` - `openRouterId: optional string` Model identifier for OpenRouter - `outputSpeed: optional number` Tokens per second - `powerTier: optional number` Power tier (1 = most powerful) - `provider: optional string` Model provider (anthropic, openai, google, etc.) - `supportsInternetSearch: optional boolean` - `supportsToolCalling: optional boolean` ### Example ```http curl https://0ct.com/api/promptly/models \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Retrieve **get** `/api/promptly/models/{modelId}` Get a model ### Path Parameters - `modelId: string` ### Returns - `Model = object { id, codingIndex, contextLength, 8 more }` - `id: optional string` - `codingIndex: optional number` Coding benchmark score - `contextLength: optional number` Maximum context window size - `intelligenceIndex: optional number` Intelligence benchmark score - `name: optional string` - `openRouterId: optional string` Model identifier for OpenRouter - `outputSpeed: optional number` Tokens per second - `powerTier: optional number` Power tier (1 = most powerful) - `provider: optional string` Model provider (anthropic, openai, google, etc.) - `supportsInternetSearch: optional boolean` - `supportsToolCalling: optional boolean` ### Example ```http curl https://0ct.com/api/promptly/models/$MODEL_ID \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Domain Types ### Model - `Model = object { id, codingIndex, contextLength, 8 more }` - `id: optional string` - `codingIndex: optional number` Coding benchmark score - `contextLength: optional number` Maximum context window size - `intelligenceIndex: optional number` Intelligence benchmark score - `name: optional string` - `openRouterId: optional string` Model identifier for OpenRouter - `outputSpeed: optional number` Tokens per second - `powerTier: optional number` Power tier (1 = most powerful) - `provider: optional string` Model provider (anthropic, openai, google, etc.) - `supportsInternetSearch: optional boolean` - `supportsToolCalling: optional boolean` # Billing ## Get Status **get** `/api/promptly/billing/status` Retrieve current subscription and usage information ### Query Parameters - `organizationId: string` ### Returns - `billingPeriodStart: optional string` - `plan: optional "free" or "paid"` - `"free"` - `"paid"` - `runsLimit: optional number` Maximum runs allowed (null for unlimited) - `runsUsed: optional number` Task runs used this billing period - `stripeCustomerId: optional string` - `stripeSubscriptionId: optional string` - `tasksCount: optional number` Current number of active tasks - `tasksLimit: optional number` Maximum tasks allowed - `usageCostCents: optional number` Usage-based charges this period - `usageCreditsCents: optional number` Usage credits included in plan - `usersCount: optional number` - `usersLimit: optional number` ### Example ```http curl https://0ct.com/api/promptly/billing/status \ -H "Authorization: Bearer $0CT_API_KEY" ``` ## Create Checkout **post** `/api/promptly/billing/checkout` Create a Stripe checkout session for upgrading to paid plan ### Body Parameters - `organizationId: string` ### Returns - `url: optional string` Stripe checkout URL ### Example ```http curl https://0ct.com/api/promptly/billing/checkout \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }' ``` ## Create Portal **post** `/api/promptly/billing/portal` Create a Stripe billing portal session for managing subscription ### Body Parameters - `organizationId: string` ### Returns - `url: optional string` Stripe billing portal URL ### Example ```http curl https://0ct.com/api/promptly/billing/portal \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $0CT_API_KEY" \ -d '{ "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e" }' ```