Skip to content
Connect an agent

Hosting

List the diagrams a key or an app's token can see

A page of diagrams, newest first: a person's own hosted diagrams, or an organisation's library under its folder rules and approval holds, as the person would see it.

GET/v1/library

TL;DR

QuestionAnswer
What does it do?List the diagrams a key or an app's token can see.
What does it take?limit, cursor, folder in the query string.
What does it return?Status 200 with a body of type LibraryPage.
What can go wrong?400 the query is not valid, or the cursor is not one this API gave; 401 no key, or the key or token is not valid; 403 the token's grant does not hold library:read (oauth.insufficient_scope); 404 the organisation of the key is gone, or the member left it; 429 too many requests, or the daily limit is used up. Every failure uses the one error envelope.

What it does

A page of diagrams, newest first: a person's own hosted diagrams, or an organisation's library under its folder rules and approval holds, as the person would see it. No diagram source is answered. An app's token needs library:read. Open to every plan.

Query parameters

FieldTypeRequiredDescription
limitintegernoDiagrams a page, 1 to 100. 50 when left out.
cursorstringnoThe nextCursor of the page before.
folderstringnoKeep to this folder and everything inside it, such as Payments/Checkout.

Responses

StatusMeaningBody
200A page of the library.LibraryPage
400The query is not valid, or the cursor is not one this API gave.ErrorResponse
401No key, or the key or token is not valid.ErrorResponse
403The token's grant does not hold library:read (oauth.insufficient_scope).ErrorResponse
404The organisation of the key is gone, or the member left it.ErrorResponse
429Too many requests, or the daily limit is used up.ErrorResponse

Response body

A 200 answer has the type LibraryPage.

FieldTypeRequiredDescription
itemsobject[]yes
items[].idstringyes
items[].namestring | nullyes
items[].folderstring | nullyes
items[].scheme"light" | "dark" | "auto"yesThe color scheme it was drawn in: light, dark, or auto.
items[].bytesintegeryes
items[].updatedAtintegeryesWhen it was last published, in milliseconds since the epoch.
items[].classification"public" | "internal" | "confidential" | nullyesIts label in an organisation's library, or null for a person's own diagram.
nextCursorstring | nullyes

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools