Skip to content
Get started

Run a task immediately

POST/api/promptly/tasks/{taskId}/run

Execute a task immediately, regardless of its schedule

Path ParametersExpand Collapse
taskId: string
formatuuid
ReturnsExpand Collapse
TaskRun = object { id, completedAt, costCents, 9 more }
id: optional string
formatuuid
completedAt: optional string
formatdate-time
costCents: optional number

Cost in cents

createdAt: optional string
formatdate-time
deliveryStatus: optional "pending" or "delivered" or "failed"
Accepts one of the following:
"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
formatdate-time
status: optional "pending" or "running" or "completed" or "failed"
Accepts one of the following:
"pending"
"running"
"completed"
"failed"
taskId: optional string
formatuuid
tokensUsed: optional number

Total tokens consumed

Run a task immediately

curl https://0ct.com/api/promptly/tasks/$TASK_ID/run \
    -X POST \
    -H "Authorization: Bearer $0CT_API_KEY"
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "completedAt": "2019-12-27T18:11:19.117Z",
  "costCents": 0,
  "createdAt": "2019-12-27T18:11:19.117Z",
  "deliveryStatus": "pending",
  "durationMs": 0,
  "error": "error",
  "output": "output",
  "startedAt": "2019-12-27T18:11:19.117Z",
  "status": "pending",
  "taskId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "tokensUsed": 0
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "completedAt": "2019-12-27T18:11:19.117Z",
  "costCents": 0,
  "createdAt": "2019-12-27T18:11:19.117Z",
  "deliveryStatus": "pending",
  "durationMs": 0,
  "error": "error",
  "output": "output",
  "startedAt": "2019-12-27T18:11:19.117Z",
  "status": "pending",
  "taskId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "tokensUsed": 0
}