# Show cronjob of a web hosting package

> One cronjob of a web hosting package, with its last runs and what they wrote.

- Effect: Read - Changes nothing.
- Idempotent: yes
- Stability: beta
- MCP tool: `manitu_webhosting_web_cronjob_get` on https://mcp.manitu.de/mcp
- REST: `POST https://api.manitu.de/v1/webhosting/web/cronjob/get`
- Needs: `service_webhosting`
- Page: /reference/webhosting/web/cronjob/get/

## MCP tool

`manitu_webhosting_web_cronjob_get`

### Description for the model

Returns one cronjob of a web hosting package of the manitu customer account this connection works in, by site_id and cronjob_id from manitu_webhosting_web_cronjob_list: what it runs, when (schedule, next_run_at, in Europe/Berlin), how it reports - and run_list, its last runs (at most 25, newest first) with exit code, duration and what it wrote (stdout, stderr - the first 1024 characters each). For "why does my cronjob fail?": read run_list - exit code 127 is "command not found", a run stopped at runtime_seconds_max often shows exit code 9 or 137.

### Arguments

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `cronjob_id` (integer | string, required) - The cronjob_id from manitu_webhosting_web_cronjob_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)

### Example

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "manitu_webhosting_web_cronjob_get",
    "arguments": {
      "site_id": 12345,
      "cronjob_id": 12345
    }
  }
}
```

## REST

`POST https://api.manitu.de/v1/webhosting/web/cronjob/get`

### Authentication

One of `X-API-Key`, `Authorization: Bearer …` - never more than one in a request.

### Request body

JSON; unknown fields are refused.

- `site_id` (integer | string, required) - The site_id from manitu_webhosting_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)
- `cronjob_id` (integer | string, required) - The cronjob_id from manitu_webhosting_web_cronjob_list - never guess one. (pattern `"^[1-9][0-9]*$"`; minimum `1`)

### Response

In `data`; the rest of the body as on every call.

- `cronjob_id` (integer, required) - The cronjob - what the other cronjob tools take.
- `description` (string | null, required) - What the customer wrote about it (his description), null if nothing - not its name or user name.
- `status` (string, required) - active, or inactive (switched off by the customer, kept for later). (one of `"active"`, `"inactive"`)
- `task` (object, required) - What it runs - type, and only the field(s) that type uses.
  - `task.type` (string | null, required) - command (a shell command), url (calls a URL), php_script (a PHP file of the package). (one of `"command"`, `"url"`, `"php_script"`, `null`)
  - `task.command` (string | null) - For type command: the shell command - runs as the package's user, in its root directory.
  - `task.url` (string | null) - For type url: the URL called.
  - `task.script_path` (string | null) - For type php_script: the PHP file, relative to the package.
  - `task.php_version` (string | null) - For type php_script: the PHP version (e.g. "php8.3"); null: the package's default.
- `schedule` (string | null, required) - When it runs - a cron expression (minute hour day-of-month month day-of-week), in Europe/Berlin. null only if what is stored cannot be read.
- `schedule_type` (string | null, required) - How the customer panel shows the schedule: minutely, hourly, daily, weekly, monthly, yearly, or crontab (anything else).
- `runs_per_hour_max` (integer | null, required) - How often it runs in one hour at most.
- `next_run_at` (string | null, required) - When it runs next; null if inactive or never. (format `date-time`)
- `report` (object, required) - Whom it tells about a run, and how.
  - `report.reason` (string | null, required) - When the customer is told about a run: never, onerror (exit code not 0), always. (one of `"never"`, `"onerror"`, `"always"`, `null`)
  - `report.type` (string | null, required) - How: mail, or logfile (a line in logs/cron.log of the package). (one of `"mail"`, `"logfile"`, `null`)
  - `report.mail` (object | null, required) - The report mail - null unless type is mail.
    - `report.mail.recipient` (string | null, required) - Who gets the report mail.
    - `report.mail.subject` (string | null, required) - Its subject, with placeholders.
    - `report.mail.body` (string | null, required) - Its text, with placeholders.
- `last_run` (object | null, required) - Its last run; null if it has not run yet.
  - `last_run.exit_code` (integer | null, required) - Its exit code - 0 is success, 127 "command not found"; a run stopped at the time limit often shows 9 or 137.
  - `last_run.started_at` (string | null, required) - When it started. (format `date-time`)
  - `last_run.ended_at` (string | null, required) - When it ended. (format `date-time`)
  - `last_run.duration_seconds` (number | null, required) - How long it ran.
- `created_at` (string | null, required) - When it was created. (format `date-time`)
- `run_list` (array of object, required) - Its last runs, newest first (at most 25) - with what it wrote.
  - `run_list[].exit_code` (integer | null, required) - Its exit code - 0 is success, 127 "command not found"; a run stopped at the time limit often shows 9 or 137.
  - `run_list[].started_at` (string | null, required) - When it started. (format `date-time`)
  - `run_list[].ended_at` (string | null, required) - When it ended. (format `date-time`)
  - `run_list[].duration_seconds` (number | null, required) - How long it ran.
  - `run_list[].stdout` (string | null, required) - What it wrote to standard output - the first 1024 characters.
  - `run_list[].stderr` (string | null, required) - What it wrote to standard error - the first 1024 characters.

### Statuses

- `200` Success.
- `400` The request does not match the declared input schema.
- `401` No credential was presented, or it was not recognised.
- `403` The credential is not permitted to use this operation.
- `500` The server failed. Nothing about the request was wrong. Whether a change took effect is not known - check before trying it again.
- `503` The channel this operation forwards through is unavailable.

### Example

```sh
curl -X POST 'https://api.manitu.de/v1/webhosting/web/cronjob/get' \
  -H 'X-API-Key: $API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"site_id":12345,"cronjob_id":12345}'
```

## Example result

```json
{
  "cronjob_id": 12345,
  "description": "Example",
  "status": "active",
  "task": {
    "type": "command",
    "command": "string",
    "url": "https://www.example.com/",
    "script_path": "/web",
    "php_version": "string"
  },
  "schedule": "string",
  "schedule_type": "string",
  "runs_per_hour_max": 1,
  "next_run_at": "2026-10-23T12:00:00+02:00",
  "report": {
    "reason": "never",
    "type": "mail",
    "mail": {
      "recipient": "string",
      "subject": "string",
      "body": "string"
    }
  },
  "last_run": {
    "exit_code": 1,
    "started_at": "2026-10-23T12:00:00+02:00",
    "ended_at": "2026-10-23T12:00:00+02:00",
    "duration_seconds": 1.5
  },
  "created_at": "2026-10-23T12:00:00+02:00",
  "run_list": [
    {
      "exit_code": 1,
      "started_at": "2026-10-23T12:00:00+02:00",
      "ended_at": "2026-10-23T12:00:00+02:00",
      "duration_seconds": 1.5,
      "stdout": "string",
      "stderr": "string"
    }
  ]
}
```
