# Tasks ## List `client.promptly.tasks.list(TaskListParamsquery, RequestOptionsoptions?): TaskListResponse` **get** `/api/promptly/tasks` Retrieve all tasks for the authenticated user's organization ### Parameters - `query: TaskListParams` - `organizationId: string` Organization ID to filter tasks ### Returns - `TaskListResponse = Array` - `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" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const tasks = await client.promptly.tasks.list({ organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); console.log(tasks); ``` ## Create `client.promptly.tasks.create(TaskCreateParamsbody, RequestOptionsoptions?): Task` **post** `/api/promptly/tasks` Create a new scheduled AI task ### Parameters - `body: TaskCreateParams` - `name: string` Human-readable task name - `organizationId: string` Organization to create the task in - `prompt: string` The AI prompt to execute - `deliveryEmail?: boolean` Enable email delivery - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` Enable SMS delivery - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `model?: string` AI model identifier from /api/promptly/models - `schedule?: "once" | "hourly" | "daily" | "weekly"` Execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM in 24h format) - `skillIds?: Array` Skill IDs to attach to this task - `sourceIds?: Array` Source IDs to attach to this task - `timezone?: string` IANA timezone identifier ### Returns - `Task` - `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" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const task = await client.promptly.tasks.create({ name: 'x', organizationId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', prompt: 'x', }); console.log(task.id); ``` ## Retrieve `client.promptly.tasks.retrieve(stringtaskID, RequestOptionsoptions?): Task` **get** `/api/promptly/tasks/{taskId}` Retrieve a specific task by ID ### Parameters - `taskID: string` ### Returns - `Task` - `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" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const task = await client.promptly.tasks.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(task.id); ``` ## Update `client.promptly.tasks.update(stringtaskID, TaskUpdateParamsbody, RequestOptionsoptions?): Task` **patch** `/api/promptly/tasks/{taskId}` Update an existing task ### Parameters - `taskID: string` - `body: TaskUpdateParams` - `deliveryEmail?: boolean` - `deliveryEmailAddress?: string` - `deliveryPhoneNumber?: string` - `deliverySms?: boolean` - `destinations?: Array` - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `model?: string` - `name?: string` - `prompt?: string` - `schedule?: "once" | "hourly" | "daily" | "weekly"` - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` - `skillIds?: Array` Replace all attached skills with these IDs - `sourceIds?: Array` Replace all attached sources with these IDs - `status?: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `timezone?: string` ### Returns - `Task` - `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" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const task = await client.promptly.tasks.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(task.id); ``` ## Delete `client.promptly.tasks.delete(stringtaskID, RequestOptionsoptions?): TaskDeleteResponse` **delete** `/api/promptly/tasks/{taskId}` Delete a task and all its run history ### Parameters - `taskID: string` ### Returns - `TaskDeleteResponse` - `success?: boolean` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const task = await client.promptly.tasks.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(task.success); ``` ## Run `client.promptly.tasks.run(stringtaskID, RequestOptionsoptions?): TaskRun` **post** `/api/promptly/tasks/{taskId}/run` Execute a task immediately, regardless of its schedule ### Parameters - `taskID: string` ### Returns - `TaskRun` - `id?: string` - `completedAt?: string` - `costCents?: number` Cost in cents - `createdAt?: string` - `deliveryStatus?: "pending" | "delivered" | "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs?: number` Execution time in milliseconds - `error?: string` Error message if failed - `output?: string` AI-generated output - `startedAt?: string` - `status?: "pending" | "running" | "completed" | "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId?: string` - `tokensUsed?: number` Total tokens consumed ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const taskRun = await client.promptly.tasks.run('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(taskRun.id); ``` ## List Runs `client.promptly.tasks.listRuns(stringtaskID, TaskListRunsParamsquery?, RequestOptionsoptions?): TaskListRunsResponse` **get** `/api/promptly/tasks/{taskId}/runs` Retrieve run history for a specific task ### Parameters - `taskID: string` - `query: TaskListRunsParams` - `limit?: number` Maximum number of runs to return ### Returns - `TaskListRunsResponse = Array` - `id?: string` - `completedAt?: string` - `costCents?: number` Cost in cents - `createdAt?: string` - `deliveryStatus?: "pending" | "delivered" | "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs?: number` Execution time in milliseconds - `error?: string` Error message if failed - `output?: string` AI-generated output - `startedAt?: string` - `status?: "pending" | "running" | "completed" | "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId?: string` - `tokensUsed?: number` Total tokens consumed ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); const taskRuns = await client.promptly.tasks.listRuns('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'); console.log(taskRuns); ``` ## Domain Types ### Destination - `Destination` - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label ### Task - `Task` - `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" | "hourly" | "daily" | "weekly"` Task execution frequency - `"once"` - `"hourly"` - `"daily"` - `"weekly"` - `status: "active" | "paused" | "completed"` - `"active"` - `"paused"` - `"completed"` - `cronExpression?: string` Custom cron expression (overrides schedule settings) - `deliveryEmail?: boolean` Email delivery enabled - `deliveryEmailAddress?: string` Email address for delivery - `deliveryPhoneNumber?: string` Phone number for SMS delivery - `deliverySms?: boolean` SMS delivery enabled - `destinations?: Array` Where to deliver task results - `type: "email" | "sms" | "webhook"` - `"email"` - `"sms"` - `"webhook"` - `value: string` Email address, phone number, or webhook URL - `label?: string` Optional human-readable label - `lastRunAt?: string | null` - `nextRunAt?: string | null` - `organizationId?: string` - `scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>` Days of week to run (for weekly schedule) - `"monday"` - `"tuesday"` - `"wednesday"` - `"thursday"` - `"friday"` - `"saturday"` - `"sunday"` - `scheduleTime?: string` Time of day to run (HH:MM format) - `skillIds?: Array` IDs of attached skills - `skills?: Array` Attached skills (when expanded) - `id: string` - `content: string` Markdown instructions that guide task execution - `name: string` - `category?: string` - `createdAt?: string` - `description?: string` - `frontmatter?: Frontmatter` Skill metadata - `author?: string` - `requiredSources?: Array` Source slugs this skill depends on - `tags?: Array` - `iconUrl?: string` - `isPublic?: boolean` Whether the skill is shared publicly - `isUserInvocable?: boolean` Whether users can manually attach this skill - `organizationId?: string` - `slug?: string` URL-friendly identifier - `updatedAt?: string` - `version?: number` - `sourceIds?: Array` IDs of attached sources - `sources?: Array` Attached data sources (when expanded) - `id: string` - `config: Config` Source-specific configuration - `args?: Array` Command arguments - `baseUrl?: string` Base URL for API sources - `command?: string` Command to run for stdio transport - `env?: Record` Environment variables - `transport?: "stdio" | "http" | "websocket"` MCP transport type - `"stdio"` - `"http"` - `"websocket"` - `url?: string` URL for http/websocket transport - `name: string` - `type: "mcp" | "api" | "local"` Source connection type - `"mcp"` - `"api"` - `"local"` - `authConfig?: AuthConfig` Authentication configuration - `headerName?: string` - `prefix?: string` - `provider?: string` - `authType?: "none" | "oauth" | "bearer" | 5 more` - `"none"` - `"oauth"` - `"bearer"` - `"basic"` - `"header"` - `"query"` - `"api_key"` - `"composio"` - `composioConnected?: boolean` Whether Composio OAuth is completed - `composioToolkit?: string` Composio toolkit name (e.g., 'todoist', 'github') - `createdAt?: string` - `description?: string` - `iconUrl?: string` - `isActive?: boolean` Whether the source is connected and ready - `lastConnectedAt?: string` - `organizationId?: string` - `slug?: string` URL-friendly identifier - `tools?: Array` Available tools from this source - `description?: string` - `inputSchema?: unknown` JSON Schema for tool parameters - `name?: string` - `updatedAt?: string` - `timezone?: string` IANA timezone (e.g., 'America/New_York') - `updatedAt?: string` - `userId?: string` Owner user ID ### Task Run - `TaskRun` - `id?: string` - `completedAt?: string` - `costCents?: number` Cost in cents - `createdAt?: string` - `deliveryStatus?: "pending" | "delivered" | "failed"` - `"pending"` - `"delivered"` - `"failed"` - `durationMs?: number` Execution time in milliseconds - `error?: string` Error message if failed - `output?: string` AI-generated output - `startedAt?: string` - `status?: "pending" | "running" | "completed" | "failed"` - `"pending"` - `"running"` - `"completed"` - `"failed"` - `taskId?: string` - `tokensUsed?: number` Total tokens consumed # Sources ## Attach `client.promptly.tasks.sources.attach(stringtaskID, SourceAttachParamsbody, RequestOptionsoptions?): void` **post** `/api/promptly/tasks/{taskId}/sources` Connect a data source to provide context for task execution ### Parameters - `taskID: string` - `body: SourceAttachParams` - `sourceId: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.tasks.sources.attach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { sourceId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); ``` ## Detach `client.promptly.tasks.sources.detach(stringsourceID, SourceDetachParamsparams, RequestOptionsoptions?): void` **delete** `/api/promptly/tasks/{taskId}/sources/{sourceId}` Detach a source from a task ### Parameters - `sourceID: string` - `params: SourceDetachParams` - `taskId: string` Unique task identifier ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.tasks.sources.detach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { taskId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); ``` # Skills ## Attach `client.promptly.tasks.skills.attach(stringtaskID, SkillAttachParamsbody, RequestOptionsoptions?): void` **post** `/api/promptly/tasks/{taskId}/skills` Add reusable instructions to guide task execution ### Parameters - `taskID: string` - `body: SkillAttachParams` - `skillId: string` ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.tasks.skills.attach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { skillId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); ``` ## Detach `client.promptly.tasks.skills.detach(stringskillID, SkillDetachParamsparams, RequestOptionsoptions?): void` **delete** `/api/promptly/tasks/{taskId}/skills/{skillId}` Detach a skill from a task ### Parameters - `skillID: string` - `params: SkillDetachParams` - `taskId: string` Unique task identifier ### Example ```typescript import _0ct from '0ct'; const client = new _0ct({ apiKey: process.env['0CT_API_KEY'], // This is the default and can be omitted }); await client.promptly.tasks.skills.detach('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { taskId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', }); ```