Skip to content
Skip to Content
Full reference

Annotations

GET
/v1/items/{id}/annotations

In reading order: by offset where known, then oldest first. Each reader has their own annotations: the item's owner, and the owner or accepted members of a list the item is in. Anyone else gets 404, as for a deleted item. An API key needs read access to items.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Response Body

The caller's annotations on the item

application/json
  1. response
annotations*array<>
Example Request
curl -X GET 'https://example.com/v1/items/string/annotations'
Example Response
{  "annotations": [    {      "id": "string",      "item_id": "string",      "text": "string",      "prefix": "string",      "suffix": "string",      "offset": 0,      "color": "yellow",      "note": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "item": {        "id": "string",        "kind": "string",        "title": "string",        "url": "string",        "domain": "string"      }    }  ]}
POST
/v1/items/{id}/annotations

text is the passage as it appears in the item's text; prefix and suffix (the words just before and after it) let a client find it again after the text changes, and offset says where to look first. A user keeps at most 500 annotations on one item (409 annotation.item_limit). Refused while the library is read-only over its plan's limits. An API key needs write access to items.

An annotation is not a quote: it stays on its item and is not a card in the feed. To save a passage as an item of its own, create a quote.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

id*string

Request Body

application/json
  1. body
text*string

Not blank.

Length1 <= length <= 5000
prefix?string
Lengthlength <= 200
suffix?string
Lengthlength <= 200
offset?integer

Character offset into the item's text.

Range0 <= value
color?AnnotationColor
Default"yellow"
Value in"yellow""green""blue""pink"
note?string

Blank is saved as null.

Lengthlength <= 10000

Response Body

Created

application/json
  1. response
id*string
item_id*string
text*string

The marked passage.

prefix*string

The words just before the passage, to find it again; may be empty.

suffix*string

The words just after the passage; may be empty.

offset*|

Where the passage was in the item's text when it was marked.

Range0 <= value
color*AnnotationColor
Default"yellow"
Value in"yellow""green""blue""pink"
note*string|null
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
item?

The item it is in. In lists across items and single reads; left out in an item's own list.

Example Request
curl -X POST 'https://example.com/v1/items/string/annotations' \  -H 'Content-Type: application/json' \  -d '{  "text": "string"}'
Example Response
{  "id": "string",  "item_id": "string",  "text": "string",  "prefix": "string",  "suffix": "string",  "offset": 0,  "color": "yellow",  "note": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "item": {    "id": "string",    "kind": "string",    "title": "string",    "url": "string",    "domain": "string"  }}
GET
/v1/annotations

Newest first, each with the item it is in, on items the caller can still read. An API key needs read access to items.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Query Parameters

item_id?string

Only annotations on this item

Length26 <= length <= 26
color?string
Default"yellow"
Value in"yellow""green""blue""pink"
q?string

Words in the passage or its note (English stemming; quotes, or and -word work)

Lengthlength <= 500
cursor?string

next_cursor from the previous page

limit?integer
Range1 <= value <= 200
Default50

Response Body

A page of annotations

application/json
  1. response
annotations*array<>
next_cursor*string|null
Example Request
curl -X GET 'https://example.com/v1/annotations'
Example Response
{  "annotations": [    {      "id": "string",      "item_id": "string",      "text": "string",      "prefix": "string",      "suffix": "string",      "offset": 0,      "color": "yellow",      "note": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "item": {        "id": "string",        "kind": "string",        "title": "string",        "url": "string",        "domain": "string"      }    }  ],  "next_cursor": "string"}
GET
/v1/annotations/{annotationID}

404 for someone else's annotation, or one on an item the caller can no longer read.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

annotationID*string

Response Body

The annotation, with its item

application/json
  1. response
id*string
item_id*string
text*string

The marked passage.

prefix*string

The words just before the passage, to find it again; may be empty.

suffix*string

The words just after the passage; may be empty.

offset*|

Where the passage was in the item's text when it was marked.

Range0 <= value
color*AnnotationColor
Default"yellow"
Value in"yellow""green""blue""pink"
note*string|null
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
item?

The item it is in. In lists across items and single reads; left out in an item's own list.

Example Request
curl -X GET 'https://example.com/v1/annotations/string'
Example Response
{  "id": "string",  "item_id": "string",  "text": "string",  "prefix": "string",  "suffix": "string",  "offset": 0,  "color": "yellow",  "note": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "item": {    "id": "string",    "kind": "string",    "title": "string",    "url": "string",    "domain": "string"  }}
PATCH
/v1/annotations/{annotationID}

Fields left out stay as they are; a blank note clears it. The passage cannot change: marking another passage is a new annotation. Refused while the library is read-only over its plan's limits.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

annotationID*string

Request Body

application/json
  1. body
color?AnnotationColor
Default"yellow"
Value in"yellow""green""blue""pink"
note?string
Lengthlength <= 10000

Response Body

Changed

application/json
  1. response
id*string
item_id*string
text*string

The marked passage.

prefix*string

The words just before the passage, to find it again; may be empty.

suffix*string

The words just after the passage; may be empty.

offset*|

Where the passage was in the item's text when it was marked.

Range0 <= value
color*AnnotationColor
Default"yellow"
Value in"yellow""green""blue""pink"
note*string|null
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
item?

The item it is in. In lists across items and single reads; left out in an item's own list.

Example Request
curl -X PATCH 'https://example.com/v1/annotations/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "id": "string",  "item_id": "string",  "text": "string",  "prefix": "string",  "suffix": "string",  "offset": 0,  "color": "yellow",  "note": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "item": {    "id": "string",    "kind": "string",    "title": "string",    "url": "string",    "domain": "string"  }}
DELETE
/v1/annotations/{annotationID}

Works even when the caller can no longer read the item (they left the list it was shared in), and while the library is read-only over its plan's limits.

Authorization

bearer
headerAuthorizationBearer <token>

Supabase access token (JWT) or personal API key (ga_…). A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Path Parameters

annotationID*string

Response Body

Deleted

Example Request
curl -X DELETE 'https://example.com/v1/annotations/string'
Example Response
Empty