Documentation menu

Agent Jobs

8 operations.

List agent jobs

GET/api/v1/projects/{projectId}/environments/{environmentId}/agent-jobs

List all Agent Job schedules for a Project and Environment.

Parameters

path

NameTypeRequiredDescription
projectIdstringrequiredIdentifies the Project that owns the addressed resource. Applies to List agent jobs.
environmentIdstringrequiredIdentifies the Project environment addressed by the operation. Applies to List agent jobs.

query

NameTypeRequiredDescription
sort"name" | "createdAt" | "updatedAt" | "nextFireAt"optionalSelects the resource field used to order results. Applies to List agent jobs.
order"asc" | "desc"optionalSelects ascending or descending order for the requested sort field. Applies to List agent jobs.
limitintegeroptionalSets the maximum number of resources returned in this page. Applies to List agent jobs.
cursorstringoptionalOpaque cursor returned by the previous page; omit it to read the first page. Applies to List agent jobs.
enabledbooleanoptionalFilters scheduled jobs by whether they are enabled. Applies to List agent jobs.

Responses

StatusDescriptionBody
200Response for status 200
application/json
object
  • agentJobs (required): array<object>
  • pagination (required): object
400Bad Request
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
404Project not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object

Create agent job

POST/api/v1/projects/{projectId}/environments/{environmentId}/agent-jobs

Create a new agent job schedule for a Project Agent in an Environment.

Parameters

path

NameTypeRequiredDescription
projectIdstringrequiredIdentifies the Project that owns the addressed resource. Applies to Create agent job.
environmentIdstringrequiredIdentifies the Project environment addressed by the operation. Applies to Create agent job.

Request body

required — Request body for: Create agent job.

application/json

NameTypeRequiredDescription
namestringrequired
enabledbooleanoptional
kind"cron" | "event_driven" | "ad_hoc"required
scheduleone of 2 typesoptional
targetone of 3 typesrequired

Responses

StatusDescriptionBody
201Response for status 201
application/json
object
  • type (required): "agentJob"
  • id (required): string
  • name (required): string
  • enabled (required): boolean
  • kind (required): "cron" | "event_driven" | "ad_hoc"
  • schedule (required): one of 2 types
  • target (required): one of 3 types
  • nextFireAt (required): one of 2 types
  • scheduleSyncState (required): "pending" | "synced" | "error"
  • createdByUserId (required): string
  • updatedByUserId (required): string
  • createdAt (required): string
  • updatedAt (required): string
400Invalid cron expression or duplicate agent job name.
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
404Project or agent target not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object

Get agent job

GET/api/v1/projects/{projectId}/environments/{environmentId}/agent-jobs/{agentJobId}

Retrieve an agent job schedule by id.

Parameters

path

NameTypeRequiredDescription
projectIdstringrequiredIdentifies the Project that owns the addressed resource. Applies to Get agent job.
environmentIdstringrequiredIdentifies the Project environment addressed by the operation. Applies to Get agent job.
agentJobIdstringrequiredIdentifies the scheduled agent job. Applies to Get agent job.

Responses

StatusDescriptionBody
200Response for status 200
application/json
object
  • data (required): object
400The request is malformed or cannot be processed.
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
404Agent job or project not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object

Update agent job

PATCH/api/v1/projects/{projectId}/environments/{environmentId}/agent-jobs/{agentJobId}

Update an agent job schedule. Supports partial update via body fields.

Parameters

path

NameTypeRequiredDescription
projectIdstringrequiredIdentifies the Project that owns the addressed resource. Applies to Update agent job.
environmentIdstringrequiredIdentifies the Project environment addressed by the operation. Applies to Update agent job.
agentJobIdstringrequiredIdentifies the scheduled agent job. Applies to Update agent job.

Request body

required — Request body for: Update agent job.

application/json

NameTypeRequiredDescription
enabledbooleanoptional
kind"cron" | "event_driven" | "ad_hoc"optional
scheduleone of 2 typesoptional
targetone of 3 typesoptional

Responses

StatusDescriptionBody
200Response for status 200
application/json
object
  • data (required): object
400Invalid cron expression.
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
404Agent job, project, or agent target not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object

Delete agent job

DELETE/api/v1/projects/{projectId}/environments/{environmentId}/agent-jobs/{agentJobId}

Delete an agent job schedule.

Parameters

path

NameTypeRequiredDescription
projectIdstringrequiredIdentifies the Project that owns the addressed resource. Applies to Delete agent job.
environmentIdstringrequiredIdentifies the Project environment addressed by the operation. Applies to Delete agent job.
agentJobIdstringrequiredIdentifies the scheduled agent job. Applies to Delete agent job.

Responses

StatusDescriptionBody
204Response for status 204none
400The request is malformed or cannot be processed.
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
404Agent job or project not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object

Get manual agent job fire status

GET/api/v1/projects/{projectId}/environments/{environmentId}/agent-jobs/{agentJobId}/fires/{fireId}

Read the durable status of a manual operation fire. The stored originating job and caller identity remain authoritative after the mutable job is edited or deleted. This endpoint never dispatches work.

Parameters

path

NameTypeRequiredDescription
projectIdstringrequiredIdentifies the Project that owns the addressed resource. Applies to Get manual agent job fire status.
environmentIdstringrequiredIdentifies the Project environment addressed by the operation. Applies to Get manual agent job fire status.
agentJobIdstringrequiredIdentifies the scheduled agent job. Applies to Get manual agent job fire status.
fireIdstringrequiredIdentifies the durable manual fire whose status is being read. Applies to Get manual agent job fire status.

Responses

StatusDescriptionBody
200Response for status 200
application/json
getApiV1ProjectsByProjectIdEnvironmentsByEnvironmentIdAgentJobsByAgentJobIdFiresByFireId
  • data (required): object
202Response for status 202
application/json
object
  • data (required): object
400The request is malformed or cannot be processed.
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
403Access denied. The authenticated user does not have permission to perform this action.
application/json
PublicApiError
  • error (required): object
404Project, agent job, or fire not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object
503Service temporarily unavailable (e.g. execution capacity exhausted). The response carries a Retry-After header; retry with backoff.
application/json
PublicApiError
  • error (required): object

Run agent job now

POST/api/v1/projects/{projectId}/environments/{environmentId}/agent-jobs/{agentJobId}/runs

Trigger an immediate run of a schedule, independent of the cron cadence. The scheduled nextFireAt is preserved so the regular cadence is not disturbed. The standard Idempotency-Key header is required. Reuse the same key for a transport retry: a durable manual operation fire is replayed by its fire identity and status, including lease/approval waits; agent-target claims retain their in-flight retry behavior. A changed request is rejected with 409.

Parameters

path

NameTypeRequiredDescription
projectIdstringrequiredIdentifies the Project that owns the addressed resource. Applies to Run agent job now.
environmentIdstringrequiredIdentifies the Project environment addressed by the operation. Applies to Run agent job now.
agentJobIdstringrequiredIdentifies the scheduled agent job. Applies to Run agent job now.

header

NameTypeRequiredDescription
Idempotency-Keystringrequired

Responses

StatusDescriptionBody
200Response for status 200
application/json
postApiV1ProjectsByProjectIdEnvironmentsByEnvironmentIdAgentJobsByAgentJobIdRuns
  • data (required): one of 3 types
202Response for status 202
application/json
object
  • data (required): one of 3 types
400Bad Request
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
404Resource not found.
application/json
PublicApiError
  • error (required): object
409Request conflicts with current state of the resource, including safe deployment conflict classifications.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object
503Service temporarily unavailable (e.g. execution capacity exhausted). The response carries a Retry-After header; retry with backoff.
application/json
PublicApiError
  • error (required): object

Get agent job run stats

GET/api/v1/projects/{projectId}/environments/{environmentId}/agent-jobs/{agentJobId}/stats

Aggregate Agent run statistics for an agent job over the last rangeDays days (default 7). Returns total run count, error count, and the timestamp of the most recent failure, plus the job's lastFiredAt / nextFireAt for scheduling context.

Parameters

path

NameTypeRequiredDescription
projectIdstringrequiredIdentifies the Project that owns the addressed resource. Applies to Get agent job run stats.
environmentIdstringrequiredIdentifies the Project environment addressed by the operation. Applies to Get agent job run stats.
agentJobIdstringrequiredIdentifies the scheduled agent job. Applies to Get agent job run stats.

query

NameTypeRequiredDescription
rangeDaysintegeroptionalSets the number of recent days included in the job statistics window. Applies to Get agent job run stats.

Responses

StatusDescriptionBody
200Response for status 200
application/json
object
  • data (required): object
400The request is malformed or cannot be processed.
application/json
PublicApiError
  • error (required): object
401Authentication failed. Possible reasons: - Authorization header is not provided - Invalid API key - Session expired
application/json
PublicApiError
  • error (required): object
404Agent job or project not found.
application/json
PublicApiError
  • error (required): object
422Request validation failed. Check the request body, query parameters, or path parameters.
application/json
PublicApiError
  • error (required): object
500The server could not complete the request.
application/json
PublicApiError
  • error (required): object