Skip to content

Create an annotation

POST
/api/v1/annotations
curl --request POST \
--url http://127.0.0.1:58259/api/v1/annotations \
--header 'Content-Type: application/json' \
--data '{ "bookId": 1, "cfi": "example", "text": "example", "color": "example", "style": "example", "note": "example", "chapterTitle": "example" }'

Create a new annotation (highlight, underline, etc.) for a book.

Media type application/json

Annotation creation request

object
bookId
required
integer format: int64
cfi
required
string
0 <= 1000 characters
text
required
string
0 <= 5000 characters
color
string
/^#[0-9A-Fa-f]{6}$/
style
string
/^(highlight|underline|strikethrough|squiggly)$/
note
string
0 <= 5000 characters
chapterTitle
string
0 <= 500 characters
Example generated
{
"bookId": 1,
"cfi": "example",
"text": "example",
"color": "example",
"style": "example",
"note": "example",
"chapterTitle": "example"
}

Annotation created successfully

Media type */*
object
id
integer format: int64
userId
integer format: int64
bookId
integer format: int64
cfi
string
text
string
color
string
style
string
note
string
chapterTitle
string
createdAt
string format: date-time
updatedAt
string format: date-time