# Scheduler

A *Scheduler* is a repeating run you register in a *Space*. When you tie one *Script* to a run time, the server runs that *Script* every time that time comes around. For example, in an online clothing store, to run a *Script* once a day that finds products with zero stock and calls the supplier's ordering channel, you create a *Scheduler* that points to that *Script*.

A *Scheduler* is a sub-resource of *Space* managed in CMA, and its path is based on `/spaces/{spaceId}/schedulers`. It has no concept of publishing and no `sys.version`. Once created, it enters the schedule right away, and updates do not need a version header. Instead, two things set it apart from other resources. **The *Script* it runs cannot be changed after creation**, and to create or edit one you need **that *Script*'s run permission** on top of the *Space* settings permission. Each run leaves a *SchedulerLog*; a successful run disappears after 1 hour and a failed run after 3 days.

## Resource structure {#resource-structure}

The following is the response when you create a *Scheduler*. `sys` holds identifiers and references, and the body holds the name, the run time, and whether it is on.

```json
{
  "sys": {
    "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ",
    "type": "Scheduler",
    "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
    "script": { "sys": { "id": "3trmXRMKq7bd0Prbef1NcZ", "type": "Refer", "targetType": "Script" } },
    "createdBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
    "createdAt": "2026-08-26T01:20:07.442Z",
    "updatedBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
    "updatedAt": "2026-08-26T01:20:07.442Z"
  },
  "name": "Stock reorder",
  "cronExpression": "0 0 * * *",
  "activated": true
}
```

Key properties:

- `sys.id`: The unique identifier of the *Scheduler*. It goes into `{schedulerId}` in the single-read, update, and delete paths.
- `sys.script`: The *Script* this schedule will run. **You can set it only at creation and cannot change it afterward.** To run a different *Script*, create a new *Scheduler*.
- `name`: The label shown in the console. It is not used for execution.
- `cronExpression`: When it runs. It has five fields (minute, hour, day of month, month, day of week) and is **interpreted in UTC**. See [Writing the schedule](#cron-expression) below.
- `activated`: Whether it is on. If `false`, the record is kept but it does not run.

There is no `sys.version`. Do not send the `X-Weegloo-Version` header on update requests.

## System properties (sys) {#system-properties-sys}

`space`, `script`, `createdBy`, and `updatedBy` come in the `Refer` shape (`{ "sys": { "id", "type": "Refer", "targetType" } }`).

| Property | Type | Description |
|---|---|---|
| `id` | string | The unique identifier of the resource. |
| `type` | string | The kind of resource. For a *Scheduler* it is always `"Scheduler"`. |
| `space` | Refer&lt;Space&gt; | The *Space* this schedule belongs to. |
| `script` | Refer&lt;Script&gt; | The *Script* to run. Immutable after creation. |
| `createdBy` | Refer&lt;User&gt; | The user who created it. **Execution happens with this user's permissions.** |
| `createdAt` | string (date-time) | The creation time. |
| `updatedBy` | Refer&lt;User&gt; | The user who last updated it. |
| `updatedAt` | string (date-time) | The last update time. |

Body properties:

| Property | Type | Description |
|---|---|---|
| `name` | string (1-64) | The label shown in the console. Not used for execution. |
| `cronExpression` | string (1-128) | When it runs. Five fields (minute, hour, day of month, month, day of week), interpreted in UTC. |
| `activated` | boolean | Whether it is on. If `false`, it is removed from the schedule and does not run. |

## Writing the schedule {#cron-expression}

Write the five fields from left to right in the order **minute, hour, day of month, month, day of week**. There is no seconds field.

| Value | Meaning |
|---|---|
| `0 0 * * *` | Every day at 00:00 |
| `30 9 * * *` | Every day at 09:30 |
| `0 * * * *` | Every hour on the hour |
| `*/10 * * * *` | Every 10 minutes |
| `0 0 * * 1` | Every Monday at 00:00 |
| `0 0 1 * *` | The 1st of every month at 00:00 |

You can use `*` (all), `,` (list), `-` (range), and `/` (step), and you write the day of week as a number (`0`-`7`, where `0` and `7` are Sunday) or a name (`SUN`-`SAT`).

**All values are interpreted in UTC.** You must account for the offset from your local time, and for a time tied to a date or a weekday, that offset can push it across a day boundary.

**A value that never fires is not saved.** A value that is well-formed but points at a day that never comes, such as `0 0 30 2 *` (February 30), is rejected.

## Status and constraints {#status-and-constraints}

| Target | Constraint |
|---|---|
| `name` | 1-64 characters, required. |
| `cronExpression` | 1-128 characters, required. It must have five fields and must fire at least once. |
| `activated` | Required. |
| `sys.script` | Required at creation. **Immutable after creation** (not accepted in the update body). |

Rules for behavior and permissions:

- **You need two permissions together.** The role's (*SpaceRole*) `settings` must include `SETTING_SCHEDULER`, and, separately, you must have the `Execute` permission on the target *Script*. **This is checked not only on create but also on update and partial update.** Changing when it runs decides when that *Script* executes, and turning on something that was off starts its execution. If either one is missing, the request is rejected.
- **Execution happens with the permissions of `sys.createdBy`.** A `:self` filter inside the *Script* also resolves to that user. Even if a different user makes an edit, the executing identity does not change.
- **If the author loses the execute permission, it turns off automatically.** At the next run time the server checks, does not run, and drops `activated` to `false`. Even if the permission is restored, it does not turn back on automatically.
- **There is a limit on the count.** The number of *Scheduler*s a single *Organization* can have is set per plan (Free 1, Basic 5, Pro 30, Enterprise unlimited). Going beyond that limit rejects the create.
- **The run count is shared with *Script*.** Each run uses one of the plan's *Script* execution counts. There is no execution limit dedicated to *Scheduler*. If that limit is exceeded and the *Organization*'s *Script* execution is suspended, any *Scheduler* that comes due afterward does not run and its `activated` drops to `false`. In that case one *SchedulerLog* is left behind with the reason in `sys.error`. Once that *Scheduler* is off, it is not scheduled again.
- **Missed runs are not made up.** Even if a run was skipped, it does not run in a batch later; it resumes from the next scheduled time.
- **A *Script* in use cannot be deleted.** Trying to delete a *Script* that some *Scheduler* references has that deletion rejected (see [Script errors](/api/reference/script/endpoints.md#errors)).
- **There is no publishing.** With no status value or publishing step, it enters the schedule as soon as it is created, and deletion happens immediately with no prior step.

## SchedulerLog {#scheduler-log}

Each time a *Scheduler* runs, one execution record is left behind. It is read-only and has no create, update, or delete endpoints. Its path is `/spaces/{spaceId}/schedulers/{schedulerId}/logs`.

```json
{
  "sys": {
    "id": "5nRt8YcVm2Qb7WxZpK4dGhJ9sL",
    "type": "SchedulerLog",
    "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
    "requestId": "3trmXRM8dNvQ2LbYpK7fHsJ3gWc4Rt",
    "success": true,
    "createdBy": { "sys": { "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ", "type": "Refer", "targetType": "Scheduler" } },
    "createdAt": "2026-09-03T00:00:02.503Z",
    "updatedBy": { "sys": { "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ", "type": "Refer", "targetType": "Scheduler" } },
    "updatedAt": "2026-09-03T00:00:02.503Z"
  }
}
```

All values are inside `sys`, and there are no body properties. A key with no value is omitted from the response (the example above has no `error`).

| Property | Type | Description |
|---|---|---|
| `id` | string | The unique identifier of the record. It goes into `{schedulerLogId}` in the single-read path. |
| `type` | string | Always `"SchedulerLog"`. |
| `space` | Refer&lt;Space&gt; | The *Space* this record belongs to. |
| `requestId` | string | The identifier of this run. The same value goes into the `sys.requestId` of the *ScriptLog*. |
| `success` | boolean | Whether it succeeded. |
| `error` | any | **Present only on a run that could not even start because the execution count was used up.** In every other case it is omitted, even for a run that failed. The reason a run failed partway through is in the `sys.value` of the *ScriptLog* with the same `requestId`. |
| `createdBy` | Refer&lt;Scheduler&gt; | **The *Scheduler* that left this record.** Not a user. |
| `createdAt` | string (date-time) | The record creation time. |
| `updatedBy` | Refer&lt;Scheduler&gt; | The same *Scheduler* as `createdBy`. |
| `updatedAt` | string (date-time) | The same as `createdAt`. |

**There is no `scheduler` field.** Which *Scheduler* left the record is pointed to by `sys.createdBy`, whose `targetType` is `"Scheduler"`. `sys.updatedBy` is the same *Scheduler*.

**There are no `startedAt`, `endedAt`, or `result` fields, and no elapsed-time field either.** How long a run took and the value the *Script* returned are in the *ScriptLog* with the same `requestId` (`sys.durationMs`, `sys.value`, `sys.statusCode`). Its field structure is covered in [Script resource and endpoints](/api/reference/script/endpoints.md#script-log).

**One run leaves two logs.** One is this thin *SchedulerLog*, and the other is the *ScriptLog* that holds the run itself (the *ScriptLog*'s `sys.trigger` points to this *Scheduler*). The two are tied together by the same `requestId`.

The record is written once after the run ends and never changes. **A successful run disappears after 1 hour, and a failed run after 3 days.** No field in the response carries the expiry time; the record disappears when its time comes. For values you need to keep longer than that, save them as *Content* from inside the *Script*.

## Errors {#errors}

These are the codes you meet when working with a *Scheduler*. For codes that are common to every resource, see [common errors](/api/reference/common/errors.md).

| Code | Condition |
|---|---|
| `WGL400069` | The `cronExpression` is well-formed but points at a time that never fires. |
| `WGL403001` | The caller's role does not have the `SETTING_SCHEDULER` settings permission. That permission is needed not only to create and update a *Scheduler*, but also to read or delete a *Scheduler* and to read its run history. Creating or updating a *Scheduler* also needs the `Execute` permission on the target *Script*, and missing either one of the two permissions is rejected with the same code. |
| `WGL429001` | A new *Scheduler* was requested while the *Organization*'s *Scheduler* count had already reached the plan limit. |

## API {#api}

The base URL for all the endpoints below is `https://cma.weegloo.com/v1`, and the `Authorization` header requires a Bearer token that authenticates to CMA. A *Scheduler* has no `sys.version`, so you do not send the `X-Weegloo-Version` header on update.

```api-endpoint
{
  "title": "List Schedulers",
  "method": "GET",
  "path": "/spaces/{spaceId}/schedulers",
  "description": "Reads the list of Schedulers registered in a Space, page by page.",
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The Space's sys.id", "required": true }
  },
  "queryParameterSchema": {
    "limit": { "type": "integer", "description": "Number of items to return per page (1-100)", "default": 15 },
    "skip": { "type": "integer", "description": "Number of items to skip", "default": 0 },
    "next": { "type": "string", "description": "Next page cursor (the value obtained from links.next in the previous response)" },
    "prev": { "type": "string", "description": "Previous page cursor (the value obtained from links.prev in the previous response)" },
    "order": { "type": "string", "description": "Sort criteria. Comma-separated for multi-level sorting", "default": "sys.createdAt,sys.id" },
    "select": { "type": "string", "description": "Fields to include (sys.id,name) or exclude (-sys.id). Do not mix include and exclude." },
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 }
  },
  "additionalQueryParams": true,
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "responseStatus": 200,
  "responseExample": {
    "sys": { "type": "TotalPageResponse" },
    "limit": 15,
    "totalCount": 1,
    "items": [
      {
        "sys": {
          "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ",
          "type": "Scheduler",
          "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
          "script": { "sys": { "id": "3trmXRMKq7bd0Prbef1NcZ", "type": "Refer", "targetType": "Script" } },
          "createdBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
          "createdAt": "2026-08-26T01:20:07.442Z",
          "updatedBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
          "updatedAt": "2026-08-26T01:20:07.442Z"
        },
        "name": "Stock reorder",
        "cronExpression": "0 0 * * *",
        "activated": true
      }
    ],
    "links": { "self": "/v1/spaces/HnQ32YiH/schedulers" }
  }
}
```

```api-endpoint
{
  "title": "Create a Scheduler",
  "method": "POST",
  "path": "/spaces/{spaceId}/schedulers",
  "description": "Registers a new Scheduler in a Space. The caller must have both the SETTING_SCHEDULER permission and the Execute permission on the target Script. A cronExpression that never fires is rejected, and if activated is true it enters the schedule as soon as it is created.",
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The Space's sys.id", "required": true }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "requestBodySchema": {
    "type": "object",
    "required": ["name", "script", "cronExpression", "activated"],
    "properties": {
      "name": { "type": "string", "minLength": 1, "maxLength": 64, "description": "The label shown in the console" },
      "script": {
        "type": "object",
        "description": "A Refer to the Script to run. Cannot be changed after creation.",
        "properties": {
          "sys": {
            "type": "object",
            "properties": {
              "id": { "type": "string", "description": "The Script's sys.id" },
              "type": { "type": "string", "enum": ["Refer"] },
              "targetType": { "type": "string", "enum": ["Script"] }
            }
          }
        }
      },
      "cronExpression": { "type": "string", "minLength": 1, "maxLength": 128, "description": "When it runs. Five fields (minute, hour, day of month, month, day of week), interpreted in UTC" },
      "activated": { "type": "boolean", "description": "Whether it is on. If false, it is removed from the schedule." }
    },
    "example": {
      "name": "Stock reorder",
      "script": { "sys": { "id": "3trmXRMKq7bd0Prbef1NcZ", "type": "Refer", "targetType": "Script" } },
      "cronExpression": "0 0 * * *",
      "activated": true
    }
  },
  "responseStatus": 201,
  "responseExample": {
    "sys": {
      "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ",
      "type": "Scheduler",
      "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
      "script": { "sys": { "id": "3trmXRMKq7bd0Prbef1NcZ", "type": "Refer", "targetType": "Script" } },
      "createdBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
      "createdAt": "2026-08-26T01:20:07.442Z",
      "updatedBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
      "updatedAt": "2026-08-26T01:20:07.442Z"
    },
    "name": "Stock reorder",
    "cronExpression": "0 0 * * *",
    "activated": true
  }
}
```

```api-endpoint
{
  "title": "Read a Scheduler",
  "method": "GET",
  "path": "/spaces/{spaceId}/schedulers/{schedulerId}",
  "description": "Reads one Scheduler.",
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The Space's sys.id", "required": true },
    "schedulerId": { "type": "string", "description": "The Scheduler's sys.id", "required": true }
  },
  "queryParameterSchema": {
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "responseStatus": 200,
  "responseExample": {
      "sys": {
        "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ",
        "type": "Scheduler",
        "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
        "script": { "sys": { "id": "3trmXRMKq7bd0Prbef1NcZ", "type": "Refer", "targetType": "Script" } },
        "createdBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
        "createdAt": "2026-08-26T01:20:07.442Z",
        "updatedBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
        "updatedAt": "2026-08-26T01:20:07.442Z"
      },
    "name": "Stock reorder",
    "cronExpression": "0 0 * * *",
    "activated": true
  }
}
```

```api-endpoint
{
  "title": "Update a Scheduler",
  "method": "PUT",
  "path": "/spaces/{spaceId}/schedulers/{schedulerId}",
  "description": "Replaces a Scheduler in full. The Script it runs cannot be changed, so it is not accepted in the body. The caller must have both the SETTING_SCHEDULER permission and the Execute permission on the Script this Scheduler runs. There is no sys.version, so do not send a version header.",
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The Space's sys.id", "required": true },
    "schedulerId": { "type": "string", "description": "The Scheduler's sys.id", "required": true }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "requestBodySchema": {
    "type": "object",
    "required": ["name", "cronExpression", "activated"],
    "properties": {
      "name": { "type": "string", "minLength": 1, "maxLength": 64, "description": "The label shown in the console" },
      "cronExpression": { "type": "string", "minLength": 1, "maxLength": 128, "description": "When it runs. Five fields (minute, hour, day of month, month, day of week), interpreted in UTC" },
      "activated": { "type": "boolean", "description": "Whether it is on. If false, it is removed from the schedule." }
    },
    "example": { "name": "Stock reorder", "cronExpression": "30 21 * * *", "activated": true }
  },
  "responseStatus": 200,
  "responseExample": {
      "sys": {
        "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ",
        "type": "Scheduler",
        "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
        "script": { "sys": { "id": "3trmXRMKq7bd0Prbef1NcZ", "type": "Refer", "targetType": "Script" } },
        "createdBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
        "createdAt": "2026-08-26T01:20:07.442Z",
        "updatedBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
        "updatedAt": "2026-08-26T02:05:11.907Z"
      },
    "name": "Stock reorder",
    "cronExpression": "30 21 * * *",
    "activated": true
  }
}
```

```api-endpoint
{
  "title": "Partially update a Scheduler",
  "method": "PATCH",
  "path": "/spaces/{spaceId}/schedulers/{schedulerId}",
  "description": "Changes only part of a Scheduler with JSON Patch (RFC 6902). The sys.script that points to the Script to run does not change. The same permissions as for update are checked.",
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The Space's sys.id", "required": true },
    "schedulerId": { "type": "string", "description": "The Scheduler's sys.id", "required": true }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" },
    "Content-Type": { "type": "string", "description": "application/json-patch+json" }
  },
  "requestContentType": "application/json-patch+json",
  "requestBodySchema": {
    "type": "array",
    "description": "A list of JSON Patch operations",
    "items": {
      "type": "object",
      "required": ["op", "path"],
      "properties": {
        "op": { "type": "string", "enum": ["add", "remove", "replace", "move", "copy", "test"] },
        "path": { "type": "string", "description": "JSON Pointer (e.g. /activated)" },
        "value": { "description": "The value required depending on op" },
        "from": { "type": "string", "description": "The source location for move/copy" }
      }
    },
    "example": [{ "op": "replace", "path": "/activated", "value": false }]
  },
  "responseStatus": 200,
  "responseExample": {
    "sys": {
      "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ",
      "type": "Scheduler",
      "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
      "script": { "sys": { "id": "3trmXRMKq7bd0Prbef1NcZ", "type": "Refer", "targetType": "Script" } },
      "createdBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
      "createdAt": "2026-08-26T01:20:07.442Z",
      "updatedBy": { "sys": { "id": "9dLmQ2pVnRb8sTfWcXd3LhJ7gK", "type": "Refer", "targetType": "User" } },
      "updatedAt": "2026-08-26T02:11:40.220Z"
    },
    "name": "Stock reorder",
    "cronExpression": "0 0 * * *",
    "activated": false
  }
}
```

```api-endpoint
{
  "title": "Delete a Scheduler",
  "method": "DELETE",
  "path": "/spaces/{spaceId}/schedulers/{schedulerId}",
  "description": "Deletes a Scheduler. It is removed from the schedule and that Scheduler's execution records are cleaned up along with it. It responds with 204 and no body.",
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The Space's sys.id", "required": true },
    "schedulerId": { "type": "string", "description": "The Scheduler's sys.id", "required": true }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "responseStatus": 204
}
```

```api-endpoint
{
  "title": "List SchedulerLogs",
  "method": "GET",
  "path": "/spaces/{spaceId}/schedulers/{schedulerId}/logs",
  "description": "Reads the execution records of a Scheduler, page by page. The record of a successful run disappears after 1 hour, and the record of a failed run after 3 days.",
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The Space's sys.id", "required": true },
    "schedulerId": { "type": "string", "description": "The Scheduler's sys.id", "required": true }
  },
  "queryParameterSchema": {
    "limit": { "type": "integer", "description": "Number of items to return per page (1-100)", "default": 15 },
    "skip": { "type": "integer", "description": "Number of items to skip", "default": 0 },
    "next": { "type": "string", "description": "Next page cursor (the value obtained from links.next in the previous response)" },
    "prev": { "type": "string", "description": "Previous page cursor (the value obtained from links.prev in the previous response)" },
    "order": { "type": "string", "description": "Sort criteria. Comma-separated for multi-level sorting", "default": "sys.createdAt,sys.id" },
    "select": { "type": "string", "description": "Fields to include (sys.id) or exclude (-sys.id). Do not mix include and exclude." },
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 }
  },
  "additionalQueryParams": true,
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "responseStatus": 200,
  "responseExample": {
    "sys": { "type": "TotalPageResponse" },
    "limit": 15,
    "totalCount": 1,
    "items": [
      {
        "sys": {
          "id": "5nRt8YcVm2Qb7WxZpK4dGhJ9sL",
          "type": "SchedulerLog",
          "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
          "requestId": "3trmXRM8dNvQ2LbYpK7fHsJ3gWc4Rt",
          "success": true,
          "createdBy": { "sys": { "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ", "type": "Refer", "targetType": "Scheduler" } },
          "createdAt": "2026-09-03T00:00:02.503Z",
          "updatedBy": { "sys": { "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ", "type": "Refer", "targetType": "Scheduler" } },
          "updatedAt": "2026-09-03T00:00:02.503Z"
        }
      }
    ],
    "links": { "self": "/v1/spaces/HnQ32YiH/schedulers/7kQm2ZbTn4Rc9WvXpL3dHsY6fJ/logs" }
  }
}
```

```api-endpoint
{
  "title": "Read a SchedulerLog",
  "method": "GET",
  "path": "/spaces/{spaceId}/schedulers/{schedulerId}/logs/{schedulerLogId}",
  "description": "Reads one execution record.",
  "baseUrl": "https://cma.weegloo.com/v1",
  "pathParameterSchema": {
    "spaceId": { "type": "string", "description": "The Space's sys.id", "required": true },
    "schedulerId": { "type": "string", "description": "The Scheduler's sys.id", "required": true },
    "schedulerLogId": { "type": "string", "description": "The SchedulerLog's sys.id", "required": true }
  },
  "queryParameterSchema": {
    "include": { "type": "integer", "description": "Related-resource inclusion level. 0=default, 1=related resources, 2=nested relations, 3=full", "default": 0 }
  },
  "requestHeaderSchema": {
    "Authorization": { "type": "string", "description": "Bearer token (CMA authentication)" }
  },
  "responseStatus": 200,
  "responseExample": {
    "sys": {
      "id": "5nRt8YcVm2Qb7WxZpK4dGhJ9sL",
      "type": "SchedulerLog",
      "space": { "sys": { "id": "HnQ32YiH", "type": "Refer", "targetType": "Space" } },
      "requestId": "3trmXRM8dNvQ2LbYpK7fHsJ3gWc4Rt",
      "success": true,
      "createdBy": { "sys": { "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ", "type": "Refer", "targetType": "Scheduler" } },
      "createdAt": "2026-09-03T00:00:02.503Z",
      "updatedBy": { "sys": { "id": "7kQm2ZbTn4Rc9WvXpL3dHsY6fJ", "type": "Refer", "targetType": "Scheduler" } },
      "updatedAt": "2026-09-03T00:00:02.503Z"
    }
  }
}
```

## Related documents {#related-documents}

- [Script](/api/reference/script.md): The resource a *Scheduler* runs. Covers the definition structure and the kinds of statement.
- [Webhook](/api/reference/cma/webhook.md): The resource that runs a *Script* on an event rather than on a schedule.
- [SpaceRole](/api/reference/cma/space-role.md): The role that holds the `SETTING_SCHEDULER` settings permission and the *Script* `Execute` permission.
- [Scheduler concept](/getting-started/core-concepts/deployment-and-integration/scheduler.md): What the feature is for and how to work with it in the console.
