{"openapi":"3.1.0","info":{"title":"shortText.com API","version":"1.0.0","description":"Paste short text, get a shareable URL. Reads are open to any client; creating requires an API key (Authorization: Bearer st_live_…, request at api@shorttext.com) or, for the public web form, Cloudflare Turnstile. See /llms.txt for the agent-oriented overview and /mcp for the MCP server.","contact":{"email":"api@shorttext.com"}},"servers":[{"url":"https://shorttext.com"}],"paths":{"/api/paste":{"post":{"operationId":"createShortText","summary":"Create a shortText","description":"Create a shortText and get a shareable URL back. Agents send an API key as Authorization: Bearer st_live_… (rate-limited per key); the public web form instead includes a Cloudflare Turnstile token. Markdown is supported.","security":[{"bearerAuth":[]},{}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRequest"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateResponse"}}}},"400":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/api/paste/{slug}":{"get":{"operationId":"readShortText","summary":"Read a shortText as JSON","description":"Returns the body and metadata. Public and unlisted shortTexts are open; private ones require the password via the `password` query param or `X-Password` header. Reading a burn-after-read shortText consumes it.","parameters":[{"$ref":"#/components/parameters/Slug"},{"name":"password","in":"query","required":false,"schema":{"type":"string"},"description":"Required only for private shortTexts."}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ShortText"}}}},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"}}},"put":{"operationId":"updateShortText","summary":"Update a shortText","description":"Replace the body (and optionally visibility / password / comments) of an existing shortText. Requires the editCode returned at creation.","parameters":[{"$ref":"#/components/parameters/Slug"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRequest"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"410":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/Error"}}}},"/{slug}/raw":{"get":{"operationId":"readShortTextRaw","summary":"Read a shortText as plain text","description":"Returns the raw Markdown body as text/plain. Private shortTexts require the password via `password` query param or `X-Password` header.","parameters":[{"$ref":"#/components/parameters/Slug"},{"name":"password","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Private — password required"},"403":{"description":"Wrong password"},"404":{"description":"Not found"},"410":{"description":"Expired or already burned"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An operator-issued API key (st_live_…). Bypasses the bot check and is rate-limited per key. Request one at api@shorttext.com."}},"parameters":{"Slug":{"name":"slug","in":"path","required":true,"schema":{"type":"string"},"description":"The shortText id (the part after shorttext.com/)."}},"responses":{"Error":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"CreateRequest":{"type":"object","required":["body"],"properties":{"body":{"type":"string","maxLength":30000,"description":"The text content. Markdown supported."},"format":{"type":"string","enum":["html"],"description":"Set to \"html\" to send raw HTML in `body`; it is converted to Markdown server-side. Omit to treat `body` as Markdown verbatim."},"visibility":{"type":"string","enum":["public","unlisted","private"],"default":"public"},"password":{"type":"string","description":"Required when visibility is \"private\"."},"expiry":{"type":"string","enum":["never","1h","1d","30d"],"default":"never"},"burnAfterRead":{"type":"boolean","default":false,"description":"Delete after the first view."},"commentsEnabled":{"type":"boolean","default":true},"turnstileToken":{"type":"string","description":"Cloudflare Turnstile token (web clients)."}}},"UpdateRequest":{"type":"object","required":["body","editCode"],"properties":{"body":{"type":"string","maxLength":30000},"editCode":{"type":"string"},"visibility":{"type":"string","enum":["public","unlisted","private"]},"password":{"type":"string"},"commentsEnabled":{"type":"boolean"}}},"CreateResponse":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string","format":"uri"},"editUrl":{"type":"string","format":"uri"},"editCode":{"type":"string","description":"Secret token for editing — store it, don't share it."}}},"ShortText":{"type":"object","properties":{"slug":{"type":"string"},"url":{"type":"string","format":"uri"},"body":{"type":"string"},"visibility":{"type":"string","enum":["public","unlisted","private"]},"burnAfterRead":{"type":"boolean"},"burned":{"type":"boolean","description":"True if this read just consumed a burn-after-read shortText."},"commentsEnabled":{"type":"boolean"},"viewCount":{"type":"integer"},"createdAt":{"type":"integer","description":"Unix epoch ms."},"updatedAt":{"type":"integer","description":"Unix epoch ms."},"expiresAt":{"type":["integer","null"],"description":"Unix epoch ms, or null if it never expires."}}},"Error":{"type":"object","properties":{"error":{"type":"string"}}}}}}