Skip to content
Get started

Update a task

client.promptly.tasks.update(stringtaskID, TaskUpdateParams { deliveryEmail, deliveryEmailAddress, deliveryPhoneNumber, 12 more } body, RequestOptionsoptions?): Task { id, createdAt, model, 22 more }
PATCH/api/promptly/tasks/{taskId}

Update an existing task

ParametersExpand Collapse
taskID: string
formatuuid
body: TaskUpdateParams { deliveryEmail, deliveryEmailAddress, deliveryPhoneNumber, 12 more }
deliveryEmail?: boolean
deliveryEmailAddress?: string
formatemail
deliveryPhoneNumber?: string
deliverySms?: boolean
destinations?: Array<Destination { type, value, label } >
type: "email" | "sms" | "webhook"
Accepts one of the following:
"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"
Accepts one of the following:
"once"
"hourly"
"daily"
"weekly"
scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>
Accepts one of the following:
"monday"
"tuesday"
"wednesday"
"thursday"
"friday"
"saturday"
"sunday"
scheduleTime?: string
skillIds?: Array<string>

Replace all attached skills with these IDs

sourceIds?: Array<string>

Replace all attached sources with these IDs

status?: "active" | "paused" | "completed"
Accepts one of the following:
"active"
"paused"
"completed"
timezone?: string
ReturnsExpand Collapse
Task { id, createdAt, model, 22 more }
id: string
formatuuid
createdAt: string
formatdate-time
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

Accepts one of the following:
"once"
"hourly"
"daily"
"weekly"
status: "active" | "paused" | "completed"
Accepts one of the following:
"active"
"paused"
"completed"
cronExpression?: string

Custom cron expression (overrides schedule settings)

deliveryEmail?: boolean

Email delivery enabled

deliveryEmailAddress?: string

Email address for delivery

formatemail
deliveryPhoneNumber?: string

Phone number for SMS delivery

deliverySms?: boolean

SMS delivery enabled

destinations?: Array<Destination { type, value, label } >

Where to deliver task results

type: "email" | "sms" | "webhook"
Accepts one of the following:
"email"
"sms"
"webhook"
value: string

Email address, phone number, or webhook URL

label?: string

Optional human-readable label

lastRunAt?: string | null
formatdate-time
nextRunAt?: string | null
formatdate-time
organizationId?: string
formatuuid
scheduleDays?: Array<"monday" | "tuesday" | "wednesday" | 4 more>

Days of week to run (for weekly schedule)

Accepts one of the following:
"monday"
"tuesday"
"wednesday"
"thursday"
"friday"
"saturday"
"sunday"
scheduleTime?: string

Time of day to run (HH:MM format)

skillIds?: Array<string>

IDs of attached skills

skills?: Array<Skill { id, content, name, 11 more } >

Attached skills (when expanded)

id: string
formatuuid
content: string

Markdown instructions that guide task execution

name: string
category?: string
createdAt?: string
formatdate-time
description?: string
frontmatter?: Frontmatter { author, requiredSources, tags }

Skill metadata

author?: string
requiredSources?: Array<string>

Source slugs this skill depends on

tags?: Array<string>
iconUrl?: string
formaturi
isPublic?: boolean

Whether the skill is shared publicly

isUserInvocable?: boolean

Whether users can manually attach this skill

organizationId?: string
formatuuid
slug?: string

URL-friendly identifier

updatedAt?: string
formatdate-time
version?: number
sourceIds?: Array<string>

IDs of attached sources

sources?: Array<Source { id, config, name, 14 more } >

Attached data sources (when expanded)

id: string
formatuuid
config: Config { args, baseUrl, command, 3 more }

Source-specific configuration

args?: Array<string>

Command arguments

baseUrl?: string

Base URL for API sources

formaturi
command?: string

Command to run for stdio transport

env?: Record<string, string>

Environment variables

transport?: "stdio" | "http" | "websocket"

MCP transport type

Accepts one of the following:
"stdio"
"http"
"websocket"
url?: string

URL for http/websocket transport

formaturi
name: string
type: "mcp" | "api" | "local"

Source connection type

Accepts one of the following:
"mcp"
"api"
"local"
authConfig?: AuthConfig { headerName, prefix, provider }

Authentication configuration

headerName?: string
prefix?: string
provider?: string
authType?: "none" | "oauth" | "bearer" | 5 more
Accepts one of the following:
"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
formatdate-time
description?: string
iconUrl?: string
formaturi
isActive?: boolean

Whether the source is connected and ready

lastConnectedAt?: string
formatdate-time
organizationId?: string
formatuuid
slug?: string

URL-friendly identifier

tools?: Array<Tool { description, inputSchema, name } >

Available tools from this source

description?: string
inputSchema?: unknown

JSON Schema for tool parameters

name?: string
updatedAt?: string
formatdate-time
timezone?: string

IANA timezone (e.g., 'America/New_York')

updatedAt?: string
formatdate-time
userId?: string

Owner user ID

Update a task

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);
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "model": "model",
  "name": "name",
  "prompt": "prompt",
  "schedule": "once",
  "status": "active",
  "cronExpression": "cronExpression",
  "deliveryEmail": true,
  "deliveryEmailAddress": "dev@stainless.com",
  "deliveryPhoneNumber": "deliveryPhoneNumber",
  "deliverySms": true,
  "destinations": [
    {
      "type": "email",
      "value": "value",
      "label": "label"
    }
  ],
  "lastRunAt": "2019-12-27T18:11:19.117Z",
  "nextRunAt": "2019-12-27T18:11:19.117Z",
  "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "scheduleDays": [
    "monday"
  ],
  "scheduleTime": "06:56",
  "skillIds": [
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  ],
  "skills": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "content": "content",
      "name": "name",
      "category": "category",
      "createdAt": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "frontmatter": {
        "author": "author",
        "requiredSources": [
          "string"
        ],
        "tags": [
          "string"
        ]
      },
      "iconUrl": "https://example.com",
      "isPublic": true,
      "isUserInvocable": true,
      "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "slug": "slug",
      "updatedAt": "2019-12-27T18:11:19.117Z",
      "version": 0
    }
  ],
  "sourceIds": [
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  ],
  "sources": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "config": {
        "args": [
          "string"
        ],
        "baseUrl": "https://example.com",
        "command": "command",
        "env": {
          "foo": "string"
        },
        "transport": "stdio",
        "url": "https://example.com"
      },
      "name": "name",
      "type": "mcp",
      "authConfig": {
        "headerName": "headerName",
        "prefix": "prefix",
        "provider": "provider"
      },
      "authType": "none",
      "composioConnected": true,
      "composioToolkit": "composioToolkit",
      "createdAt": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "iconUrl": "https://example.com",
      "isActive": true,
      "lastConnectedAt": "2019-12-27T18:11:19.117Z",
      "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "slug": "slug",
      "tools": [
        {
          "description": "description",
          "inputSchema": {},
          "name": "name"
        }
      ],
      "updatedAt": "2019-12-27T18:11:19.117Z"
    }
  ],
  "timezone": "timezone",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "userId": "userId"
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "createdAt": "2019-12-27T18:11:19.117Z",
  "model": "model",
  "name": "name",
  "prompt": "prompt",
  "schedule": "once",
  "status": "active",
  "cronExpression": "cronExpression",
  "deliveryEmail": true,
  "deliveryEmailAddress": "dev@stainless.com",
  "deliveryPhoneNumber": "deliveryPhoneNumber",
  "deliverySms": true,
  "destinations": [
    {
      "type": "email",
      "value": "value",
      "label": "label"
    }
  ],
  "lastRunAt": "2019-12-27T18:11:19.117Z",
  "nextRunAt": "2019-12-27T18:11:19.117Z",
  "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "scheduleDays": [
    "monday"
  ],
  "scheduleTime": "06:56",
  "skillIds": [
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  ],
  "skills": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "content": "content",
      "name": "name",
      "category": "category",
      "createdAt": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "frontmatter": {
        "author": "author",
        "requiredSources": [
          "string"
        ],
        "tags": [
          "string"
        ]
      },
      "iconUrl": "https://example.com",
      "isPublic": true,
      "isUserInvocable": true,
      "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "slug": "slug",
      "updatedAt": "2019-12-27T18:11:19.117Z",
      "version": 0
    }
  ],
  "sourceIds": [
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
  ],
  "sources": [
    {
      "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "config": {
        "args": [
          "string"
        ],
        "baseUrl": "https://example.com",
        "command": "command",
        "env": {
          "foo": "string"
        },
        "transport": "stdio",
        "url": "https://example.com"
      },
      "name": "name",
      "type": "mcp",
      "authConfig": {
        "headerName": "headerName",
        "prefix": "prefix",
        "provider": "provider"
      },
      "authType": "none",
      "composioConnected": true,
      "composioToolkit": "composioToolkit",
      "createdAt": "2019-12-27T18:11:19.117Z",
      "description": "description",
      "iconUrl": "https://example.com",
      "isActive": true,
      "lastConnectedAt": "2019-12-27T18:11:19.117Z",
      "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
      "slug": "slug",
      "tools": [
        {
          "description": "description",
          "inputSchema": {},
          "name": "name"
        }
      ],
      "updatedAt": "2019-12-27T18:11:19.117Z"
    }
  ],
  "timezone": "timezone",
  "updatedAt": "2019-12-27T18:11:19.117Z",
  "userId": "userId"
}