Scheduler Admin API
Introduction
This is the admin client API specification for the Unity Scheduler service. The Scheduler service is responsible for scheduling events to be sent to the Triggers service.
Rate Limits
The API has rate limiting in place. Request are limited on a per-user basis to 600 requests per minute which would allow for a sustained 10 requests per second.
The List endpoint is limited to 120 requests per minute, which allows for sustained 2 requests per second.
The API responds with a HTTP status code if the rate limit is exceeded.
It will also respond with a header to be used in conjunction with a client's retry logic. The value is the number of seconds until a request for the given player will be accepted.
429Retry-AfterDownload OpenAPI specification:
List Scheduler Configs
Get list of schedules for the given project and environment
Authorizations
ServiceAccount (scheduler.configs.list)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.list
Path parameters for "{title}"
The project's Project ID
Header parameters for "{title}"
Live Release name to scope the request to. Validated by the gateway's Live Releases filter and resolved to unity-live-release-id. Create assigns the schedule to the release; list, get and delete see only that release's schedules. Deleting a schedule that belongs to a release without this header returns 409.
Code samples for "{title}":
Request example
curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs"
Response example
{ "after": "eyJTZWFyY2hBZnRlciI6WzAsMSwyMl0sIlNjcm9sbElEIjoiIiwiUG9pbnRJblRpbWVJRCI6IjAwMCJ9=", "configs": [ { "eventName": "example-event", "id": "00000000-0000-0000-0000-000000000001", "name": "Example Recurring", "payload": "{}", "payloadVersion": 1, "schedule": "0 * * * *", "status": "active", "type": "recurring" }, { "eventName": "example-event", "id": "00000000-0000-0000-0000-000000000002", "name": "Example One Time", "payload": "{}", "payloadVersion": 1, "schedule": "2023-10-02T15:00:00Z", "status": "active", "type": "one-time" } ]}
Create Schedule Config
Add schedule to project environment
Authorizations
ServiceAccount (scheduler.configs.create)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.create
Path parameters for "{title}"
The project's Project ID
Header parameters for "{title}"
Live Release name to scope the request to. Validated by the gateway's Live Releases filter and resolved to unity-live-release-id. Create assigns the schedule to the release; list, get and delete see only that release's schedules. Deleting a schedule that belongs to a release without this header returns 409.
Request body for "{title}"
Media Type:
application/jsonThe schedule event name is passed through to the triggers service as part of the event type so that the trigger event is defined as
The triggers service uses this to identify incoming events and execute the configured action.
For a trigger configuration to action an incoming event with type , it would require a value of to be passed in here.
com.unity.services.scheduler.{scheduleEventName}.v1com.unity.services.scheduler.example-event.v1example-eventDefines when the planned event should occur.
If the schedule config has a type of this field must have a valid RFC3339 timestamp.
one-timeIf the schedule config has a type of this field must be a fixed
period of the form , where unit is one of (minutes),
(hours), (days), or (weeks) — for example (every 3 days)
or (every 2 weeks). The period must be at least 60 minutes (the same
floor as recurring), so is accepted but is rejected. Unlike
cron, an interval is a true fixed period that does not reset at month
boundaries. When is set the cadence is anchored to it. Combined
units (e.g. ) are not supported.
interval<number><unit>mhdw3d2w90m30mstartAt1d12hIf the schedule config has a type of this field must have a valid cron expression as per below:
recurringField name | Allowed values | Allowed special characters |
|---|---|---|
| Minutes | 0-59 | * / , - |
| Hours | 0-23 | * / , - |
| Day of month | 1-31 | * / , - |
| Month | 1-12 or JAN-DEC | * / , - |
| Day of week | 0-6 or SUN-SAT | * / , - |
Recurring and interval schedules have a minimum scheduled frequency of once per hour.
Code samples for "{title}":
Request example
curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '{ "endAt": "2024-01-01T00:00:00Z", "eventName": "string", "name": "string", "payload": "string", "payloadVersion": 0, "schedule": "string", "startAt": "2024-01-01T00:00:00Z", "type": "recurring"}' \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs"
Response example
{ "id": "string"}
Get Schedule Config
Retrieves the configuration for a specific schedule
Authorizations
ServiceAccount (scheduler.configs.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.get
Path parameters for "{title}"
The project's Project ID
Header parameters for "{title}"
Live Release name to scope the request to. Validated by the gateway's Live Releases filter and resolved to unity-live-release-id. Create assigns the schedule to the release; list, get and delete see only that release's schedules. Deleting a schedule that belongs to a release without this header returns 409.
Code samples for "{title}":
Request example
curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs/{configId}"
Response example
{ "eventName": "example-event", "id": "00000000-0000-0000-0000-000000000001", "name": "Example Recurring Event", "payload": "{}", "payloadVersion": 1, "schedule": "0 * * * *", "status": "active", "type": "recurring"}
Update Schedule Config Status
Activates or deactivates a schedule config. Deactivating pauses the schedule so it stops firing;
activating resumes it. Fires that would have occurred while the schedule was deactivated are
skipped and are not made up on activation. An or one-time schedule cannot be changed (). The request is idempotent: setting the current status succeeds.
expired409One-time schedules cannot be deactivated and return . Deactivated schedules still count
towards the schedule limit.
409Authorizations
ServiceAccount (scheduler.configs.update)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.update
Path parameters for "{title}"
The project's Project ID
Header parameters for "{title}"
Live Release name to scope the request to. Validated by the gateway's Live Releases filter and resolved to unity-live-release-id. Create assigns the schedule to the release; list, get and delete see only that release's schedules. Deleting a schedule that belongs to a release without this header returns 409.
Code samples for "{title}":
Request example
curl -X PATCH \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '{ "status": "active"}' \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs/{configId}"
Response example
{ "eventName": "example-event", "id": "00000000-0000-0000-0000-000000000001", "name": "Example Recurring Event", "payload": "{}", "payloadVersion": 1, "schedule": "0 * * * *", "status": "inactive", "type": "recurring"}
Delete Schedule Config
Deletes the configuration for a specific schedule
Authorizations
ServiceAccount (scheduler.configs.delete)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.delete
Path parameters for "{title}"
The project's Project ID
Header parameters for "{title}"
Live Release name to scope the request to. Validated by the gateway's Live Releases filter and resolved to unity-live-release-id. Create assigns the schedule to the release; list, get and delete see only that release's schedules. Deleting a schedule that belongs to a release without this header returns 409.
Code samples for "{title}":
Request example
curl -X DELETE \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs/{configId}"
Response example
{ "code": 55, "detail": "Failed to parse request body. Error: Unexpected end of JSON input", "status": 400, "title": "Bad Request", "type": "problems/basic"}
Delete Schedule Configs
Deletes multiple schedule configurations
Authorizations
ServiceAccount (scheduler.configs.delete)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.delete
Path parameters for "{title}"
The project's Project ID
Header parameters for "{title}"
Live Release name to scope the request to. Validated by the gateway's Live Releases filter and resolved to unity-live-release-id. Create assigns the schedule to the release; list, get and delete see only that release's schedules. Deleting a schedule that belongs to a release without this header returns 409.
Code samples for "{title}":
Request example
curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '[ "string"]' \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs:batch-delete"
Response example
{ "errors": { "00000000-0000-0000-0000-000000000001": { "code": 55, "detail": "Bad request", "instance": null, "status": 400, "title": "Error", "type": "problems/basic" }, "00000000-0000-0000-0000-000000000002": { "code": 3, "detail": "Temporary Service Error", "instance": null, "status": 503, "title": "Error", "type": "problems/basic" } }}