Scripts API

List, create, read, update, and archive scripts. No pagination. List returns personal scripts only.

All routes require a Pro or Teams API token. There is no pagination. List returns the caller’s personal scripts only (up to 200).

List

GET /api/v1/scripts

HTTP
curl -fsSL -H "Authorization: Bearer rny_…" https://runny.sh/api/v1/scripts
JSON
{
  "scripts": [
    {
      "slug": "ABCDEFGHJKMN",
      "title": "setup",
      "runtime": "bash",
      "visibility": "public",
      "expires_at": "2026-09-08 12:00:00",
      "fetch_count": 3,
      "executions": 3,
      "created_at": "2026-09-07 12:00:00"
    }
  ]
}

fetch_count is the script’s successful-fetch counter. executions is the number of rows in script_fetches (every raw attempt, any status). It is not completion tracking. Completions live on a separate client-callback table and are not in this list payload.

Create

POST /api/v1/scripts — 201 on success. Optional organization_id places the script on a team. Optional token is returned when the script is private.

Bash
curl -fsSL -X POST -H "Authorization: Bearer rny_…" \
  -H "Content-Type: application/json" \
  -d '{"title":"setup","runtime":"bash","visibility":"public","expiry":"1d","body":"echo hi\n"}' \
  https://runny.sh/api/v1/scripts
JSON
{
  "slug": "ABCDEFGHJKMN",
  "title": "setup",
  "description": null,
  "runtime": "bash",
  "visibility": "public",
  "expires_at": "2026-09-08 12:00:00",
  "max_fetches": null,
  "track_completions": true,
  "byte_size": 8,
  "line_count": 1,
  "fetch_count": 0,
  "one_liner": "curl -fsSL https://runny.sh/r/ABCDEFGHJKMN | bash",
  "created_at": "2026-09-07 12:00:00",
  "updated_at": "2026-09-07 12:00:00"
}

Body fields: title, runtime, visibility, expiry (1d, 3d, 7d, never, custom), optional expiry_date, body, description, first_use, track_completions, organization_id.

Validation failures are 422 with {"error":"…"}.

Read

GET /api/v1/scripts/{slug} — same detail object as create, without a fresh token. Unknown slugs: 404 {"error":"Script not found"} or the service’s not-found message.

Update

PATCH /api/v1/scripts/{slug} — omitted fields keep their current values, including expiry unless you send expiry or expiry_date.

Bash
curl -fsSL -X PATCH -H "Authorization: Bearer rny_…" \
  -H "Content-Type: application/json" \
  -d '{"title":"setup","body":"echo ready\n"}' \
  https://runny.sh/api/v1/scripts/{slug}

Archive

DELETE /api/v1/scripts/{slug} — soft archive. Response {"ok":true}. Raw fetches then return 410 gone.

Bash
curl -fsSL -X DELETE -H "Authorization: Bearer rny_…" https://runny.sh/api/v1/scripts/{slug}

Restore revision