Publish files or capture a website and get a live URL
Publish files, a zip/tar archive, or a public HTTPS website and get a Spacefast URL. Pass sourceUrl to capture and publish a website; URL publishing must be enabled for the caller and is mutually exclusive with files, deletions, and archive uploads. URL publishes and archives that need a build return a durable Build receipt with next.action=poll; follow links.status until publication completes. The Build's capture field reports URL capture progress and quality evidence; an unmeasured visual comparison is not a passing comparison. Use a stable Idempotency-Key when retrying the same request. Already-built files and static website archives publish directly and wait for finalization by default; pass async=1 to return an operation link to poll instead. For buildable source on a Spacefast-managed Space, the receipt's git block provides the repository remote and the Build's input.commit identifies the source commit; later git pushes continue that repository history. The Open link provides reusable access; anonymous Spaces also receive a Claim link for ownership transfer. New Spaces are Private by default. Pass spaceId to update an existing Space; otherwise a new Space is created.
Request
- Base URL: https://api.spacefast.com
- URL: https://api.spacefast.com/v1/publish
- Auth: one of:
- none
- 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:publish)
- 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: publish:write)
Query parameters
Controls the finalize transport. Omit the parameter, or pass 0 or false, to wait for the finalize and return the terminal receipt, degrading to a poll receipt only at the in-request ceiling. Pass 1 or true to return immediately with the operation to poll. Project archives always return a durable Build receipt and poll URL instead of holding the request open.
Headers
Optional client-generated key, at most 255 characters, that makes this write safe to retry. The first request with a given key stores its outcome, scoped to your tenant, credential, and route. A retry with the same key and an identical body does not execute again: the server replays the stored response and marks it Idempotency-Replayed: true. A credential-free publish request that sends this header must also send X-Spacefast-Idempotency-Principal. A request that reuses a key with a different body fails with 409 idempotency_key_reused. A duplicate request that arrives while the first is still in flight fails with 409 idempotency_conflict_in_progress. The server keeps each key for 24 hours.
Required with Idempotency-Key on a credential-free publish. Send a stable 64-character hexadecimal value that only the caller knows, and send it unchanged on every retry. It isolates the stored one-time claim and upload credentials from other anonymous callers. Never log or share this value.
Request body
Response
Response for status 201
Changes
No recorded changes to this operation across all 1 revision of this API.