API reference
Use the API to create, read, update, and delete snippets. For a machine-readable description, use the OpenAPI document.
Create a snippet
Send JSON to POST /snippets. Save edit_token from the response. You need it to update or delete the snippet.
Every write request must include an Origin header matching the public URL's origin, without a path. If Origin is absent, the server checks the origin of Referer.
curl -X POST https://snippets.ix0.io/snippets \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Origin: https://snippets.ix0.io" \
-d '{"title":"Notes","language":"text","content":"Text to share"}'Request fields
contentis required.titledefaults toUntitled snippet.languagedefaults totext, is case-insensitive, and must match a language in the create form list.tags,description,custom_url,password,expiration, andburn_after_readingare optional.contentcan contain up to 1048576 bytes. Use lowercase letters, numbers, and hyphens in tags. You can set up to 10 tags, with 50 characters per tag.
Read and manage a snippet
GET /s/{id}returns JSON when you sendAccept: application/json.GET /raw/{id}returns the plain text content.PUT /snippets/{id}andDELETE /snippets/{id}require an edit token in theX-Edit-Tokenheader or the JSONtokenfield, plus the origin check described above.- To add an alias to an existing snippet, send
custom_urlin an update. Saved aliases are permanent, and the original URL still works.