Schedule

This endpoint is used to create, update, search or delete schedules for a particular workspace inside an organization, this is useful when you need to create schedule task or running jobs in a particular time.

Entity fields:

Path
Type
Description

data.type

string

Should be "template"

data.attributes.cron

string

Cron expression to schedule a job inside a workspace. For more information please visit Quartz documentation.

data.attributes.tcl

string

Terrakube configuration language in base64

data.attributes.templateReference

string

Terrakube template id

To better understand Terrakube Configuration Language job templates please refer to the following GitHub repository.

Example:

{
  "data": {
    "type": "schedule",
    "attributes": {
      "cron": "0 0/1 * * * ?",
      "tcl": "{{templateSample}}"
    }
  }
}

Supported Operations

Returns an instance of type schedule

get

/workspace/{workspaceId}/schedule/{scheduleId}

Path parameters
workspaceIdstringrequired

workspace Identifier

scheduleIdstringrequired

schedule Identifier

Query parameters
fields[schedule]string · enum[]

Selects the set of schedule fields that should be returned in the result.

includestring · enum[]

Selects the set of relationships that should be expanded as a compound document in the result.

Responses
curl -L \
  --url '/api/v1/workspace/{workspaceId}/schedule/{scheduleId}'
{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "createdBy": "text",
      "createdDate": "2025-02-22T00:17:33.030Z",
      "cron": "text",
      "description": "text",
      "enabled": true,
      "tcl": "text",
      "updatedBy": "text",
      "updatedDate": "2025-02-22T00:17:33.030Z"
    },
    "relationships": {
      "workspace": {
        "id": "text",
        "type": "workspace"
      }
    }
  },
  "included": [
    {
      "attributes": {},
      "id": "text",
      "relationships": {},
      "type": "text"
    }
  ]
}

Creates an item of type schedule and adds it to schedule

post

/workspace/{workspaceId}/schedule

Path parameters
workspaceIdstringrequired

workspace Identifier

Body
dataobject
Responses
curl -L \
  --request POST \
  --url '/api/v1/workspace/{workspaceId}/schedule' \
  --header 'Content-Type: application/vnd.api+json'
{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "createdBy": "text",
      "createdDate": "2025-02-22T00:17:33.030Z",
      "cron": "text",
      "description": "text",
      "enabled": true,
      "tcl": "text",
      "updatedBy": "text",
      "updatedDate": "2025-02-22T00:17:33.030Z"
    },
    "relationships": {
      "workspace": {
        "id": "text",
        "type": "workspace"
      }
    }
  }
}

Deletes an instance of type schedule

delete

/workspace/{workspaceId}/schedule/{scheduleId}

Path parameters
workspaceIdstringrequired

workspace Identifier

scheduleIdstringrequired

schedule Identifier

Responses
curl -L \
  --request DELETE \
  --url '/api/v1/workspace/{workspaceId}/schedule/{scheduleId}'

No body

Modifies an instance of type schedule

patch

/workspace/{workspaceId}/schedule/{scheduleId}

Path parameters
workspaceIdstringrequired

workspace Identifier

scheduleIdstringrequired

schedule Identifier

Body
dataobject
Responses
curl -L \
  --request PATCH \
  --url '/api/v1/workspace/{workspaceId}/schedule/{scheduleId}' \
  --header 'Content-Type: application/vnd.api+json'

No body

For a complete list of organization operation please visit the OpenAPI specification

Was this helpful?