API
The HTTP upload protocol, routes and error reference.
API: general rules
- Base URL:
. The OpenAPI 3.1 description lists every route and schema.https://instahost.dev /v1 - Requests with a body need
(an optionalContent-Type: application/json is accepted); anything else ischarset=utf-8 . Bodies above 1 MiB are415 unsupported_media_type . Unknown fields are refused with413 payload_too_large , and400 invalid_request names the field.details.field - Every response is JSON with
andCache-Control: no-store . No response sets a cookie or sendsX-Content-Type-Options: nosniff , so browsers block cross-origin reads, and preflighted requests fail (Access-Control-Allow-* isOPTIONS ).405 - A
orPOST whoseDELETE isSec-Fetch-Site orcross-site (a request made by a web page on another site) is refused withsame-site . Agents, scripts and the CLI send no such header.403 cross_site_request works whereverHEAD does. A wrong method isGET with an405 method_not_allowed header; an unknownAllow path is/v1 .404 not_found - Timestamps are RFC 3339 UTC strings, such as
.2026-11-21T10:00:00Z - Rate limits, checked first on every
request: 30 requests per minute per client IP without an API key (IPv6 clients are grouped by /64 prefix); with an API key, 300 requests per minute per IP and 300 requests per minute per key. Over the limit:/v1 with429 rate_limited . Daily quotas are separate (Retry-After: 60 ; see Limits).429 quota_exceeded - Errors always use one envelope:
{"error": {"code": "ttl_too_long", "message": "Anonymous artifacts may live at most 604800 seconds.", "details": {"max_ttl_seconds": 604800}}}is stable and listed under Error codes;code is for humans;message is present only when there is something to add.details
The artifact object
{"id": "k3tq...", "type": "site", "access": "unlisted", "status": "published",
"url": "https://<id>.instahost.cloud/",
"created_at": "2026-11-21T10:00:00Z", "expires_at": "2026-11-22T10:00:00Z", "published_at": "2026-11-21T10:00:04Z",
"file_count": 12, "total_bytes": 482113} is the effective status ( once has passed). is for persistent artifacts; is until published. The authorized view, returned to the artifact's delete token or owner key, adds : the owning API key's id, or for anonymous artifacts.
Create an artifact: POST /v1/artifacts
Anonymous, or with an API key as owner. Any other credential is .
{"type": "file", // "file" or "site"
"access": "unlisted", // optional: "public", "unlisted" (default) or "private" (files only)
"ttl_seconds": 86400, // optional; default 1 day
"persistent": false, // optional; true needs an API key and excludes ttl_seconds
"files": [{"path": "report.pdf", "size": 48213, "md5": "9e107d9d372bb6826bd81d3542a419d6",
"content_type": "application/pdf"}]} // content_type: optional, type=file only- files[].path
- For a file: its name, without
. For a site: the path relative to the site root, with/ separators. At most 512 bytes of UTF-8 and 255 bytes per segment, in Unicode NFC, with no empty,/ or. segment, no leading or trailing.. , no backslash, no control, line-separator or invisible formatting character, and no duplicate. Names that look like credentials or VCS data are refused (/ ):sensitive_file and.env ,.env.* ,.dev.vars ,.envrc ,.npmrc ,.netrc ,.pypirc ,.htpasswd ,.git-credentials , SSH private keys (.pgpass ,id_rsa , …),id_ed25519 ,*.pem ,*.key ,*.p12 ,*.pfx ,*.jks ,*.keystore , Terraform state and variables, backup copies of those, and anything inside*.ppk ,.git ,.svn ,.hg ,.ssh ,.aws ,.gnupg or.kube . Detection is by name only..docker - files[].size
- Exact size in bytes. Checked again against the stored object at
.complete - files[].md5
- Required: the MD5 of the bytes, 32 hexadecimal characters. It is signed into the upload URL, so storage refuses any other bytes.
- files[].content_type
- Files only: overrides the type derived from the extension (lowercase
, at most 127 characters). It does not change whether the file opens inline or downloads.type/subtype
A site needs a root (). Checks run in this order: rate limit, credential, body and schema, file count, paths, sensitive names, sizes, private sites, lifetime, then the daily quota. A refused create writes nothing.
Response :
{"artifact": { ... status "pending"; url and expires_at are already final; owner ... },
"delete_token": "ihd_...",
"access_token": "iha_...", // private files only
"access_url": "https://files.instahost.cloud/<id>/report.pdf?token=iha_...", // private files only
"upload": {"expires_at": "...", "batch_size": 50, "remaining": 0,
"uploads_url": "https://instahost.dev/v1/artifacts/<id>/uploads",
"complete_url": "https://instahost.dev/v1/artifacts/<id>/complete",
"files": [{"path": "report.pdf", "method": "PUT", "url": "https://...",
"headers": {"if-none-match": "*", "content-md5": "nhB9nTcrtoJr2B01QqQZ1g==",
"x-amz-storage-class": "STANDARD"}}]}} holds upload URLs for the first files in manifest order; counts the files still without a URL (ask for them with ). Keep the delete token: it is the only way to delete an anonymous artifact.
Upload the bytes: PUT to each presigned URL
Send each file's exact bytes with to its , and replay every header in exactly as returned: they are all signed, and storage refuses the request if one differs or is missing. The signed headers are (an object can be written once, so a URL can never overwrite bytes), (storage rejects other bytes with ), and (storage refuses a body of another length; reports : yes). Do not add a : the stored metadata is never served, and the served type comes from the extension.
: stored.200 : the object already exists (an earlier attempt succeeded), which counts as done.412 : the URL expired or a header was changed; get a new URL from403 ./uploads - With curl, add
so it does not send-H 'Expect:' .Expect: 100-continue
Upload URLs live 5 minutes for anonymous artifacts and 15 minutes with an API key, and never beyond the artifact's upload window: 15 minutes after create for anonymous artifacts, 1 hour with an API key. There is no multipart upload: each file is one , up to the file size limit.
More upload URLs: POST /v1/artifacts/{id}/uploads
Delete token or owner key. Request: , 1 to 50 distinct manifest paths. Response : , in the same form as create. Use it for the files beyond the first batch and to replace URLs that expired.
- Each file can get at most 3 URLs in total, counting the one from create; beyond that,
. A request is all or nothing: if any path is refused, none is counted.409 upload_url_limit for a path that is not in the manifest (400 unknown_path ).details.paths from the end of the upload window on (at410 gone itself, when a new URL would have no life left), and for deleted, blocked or expired artifacts.upload_until once the artifact is published or failed.409 artifact_not_pending with403 forbidden when the API key that created the artifact has been revoked, whatever credential is presented.details.reason: "owner_key_revoked"
Complete (publish): POST /v1/artifacts/{id}/complete
Delete token or owner key; no request body. The service lists the stored objects and compares each with the manifest. Response : (the authorized view). The delete token is not repeated.
| Outcome | Answer |
|---|---|
| Every object present with the declared size (and MD5, where storage reports it) | , published. |
| Some objects missing | with (the first 100 paths) and . The artifact stays pending: upload the missing files and call again. |
| An object differs (size, MD5, storage class, or a customer-supplied encryption key) | with (, , , : , , or ). The artifact is now and its objects are deleted. |
| Already published | with the same body (idempotent). |
| Already failed | : create a new artifact. |
Called after the upload window ended (later than ), or deleted, blocked or expired | . |
| More than 4 calls on a pending artifact | . |
| The owner API key was revoked | , . |
Note the boundary: answers from on, while still works at itself and answers only after it. An artifact never completed by the end of its window is marked failed and its objects are purged.
Read an artifact: GET /v1/artifacts/{id}
- With the delete token or the owner key:
and the authorized view in any status, until the tombstone is removed.200 adds?include=files (files ,path ,size ), 100 per page in path order, andcontent_type : pass it asfiles_next for the next page; it is&files_after= on the last page.null - Anyone else (no credential, or one that cannot manage this artifact):
and the public view only for a published, unexpired artifact that is not private;200 when it expired or was deleted or blocked;410 gone otherwise (pending, failed, private, unknown). A wrong token therefore never reveals that a private artifact exists.404 not_found - A malformed, unknown or revoked API key is still
.401 invalid_api_key
Delete an artifact: DELETE /v1/artifacts/{id}
Delete token or owner key. Response : , or if the operator had taken it down. Every URL of the artifact answers from the next request on, and its bytes are deleted at once (best effort) and again by a later cleanup pass.
- Works on pending, published, failed and expired artifacts. Idempotent: repeating it returns the same
while the tombstone exists, then200 .404 - No credential:
. A credential for another artifact:401 unauthorized .403 forbidden - Deletion keeps working when uploads are refused because no rate limiter or secret is available, and when anonymous uploads are switched off.
GET /v1/limits
Public. Returns the limits in force: (with ) and , each with , , , , , (, , ) and (, ); ; ; ; (, , , ); (, ); ; ; and , the rate limiter in use (, or when no limiter is available; anonymous uploads then answer ).
Admin routes
For the operator, with . Without the admin secret, every admin route answers , exactly like an unknown path. Admin bodies are at most 8 KiB.
| Route | Request | Response |
|---|---|---|
| (1 to 64 characters of printable text) | . The key is shown once. |
optional | none | . Idempotent; the first revocation time is kept. The key is refused from the next request on. With , also blocks up to 200 of the key's artifacts per call and adds and : repeat while is true. Without it, the key's published artifacts stay online, and its pending ones can no longer be completed. |
| (1 to 500 characters of printable text) | . Takedown: every URL answers from the next request on; the bytes are deleted. Idempotent; the first reason is kept. |
Error codes
The HTTP status follows from the code. Only is meant to be retried as such (after uploading the missing files); can be retried after .
| Code | HTTP | Meaning and |
|---|---|---|
| 400 | The body is not valid UTF-8 JSON. |
| 400 | The body or a parameter breaks the schema, or has an unknown field. names it. |
| 400 | Paths break the path rules. : (first 100); . |
| 400 | Paths look like credentials or VCS data. : ; . |
| 400 | A site has no at its root. |
| 400 | named paths that are not in the manifest. . |
| 401 | The route needs the delete token or the owner's API key, or is not . |
| 401 | The key is malformed, unknown or revoked (also when it was revoked while the create was in flight), or create received a credential that is not an API key. |
| 403 | The credential cannot manage this artifact; persistence is switched off; or, with , the owning key was revoked (, ). |
| 403 | Anonymous uploads are switched off (create, and and of anonymous artifacts). Use an API key. |
| 403 | without an API key. |
| 403 | A or sent by a web page on another site ( is or ). |
| 404 | Unknown path or artifact; also pending, failed and private artifacts for callers who cannot manage them, and admin routes without the admin secret. |
| 405 | Wrong method; the header lists the right ones. |
| 409 | Some files are not uploaded yet. (first 100), . Upload them and retry. |
| 409 | on an artifact that is already published or failed. |
| 409 | on a failed artifact. Create a new one. |
| 409 | A file already received its 3 upload URLs. , . |
| 409 | The artifact used its 4 attempts. |
| 410 | Expired, deleted or blocked, or the upload window has closed. |
| 413 | The request body is too large. . |
| 413 | A file is above the size limit. , . |
| 413 | The files add up to more than the artifact limit. . |
| 413 | More files than allowed. . |
| 415 | The body is not sent as . |
| 422 | Stored objects differ from the manifest; the artifact has failed. (first 20): ; . |
| 422 | Sites cannot be private. Use , or share files privately. |
| 422 | Below the minimum lifetime. . |
| 422 | Above the maximum lifetime for this identity. . |
| 429 | Too many requests. . |
| 429 | A daily quota is used up. : , (all anonymous traffic) or ; (next UTC midnight); in seconds. |
| 500 | Unexpected server error. |
| 503 | The service cannot accept uploads right now (for example no rate limiter: ). Deletion still works. |
Abuse
Report abuse or illegal content to everywhere.