Docs

Notes...

Currently snippets are set to expire after 604800 seconds (1 week).

Please treat the id's as opaque, they can change.


API

Endpoints


POST /api

POST to this endpoint to create a new snippet.

Content-Type must be application/json.

Example response:

{
  "url": "https://amnesia.im/cbiusuwd33fagefcoltcpa5my3byopqtbq6oboskhwqt4bm7ylxa/versions/cxcbwbxt2oy57qitb36yl5xlmh52mnchtifff4th2dwa3ahiqhyq",
  "id": "cbiusuwd33fagefcoltcpa5my3byopqtbq6oboskhwqt4bm7ylxa",
  "content": "The content of my snippet",
  "version_id": "cxcbwbxt2oy57qitb36yl5xlmh52mnchtifff4th2dwa3ahiqhyq",
  "version": 1,
  "latest_version_id": "cxcbwbxt2oy57qitb36yl5xlmh52mnchtifff4th2dwa3ahiqhyq",
  "extension": "ex",
  "content_size": 25,
  "ttl": 3600,
  "remaining_ttl": 3600,
  "versions": [
    {
      "id": "cxcbwbxt2oy57qitb36yl5xlmh52mnchtifff4th2dwa3ahiqhyq",
      "snippet_id": "cbiusuwd33fagefcoltcpa5my3byopqtbq6oboskhwqt4bm7ylxa",
      "parent_id": null,
      "version": 1
    }
  ]
}

PUT /api/:snippet_id

Update a snippet.

Content-Type must be application/json.

The return will be the reflected snippet.

GET /api/:snippet_id

Get the latest version of a snippet by :snippet_id.

GET /api/:snippet_id/raw

Get the raw content of the latest snippet version.

GET /api/:snippet_id/versions/:version_id

Get a version of a snippet by passing :snippet_id and :version_id.

GET /api/:snippet_id/versions/:version_id/raw

Get the raw content of a snippet version.