Skip to main content
POST
Create a scheduled task
Creates a scheduled task owned by this workspace API key. New tasks start with active set to true. The response status is 201. The body does not include runCount.

Base URL

Dedicated deploymentsReplace api.langdock.com with <your-deployment-url>/api/public in all requests.

Required scopes

This endpoint requires the AUTOMATION_API scope (Scheduled Tasks API) on a workspace API key. A workspace can hold 10 tasks for this owner. The next create returns 400 with AUTOMATION_LIMIT_REACHED. An expired trial returns 403 with TRIAL_EXPIRED.

Parameters

Send a JSON body. Unknown fields are rejected. Schedule rules are on the Scheduled Tasks API Overview.

Example

Response format

Success response (201 Created)

automation matches the scheduled task object without runCount.

Error handling

An invalid body returns 400 with message Invalid request and an errors array. Missing clock fields use timeOfDay is required for scheduled automations, dayOfWeek is required for weekly automations, dayOfMonth is required for monthly automations, or daysOfWeek is required for selected weekday automations. An invalid timezone uses timezone must be a valid IANA identifier. modelMode EXPLICIT without modelId uses modelId is required for explicit model selection. An expired trial returns 403 with code TRIAL_EXPIRED and message Your trial has expired. Upgrade to continue.
Langdock intentionally blocks browser-origin requests to protect your API key and ensure your applications remain secure. For more information, please see our guide on API Key Best Practices.

Authorizations

Authorization
string
header
required

API key as Bearer token. Format "Bearer YOUR_API_KEY"

Body

application/json
name
string
required
Required string length: 1 - 200
prompt
string
required
Required string length: 1 - 120000
frequency
enum<string>
required
Available options:
MANUAL,
DAILY,
WEEKDAYS,
WEEKLY,
MONTHLY,
SELECTED_WEEKDAYS
timeOfDay
string | null

24 hour HH:mm. Required unless frequency is MANUAL.

dayOfWeek
integer | null

Required for WEEKLY. 0 is Sunday and 6 is Saturday.

Required range: 0 <= x <= 6
dayOfMonth
integer | null

Required for MONTHLY.

Required range: 1 <= x <= 31
daysOfWeek
integer[]

Required for SELECTED_WEEKDAYS.

Maximum array length: 7
Required range: 0 <= x <= 6
timezone
string | null

IANA timezone. Empty or omitted on a scheduled frequency is stored as UTC.

Maximum string length: 64
modelMode
enum<string>
Available options:
UNSET,
EXPLICIT,
AUTO
modelId
string<uuid> | null

Required in the same request when modelMode is EXPLICIT.

assistantId
string<uuid> | null
taggedAssistantId
string<uuid> | null
taggedIntegrationIds
string<uuid>[]
Maximum array length: 20
taggedKnowledgeFolderIds
string<uuid>[]
Maximum array length: 20
taggedWorkflowIds
string<uuid>[]
Maximum array length: 20
taggedSkillSlugs
string[]
Maximum array length: 20
Maximum string length: 100
attachmentIds
string<uuid>[]
Maximum array length: 20

Response

Scheduled task created. The automation object does not include runCount.