# POST /jobs/{id}/retry

Section: [Scheduled jobs](https://appengine.appmint.io/documentation/tag/scheduled-jobs.md) · Full index: https://appengine.appmint.io/documentation.md
## POST /jobs/{id}/retry

**Run a failed scheduled run again**

`operationId: JobsController_retry`

For a run of a recurring job (a `job` record of kind `scheduled:<job>`, status `failed` or `cancelled`): runs that job again now, for this org, with the same `args` — exactly like POST /jobs/scheduled/{job}/run. It is a NEW run with its own `job` record (`retryOf` = this id; this record gets `retriedAs`), which is returned as soon as it has started; it carries on in the background and is polled like any job. The job finds its own work, so the new run picks up whatever is still due — what the failed run already did is not done twice. Other jobs (imports, exports) carry on from their saved cursor instead.

#### Signature

```http
POST /jobs/{id}/retry (id: string) -> The new run's `job` record (status `running`).
```

#### Access

Requires a bearer JWT (`Authorization: Bearer <token>`).

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| `400` | JOB_NOT_RETRYABLE | Only a failed or cancelled run can be run again. | The run is still going, or finished well | Use POST /jobs/scheduled/{job}/run to run it again anyway. |
| `404` | JOB_NOT_FOUND | This server no longer runs "<job>", so it cannot be run again. | The job is not registered on this server any more | Nothing to retry; GET /jobs/scheduled lists the jobs there are. |
| `409` | JOB_RUNNING | <label> is already running | Another run of the job for this org holds its lock | Wait for it to finish; it does the same work. |

Plus the standard platform errors: `401`, `403`, `429`, `500`.

#### See also

- `POST /jobs/scheduled/{job}/run`
- `POST /jobs/{id}/cancel`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgid` | header | string | yes | Organization (tenant) identifier. Every request is scoped to this org; data from other orgs is never visible. Issued with your API credentials. |
| `id` | path | string | yes | The `job` record id (a run), from GET /jobs. |

### Responses

| Status | Meaning |
| --- | --- |
| `201` | The new run's `job` record (status `running`). |
| `400` | Only a failed or cancelled run can be run again. — The run is still going, or finished well |
| `401` | Authentication failed: Invalid or expired token — The `Authorization` header is missing, malformed, or the JWT has expired. |
| `403` | You do not have permission to perform this action — The caller is authenticated but lacks the role required by the endpoint, or is acting on another org. |
| `404` | This server no longer runs "<job>", so it cannot be run again. — The job is not registered on this server any more |
| `409` | <label> is already running — Another run of the job for this org holds its lock |
| `429` | Too Many Requests — More than 100,000 requests from one IP within 5 minutes (configurable per deployment). CORS preflights and requests from inside the platform cluster are not counted. The limiter answers before the error filter, so the body is `{ statusCode, error, message }` with no `path`, `method` or `timeStamp`; the `RateLimit-*` response headers say when the window resets. |
| `500` | An unexpected error occurred. Our team has been notified. — An unhandled server-side failure. |

Example response:

```json
{
  "sk": "68f0c2a1e4b0a1b2c3d4e5f8",
  "data": {
    "kind": "scheduled:a2p-watch",
    "title": "Text messaging registration check",
    "status": "running",
    "trigger": "manual",
    "retryOf": "68f0c2a1e4b0a1b2c3d4e5f7",
    "requestedBy": "owner@example.com"
  }
}
```

