POST
/
v1
/
teams
/
{teamId}
/
agent-schedules
TypeScript client
import { OctosparkClient } from '@octospark/sdk'

const client = new OctosparkClient({
  token: process.env.OCTOSPARK_TOKEN
})

const response = await client.agentSchedules.createAgentSchedule({
  teamId: process.env.OCTOSPARK_TEAM_ID ?? "teamId",
  body: {},
})
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "teamId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "brief": "<string>",
  "cadence": "<string>",
  "nextRunAt": "<string>",
  "lastRunAt": "<string>",
  "perRunCreditCeilingDecimillicents": 123,
  "dailyCreditCeilingDecimillicents": 1,
  "pendingItemCap": 50,
  "pausedAt": "<string>",
  "createdBy": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "createdAt": "<string>",
  "updatedAt": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

idempotency-key
string

Reuse this key with the same creation request after a lost response. The original automation is returned; a different request is rejected.

Required string length: 1 - 200

Path Parameters

teamId
string
required

Team (workspace) id (UUID). Discover ids via the list teams endpoint or the agent context.

Body

application/json
name
string
required

Display name for the automation, 1-120 characters.

Required string length: 1 - 120
brief
string
required

The instruction the scheduled run starts from - the prompt handed to the agent.

Required string length: 1 - 20000
cadence
string
required

Five-field cron expression (minute hour day-of-month month day-of-week), evaluated in UTC. Invalid expressions are rejected 400.

Required string length: 1 - 100
Examples:

"0 9 * * *"

"*/30 * * * 1-5"

perRunCreditCeilingDecimillicents
integer

Per-run credit ceiling in decimillicents. A scheduled run stops (incomplete, surfaced in the inbox) when it reaches this spend. Omit for the default of $100 per run (1000000000 decimillicents).

dailyCreditCeilingDecimillicents
integer | null

Daily credit ceiling in decimillicents across all of this schedule's runs (UTC day). The sweeper skips firing once reached. Omit for the default of $100 per day (1000000000 decimillicents); send null explicitly for no daily ceiling.

Required range: x > 0
pendingItemCap
integer

Skip firing while this many (or more) of the schedule's runs sit unreviewed in the inbox, 1-100 (default 10). Keeps a broken automation from flooding the queue.

Required range: 1 <= x <= 100

Response

Success

id
string<uuid>
required

a Universally Unique Identifier

Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
organizationId
string<uuid>
required

a Universally Unique Identifier

Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
teamId
string<uuid>
required

a Universally Unique Identifier

Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
name
string
required

Display name for the automation, 1-120 characters.

Required string length: 1 - 120
brief
string
required

The instruction the scheduled run starts from - the prompt handed to the agent.

Required string length: 1 - 20000
cadence
string
required

Five-field cron expression (minute hour day-of-month month day-of-week), evaluated in UTC. Invalid expressions are rejected 400.

Required string length: 1 - 100
Examples:

"0 9 * * *"

"*/30 * * * 1-5"

nextRunAt
string
required

When the schedule next fires (ISO-8601 UTC).

lastRunAt
string | null
required

When the sweeper last fired this schedule (ISO-8601 UTC); null before the first run.

perRunCreditCeilingDecimillicents
integer
required

Per-run credit ceiling in decimillicents. A scheduled run stops (incomplete, surfaced in the inbox) when it reaches this spend.

dailyCreditCeilingDecimillicents
integer | null
required

Optional daily credit ceiling in decimillicents across all of this schedule's runs (UTC day). The sweeper skips firing once reached; send null for no daily ceiling.

Required range: x > 0
pendingItemCap
integer
required

Skip firing while this many (or more) of the schedule's runs sit unreviewed in the inbox, 1-100 (default 10). Keeps a broken automation from flooding the queue.

Required range: 1 <= x <= 100
pausedAt
string | null
required

When the schedule was paused (ISO-8601 UTC); null while active. A paused schedule never fires.

createdBy
string<uuid>
required

a Universally Unique Identifier

Pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
createdAt
string
required
updatedAt
string
required