For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

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 "schedule"

data.attributes.cron

string

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

data.attributes.templateReference

string

Terrakube template id

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

In 2.34.0, the deprecated tcl field is excluded from the API. Use templateReference to select an organization template.

Example:

{
  "data": {
    "type": "schedule",
    "attributes": {
      "cron": "0 0/1 * * * ?",
      "templateReference": "<template id>"
    }
  }
}

Supported Operations

get

Returns the relationship schedule

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
workspaceIdstringRequired

workspace Identifier

Query parameters
filter[schedule]stringOptional

Filters the collection of schedule using a 'disjoint' RSQL expression

page[number]integer · int32Optional

Number of pages to return. Can be used with page[size]

page[size]integer · int32Optional

Number of elements per page. Can be used with page[number]

page[offset]integer · int32Optional

Offset from 0 to start paginating. Can be used with page[limit]

page[limit]integer · int32Optional

Maximum number of items to return. Can be used with page[offset]

page[totals]stringOptional

For requesting total pages/records be included in the response page meta data

Responses
200

Successful response

application/vnd.api+json
get/workspace/{workspaceId}/schedule
GET /api/v1/workspace/{workspaceId}/schedule HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Successful response

{
  "data": [
    {
      "type": "text",
      "id": "text",
      "attributes": {
        "createdBy": null,
        "createdDate": null,
        "cron": null,
        "description": null,
        "enabled": null,
        "templateReference": null,
        "updatedBy": null,
        "updatedDate": null
      },
      "relationships": {
        "workspace": {
          "data": [
            null
          ]
        }
      }
    }
  ],
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
post

Creates an item of type schedule and adds it to schedule

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
workspaceIdstringRequired

workspace Identifier

Body
Responses
201

Successful response

application/vnd.api+json
post/workspace/{workspaceId}/schedule
POST /api/v1/workspace/{workspaceId}/schedule HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 316

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "createdBy": null,
      "createdDate": null,
      "cron": null,
      "description": null,
      "enabled": null,
      "templateReference": null,
      "updatedBy": null,
      "updatedDate": null
    },
    "relationships": {
      "workspace": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
201

Successful response

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "createdBy": null,
      "createdDate": null,
      "cron": null,
      "description": null,
      "enabled": null,
      "templateReference": null,
      "updatedBy": null,
      "updatedDate": null
    },
    "relationships": {
      "workspace": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
delete

Deletes an instance of type schedule

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
workspaceIdstringRequired

workspace Identifier

scheduleIdstringRequired

schedule Identifier

Responses
204

Successful response

No content

delete/workspace/{workspaceId}/schedule/{scheduleId}
DELETE /api/v1/workspace/{workspaceId}/schedule/{scheduleId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
204

Successful response

No content

patch

Modifies an instance of type schedule

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
workspaceIdstringRequired

workspace Identifier

scheduleIdstringRequired

schedule Identifier

Body
Responses
204

Successful response

No content

patch/workspace/{workspaceId}/schedule/{scheduleId}
PATCH /api/v1/workspace/{workspaceId}/schedule/{scheduleId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/vnd.api+json
Accept: */*
Content-Length: 316

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "createdBy": null,
      "createdDate": null,
      "cron": null,
      "description": null,
      "enabled": null,
      "templateReference": null,
      "updatedBy": null,
      "updatedDate": null
    },
    "relationships": {
      "workspace": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}
204

Successful response

No content

get

Returns an instance of type schedule

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
workspaceIdstringRequired

workspace Identifier

scheduleIdstringRequired

schedule Identifier

Query parameters
Responses
200

Successful response

application/vnd.api+json
get/workspace/{workspaceId}/schedule/{scheduleId}
GET /api/v1/workspace/{workspaceId}/schedule/{scheduleId} HTTP/1.1
Host: terrakube-api.example.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
200

Successful response

{
  "data": {
    "type": "text",
    "id": "text",
    "attributes": {
      "createdBy": null,
      "createdDate": null,
      "cron": null,
      "description": null,
      "enabled": null,
      "templateReference": null,
      "updatedBy": null,
      "updatedDate": null
    },
    "relationships": {
      "workspace": {
        "data": [
          null
        ]
      }
    }
  },
  "included": [
    {
      "type": "text",
      "id": "text",
      "attributes": {},
      "relationships": {}
    }
  ]
}

The complete OpenAPI specification is available as terrakube-api.json, and in the UI under Help & Support → API Docs.

Last updated

Was this helpful?