Snippets

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. Use the public URL's origin, without its path.

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

Read and manage a snippet