All API resources
Scheduled tasks
Prosaic AI tasks that run a prompt unattended on a schedule, and running one now.
Base URL https://app.prosaic.works/api/public/v1. Every request needs an API key or access token; see the overview.
List scheduled tasks
/api/public/v1/scheduled-tasksSDK: prosaic.scheduledTasks.list()
Returns the Prosaic AI scheduled tasks in the workspace associated with the API key, newest first.
Responses
200 Successful response
dataarray of objectsrequiredShow 16 child attributesHide child attributes
idstringrequirednamestringrequiredpromptstringrequiredentityIdstringrequirednullablecronstringrequiredschedulestringrequiredtimezonestringrequiredisEnabledbooleanrequiredautoApproveWritesbooleanrequiredemailTostringrequirednullablelastRunAtstring (date-time)requirednullablelastStatusstringrequirednullablelastErrorstringrequirednullablerunCountnumberrequiredcreatedAtstring (date-time)requiredupdatedAtstring (date-time)required
metaobjectShow 1 child attributeHide child attributes
countnumberrequired
401Unauthorized403Insufficient role404Workspace not found500Internal server error
const { data } = await prosaic.scheduledTasks.list();curl https://app.prosaic.works/api/public/v1/scheduled-tasks \
-H "Authorization: Bearer $PROSAIC_API_KEY"Get a scheduled task
/api/public/v1/scheduled-tasks/{id}SDK: prosaic.scheduledTasks.retrieve(id)
Returns a single Prosaic AI scheduled task, including how its last run went.
Path parameters
idstringrequired
Responses
200 Successful response
dataobjectrequiredShow 16 child attributesHide child attributes
idstringrequirednamestringrequiredpromptstringrequiredentityIdstringrequirednullablecronstringrequiredschedulestringrequiredtimezonestringrequiredisEnabledbooleanrequiredautoApproveWritesbooleanrequiredemailTostringrequirednullablelastRunAtstring (date-time)requirednullablelastStatusstringrequirednullablelastErrorstringrequirednullablerunCountnumberrequiredcreatedAtstring (date-time)requiredupdatedAtstring (date-time)required
metaobjectShow 1 child attributeHide child attributes
countnumberrequired
401Unauthorized403Insufficient role404Task not found500Internal server error
const { data } = await prosaic.scheduledTasks.retrieve(id);curl https://app.prosaic.works/api/public/v1/scheduled-tasks/$ID \
-H "Authorization: Bearer $PROSAIC_API_KEY"Create a scheduled task
/api/public/v1/scheduled-tasksSDK: prosaic.scheduledTasks.create(params)
Creates a Prosaic AI scheduled task. The task runs its prompt unattended on the given cadence, in Pacific/Auckland time.
emailTo must be the address of a member of the same workspace — a task is a
standing instruction to send a workspace's books somewhere, so arbitrary
recipients are refused with 400.
Request body
application/json
namestringrequiredpromptstringrequiredscheduleobjectrequiredShow 5 child attributesHide child attributes
cadencestringrequiredOne of:
daily,weekdays,weekly,monthlyhournumberrequiredminutenumberrequiredweekdaynumberdayOfMonthnumber
entityIdstringnullableisEnabledbooleanautoApproveWritesbooleanemailTostringnullable
Responses
201 Successful response
dataobjectrequiredShow 16 child attributesHide child attributes
idstringrequirednamestringrequiredpromptstringrequiredentityIdstringrequirednullablecronstringrequiredschedulestringrequiredtimezonestringrequiredisEnabledbooleanrequiredautoApproveWritesbooleanrequiredemailTostringrequirednullablelastRunAtstring (date-time)requirednullablelastStatusstringrequirednullablelastErrorstringrequirednullablerunCountnumberrequiredcreatedAtstring (date-time)requiredupdatedAtstring (date-time)required
400Validation failed, or the email recipient is not a workspace member401Unauthorized403Entity is outside the caller's access404Workspace not found409Workspace is at its scheduled-task limit500Internal server error
const { data } = await prosaic.scheduledTasks.create({
name: 'Example Ltd',
prompt: 'string',
schedule: {
cadence: 'daily',
hour: 1,
minute: 1,
},
});curl -X POST https://app.prosaic.works/api/public/v1/scheduled-tasks \
-H "Authorization: Bearer $PROSAIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Example Ltd",
"prompt": "string",
"schedule": {
"cadence": "daily",
"hour": 1,
"minute": 1
}
}'Update a scheduled task
/api/public/v1/scheduled-tasks/{id}SDK: prosaic.scheduledTasks.update(id, params)
Updates a Prosaic AI scheduled task. Every field is optional; omitted fields are
left as they are. Supplying schedule replaces the cadence, and isEnabled
is how a task is paused or resumed.
Path parameters
idstringrequired
Request body
application/json
namestringpromptstringentityIdstringnullablescheduleobjectShow 5 child attributesHide child attributes
cadencestringrequiredOne of:
daily,weekdays,weekly,monthlyhournumberrequiredminutenumberrequiredweekdaynumberdayOfMonthnumber
isEnabledbooleanautoApproveWritesbooleanemailTostringnullable
Responses
200 Successful response
dataobjectrequiredShow 16 child attributesHide child attributes
idstringrequirednamestringrequiredpromptstringrequiredentityIdstringrequirednullablecronstringrequiredschedulestringrequiredtimezonestringrequiredisEnabledbooleanrequiredautoApproveWritesbooleanrequiredemailTostringrequirednullablelastRunAtstring (date-time)requirednullablelastStatusstringrequirednullablelastErrorstringrequirednullablerunCountnumberrequiredcreatedAtstring (date-time)requiredupdatedAtstring (date-time)required
metaobjectShow 1 child attributeHide child attributes
countnumberrequired
400Validation failed, or the email recipient is not a workspace member401Unauthorized403Entity is outside the caller's access404Task not found500Internal server error
const { data } = await prosaic.scheduledTasks.update(id, {
name: 'Example Ltd',
prompt: 'string',
entityId: 'ENTITY_ID',
schedule: {
cadence: 'daily',
hour: 1,
minute: 1,
},
isEnabled: true,
autoApproveWrites: true,
emailTo: 'accounts@example.com',
});curl -X PATCH https://app.prosaic.works/api/public/v1/scheduled-tasks/$ID \
-H "Authorization: Bearer $PROSAIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Example Ltd",
"prompt": "string",
"entityId": "ENTITY_ID",
"schedule": {
"cadence": "daily",
"hour": 1,
"minute": 1
},
"isEnabled": true,
"autoApproveWrites": true,
"emailTo": "accounts@example.com"
}'Run a scheduled task now
/api/public/v1/scheduled-tasks/{id}/runSDK: prosaic.scheduledTasks.run(id)
Queues one immediate run of the task without touching its schedule. The run is
enqueued rather than executed inline, so a 202 means "accepted", not "finished" —
poll the task and read lastRunAt / lastStatus to see how it went.
Note the run executes with the task's own settings, which includes writing to the
books unattended when autoApproveWrites is true.
Path parameters
idstringrequired
Responses
202 Successful response
dataobjectrequiredShow 2 child attributesHide child attributes
idstringrequiredqueuedbooleanrequired
metaobjectShow 1 child attributeHide child attributes
countnumberrequired
400Invalid task ID401Unauthorized403Insufficient role404Task not found500Internal server error
const { data } = await prosaic.scheduledTasks.run(id);curl -X POST https://app.prosaic.works/api/public/v1/scheduled-tasks/$ID/run \
-H "Authorization: Bearer $PROSAIC_API_KEY"Delete a scheduled task
/api/public/v1/scheduled-tasks/{id}SDK: prosaic.scheduledTasks.del(id)
Soft-deletes a Prosaic AI scheduled task and unregisters its schedule. The chat sessions its past runs produced are kept — they are the record of what was spent and what was changed.
Path parameters
idstringrequired
Responses
200 Successful response
dataobjectrequiredShow 2 child attributesHide child attributes
idstringrequireddeletedbooleanrequired
metaobjectShow 1 child attributeHide child attributes
countnumberrequired
401Unauthorized403Insufficient role404Task not found500Internal server error
const { data } = await prosaic.scheduledTasks.del(id);curl -X DELETE https://app.prosaic.works/api/public/v1/scheduled-tasks/$ID \
-H "Authorization: Bearer $PROSAIC_API_KEY"