## List jobs

`GET /v1/infra/servers/:id/jobs`

Returns all non-deleted server jobs, including disabled ones, with up to the five most recent runs of each job. Works even when the feature is unavailable. The response contains no secret.

Requires a key with `vibe:infra` and existing server permissions. Writes need the managing key or a team role permitted to manage the lifecycle. General rules: [Scheduled HTTP calls](../jobs.md). Request verification in the handler: [Verify signatures](./signature.md).

## Parameters

| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | Server ID from the [server list](../servers/list.md) |

No request body or query parameters are needed.

## Examples

### curl — personal key

```bash
curl --max-time 20 -X GET "https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/jobs" \
  -H "X-Api-Key: YOUR_API_KEY"
```

### curl — OAuth application

```bash
curl --max-time 20 -X GET "https://vibecode.bitrix24.com/v1/infra/servers/SERVER_ID/jobs" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"
```

### JavaScript — personal key

```javascript
const serverId = 'SERVER_ID';
const res = await fetch(`https://vibecode.bitrix24.com/v1/infra/servers/${encodeURIComponent(serverId)}/jobs`, {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
  },
});
const result = await res.json();
if (!res.ok || !result.success) throw new Error(result.error?.code ?? `HTTP_${res.status}`);
console.log(result);
```

### JavaScript — OAuth application

```javascript
const serverId = 'SERVER_ID';
const res = await fetch(`https://vibecode.bitrix24.com/v1/infra/servers/${encodeURIComponent(serverId)}/jobs`, {
  method: 'GET',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
  },
});
const result = await res.json();
if (!res.ok || !result.success) throw new Error(result.error?.code ?? `HTTP_${res.status}`);
console.log(result);
```

## Response fields

| Field | Type | Description |
|---|---|---|
| `success` | boolean | Always `true` on success |
| `data.items` | array | All non-deleted server jobs, at most 20 |
| `data.items[].id` | string | Job ID |
| `data.items[].serverId` | string | Server ID |
| `data.items[].label` | string | Job label |
| `data.items[].cronExpr` | string | Five-field cron expression |
| `data.items[].timezone` | string | Schedule time zone |
| `data.items[].path` | string | Handler path and optional query string |
| `data.items[].enabled` | boolean | Whether scheduled runs are enabled |
| `data.items[].nextScheduledFor` | string | Next scheduled occurrence, UTC ISO-8601 |
| `data.items[].scheduleRevision` | integer | Schedule revision |
| `data.items[].availableSince` | string | Start of the current schedule period, UTC ISO-8601 |
| `data.items[].createdAt` | string | Creation time, UTC ISO-8601 |
| `data.items[].updatedAt` | string | Last update time, UTC ISO-8601 |
| `data.items[].latestRuns` | array | Up to the five most recent runs of the job. Run fields are described in [run history](./runs.md) |

The signing secret is not returned.

## Response example

`200 OK` response for a server with one job that was just run manually:

```json
{
  "success": true,
  "data": {
    "items": [
      {
        "id": "cmvht3jly1xgh4bo25ge2t996",
        "serverId": "9547e3f2-1369-4ed4-b047-a589b0a303c4",
        "label": "weekday digest",
        "cronExpr": "30 9 * * 1-5",
        "timezone": "Africa/Abidjan",
        "path": "/tasks/digest?mode=weekday",
        "enabled": true,
        "nextScheduledFor": "2026-10-21T09:30:00.000Z",
        "scheduleRevision": 2,
        "availableSince": "2026-10-21T07:44:22.328Z",
        "createdAt": "2026-10-21T07:44:21.733Z",
        "updatedAt": "2026-10-21T07:44:22.339Z",
        "latestRuns": [
          {
            "id": "cmvht3kfl1vpa4bpf4406sbpt",
            "jobId": "cmvht3jly1xgh4bo25ge2t996",
            "serverId": "9547e3f2-1369-4ed4-b047-a589b0a303c4",
            "portalId": "0d9f7744-f853-47c7-b06e-6f61f9dd1b7f",
            "path": "/tasks/digest?mode=weekday",
            "scheduleRevision": 2,
            "trigger": "MANUAL",
            "scheduledFor": "2026-10-21T07:44:22.831Z",
            "status": "PENDING",
            "attempts": 0,
            "nextAttemptAt": "2026-10-21T07:44:22.831Z",
            "readyDeadlineAt": "2026-10-21T08:14:22.831Z",
            "deliveryDeadlineAt": "2026-10-25T07:44:22.831Z",
            "waitingForServer": true,
            "startedAt": null,
            "lastAttemptStartedAt": null,
            "late": false,
            "finishedAt": null,
            "durationMs": null,
            "responseSource": null,
            "httpStatus": null,
            "errorCode": null,
            "lastAttemptErrorCode": null,
            "requestId": null,
            "responseSnippet": null,
            "createdAt": "2026-10-21T07:44:22.831Z",
            "updatedAt": "2026-10-21T07:44:22.831Z"
          }
        ]
      }
    ]
  }
}
```

## Error response example

404 — the server is not found or is inaccessible to the caller:

```json
{
  "success": false,
  "error": {
    "code": "NOT_FOUND",
    "message": "Server not found"
  }
}
```

## Errors

| HTTP | Code | Reason |
|---|---|---|
| 404 | `NOT_FOUND` | Server not found or inaccessible to the caller |
| 401 | `MISSING_API_KEY` | Missing API key |
| 403 | `SERVER_ROLE_FORBIDDEN` | Development team role does not permit this action |

Full list of shared error codes — [Errors](/docs/errors).

## See also

- [Create a job](./create.md)
- [Replace job settings](./update.md)
- [Run history](./runs.md)
