---
title: "Run a scheduled job now"
method: POST
path: "/v1/spaces/{spaceId}/crons/run"
tags: ["Spaces"]
---

# Run a scheduled job now

`POST /v1/spaces/{spaceId}/crons/run`

## Request

- Base URL: `https://api.spacefast.com`
- URL: `https://api.spacefast.com/v1/spaces/{spaceId}/crons/run`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.spacefast.com/v1/auth/oauth2/authorize`, token URL `https://api.spacefast.com/v1/auth/oauth2/token`; client credentials, token URL `https://api.spacefast.com/v1/auth/oauth2/token`, scopes: `spaces:write`)

Requests one of the live version's declared cron paths on this space's default hostname, right now, and returns what it answered. Requires write access to the space, because a cron handler can mutate state — the same authority `wp-cli` and `db console` require. `target` is a declared key or path — anything else is rejected, and no request is made. Headers are not passed through and redirects are not followed; use `sf crons run --header` for a handler that checks a secret. The platform's `x-spacefast-cron` header is never carried, so a handler gated on it will refuse.

## Path parameters

- `spaceId` string, required

## Request body

- object
  - `target` string, required: Key or path of a scheduled job the live version declares.

## Response `200`

Response for status 200

- object
  - `$schema` string, uri: Canonical JSON Schema URL for this response body. The server also sends it in the `Link: rel="describedby"` response header.
  - `data` object, required
    - `status` integer, required: HTTP status the space answered with.
    - `durationMs` integer, required: Wall-clock milliseconds from request to the end of the snippet read.
    - `bodySnippet` string, required: First 200 characters of the response body, whitespace collapsed. Empty when the body was empty.

## Other responses

- `default`: Problem details (RFC 9457). Any 4xx/5xx response is one `application/problem+json` document.

---

[API](https://skmtc.dev/spacefast/apis/spacefast-api.md) · [All operations](https://skmtc.dev/spacefast/apis/spacefast-api/llms.txt) · [OpenAPI document](https://skmtc.dev/spacefast/apis/spacefast-api/revisions/bd165bc7c983?raw)
