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.io/dwm4p2ar2q2wvb7x6tlbr7nkq5igfsp6cuzqkztc5nhmuplnykuq/versions/ndcaw4secb4yxz4y7ooayl74r4oy37k4o6nvsvyho6j2h2gvm7qa",
  "id": "dwm4p2ar2q2wvb7x6tlbr7nkq5igfsp6cuzqkztc5nhmuplnykuq",
  "content": "The content of my snippet",
  "version_id": "ndcaw4secb4yxz4y7ooayl74r4oy37k4o6nvsvyho6j2h2gvm7qa",
  "version": 1,
  "latest_version_id": "ndcaw4secb4yxz4y7ooayl74r4oy37k4o6nvsvyho6j2h2gvm7qa",
  "extension": "ex",
  "content_size": 25,
  "ttl": 3600,
  "remaining_ttl": 3600,
  "versions": [
    {
      "id": "ndcaw4secb4yxz4y7ooayl74r4oy37k4o6nvsvyho6j2h2gvm7qa",
      "snippet_id": "dwm4p2ar2q2wvb7x6tlbr7nkq5igfsp6cuzqkztc5nhmuplnykuq",
      "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.