Example API

Canonical api.rest.sh endpoints and commands used throughout the Restish docs.

The docs use api.rest.sh whenever a live endpoint makes a Restish workflow clearer. Restish infers https:// for host-like request targets, while config values and OpenAPI metadata still use full URLs. The API is intentionally broad: it has OpenAPI discovery, request echoing, auth fixtures, forms, uploads, streaming, pagination, retries, content negotiation, binary responses, redirects, and safe CRUD examples.

Configure it once when you want short API-aware commands:

restish api connect example api.rest.sh 'prompt.api_key: docs-key'
restish example --help

Use a host-like URL when you want to stay in generic HTTP mode:

Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready

First Requests And Inspection

EndpointUse it for
/Echo a basic request and show headers Restish sends.
/headersReturn request headers only.
/user-agentInspect the User-Agent header.
/response-headers?Name=valueMake the server set response headers.
/anything and /anything/{path}Echo method, URL, path, query, headers, and body.
/get, /post, /put, /patch, /delete, /head, /optionsFocused generic HTTP verb examples.
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready

API-Aware Commands

The API publishes an OpenAPI document at /openapi.json. After configuration, Restish generates commands such as:

Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
restish example get-types-example
restish example get-status 404 --rsh-ignore-status-code

Use API-aware commands for repeated work, generated help, shell completion, and profile-aware auth. Use generic URLs for quick exploration.

Request Bodies

EndpointUse it for
/post, /put, /patchEcho JSON, YAML, CBOR, or stdin request bodies.
/typesSchema-oriented examples and edit workflow.
/loginURL-encoded form login examples.
/uploadsMultipart form echo examples, including file metadata when the client sends file parts.
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready

Auth Sandbox

The auth endpoints require credentials but return only safe summaries.

EndpointRequired auth
/auth/basicHTTP Basic auth
/auth/bearerAuthorization: Bearer ...
/auth/api-key-headerX-API-Key header
/auth/api-key-queryapi_key query parameter
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
EndpointUse it for
/imagesPagination, links, table output, filtering, and image lists.
/images/{type}Raw image downloads and terminal image rendering.
/items and /items/{item-id}Safe generic CRUD examples.
/books and /books/{book-id}Bulk-management workflows.
/exampleNested data for filtering and projection examples.
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
ITEM_ID="docs-$(date +%s)"
restish post api.rest.sh/items "id: $ITEM_ID, name: Demo, enabled: true, updated: 2026-04-27T00:00:00Z"
restish delete "api.rest.sh/items/$ITEM_ID" --rsh-ignore-status-code

Streaming

EndpointUse it for
/eventsServer-Sent Events with docs-shaped JSON event data.
/logsNDJSON log records.
/sse/metricsMetrics-shaped SSE events.

Always bound copy-paste stream examples:

Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
restish api.rest.sh/events --rsh-max-items 3 -f body.data.user.id -o lines

Resilience And HTTP Behavior

EndpointUse it for
/flaky?failures=2&key=docsRetry recovery examples.
/slow?delay=2sTimeout examples.
/status/{code}Exit status and error-body examples.
/cache, /cached/{seconds}, /etag/{etag}HTTP cache and conditional requests.
/redirect/{n}, /relative-redirect/{n}, /absolute-redirect/{n}, /redirect-toRedirect behavior and verbose transcripts.
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready

Content, Binary, And Utilities

EndpointUse it for
/formats/{format}JSON, YAML, CBOR, and vendor JSON decoding examples.
/problemapplication/problem+json error payloads.
/gzip, /deflate, /brotliResponse decompression examples.
/imageAccept-driven image negotiation.
/bytes/{n}, /stream-bytes/{n}, /range/{n}, /dripRaw bytes, ranges, and slow byte streams.
/xml, /html, /uuid, /ip, /base64/encode/{value}, /base64/decode/{value}Small utility examples.
/cookies, /cookies/set, /cookies/deleteCookie behavior examples.
Browser preview

Edit the command and run it from your browser against the live docs API.

Ready
restish api.rest.sh/images/jpeg > dragonfly.jpg