# updateScheduledTask

Change a scheduled task; only what you send changes. `timing` is { cronExpression or fireAt, timezone }, exactly one of the two. `clearExpiresAt: true` removes its end (do not send it with `expiresAt`). Only the task's owner or an org admin may change it (`canEdit`).

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "updateScheduledTask", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `taskId`: `ID!` (required)
- `title`: `String`
- `instruction`: `String`
- `timing`: `ScheduledTaskTimingInput`
  - `cronExpression`: `String`
  - `fireAt`: `DateTime`
  - `timezone`: `String!` (required)
- `tags`: `[String!]`
- `expiresAt`: `DateTime`
- `clearExpiresAt`: `Boolean`
- `notifyOnlyOnChange`: `Boolean`

## Response (data, an example)

```json
{
  "scheduledTaskMutation": {
    "updateScheduledTask": {
      "id": "<ID>",
      "title": "…",
      "instruction": "…",
      "status": "ACTIVE",
      "schedule": "…",
      "nextRunAt": "2026-01-01T00:00:00.000Z",
      "tags": [
        "…"
      ],
      "expiresAt": "2026-01-01T00:00:00.000Z",
      "notifyOnlyOnChange": true
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "updateScheduledTask",
    "variables": {
      "taskId": "<taskId>"
    }
  }'
```
