API de Bazarazzi
Tout ce que fait l'application est aussi une API HTTP sous /api/v1 : lire et modifier les objets, lieux, photos, documents, personnes et accès, depuis un script ou un autre outil.
S'authentifier
Créez un jeton personnel dans Réglages, Personnes, Développeur, et envoyez-le en Authorization: Bearer inv_pat_... Une organisation peut aussi créer des comptes de service, dont les clés commencent par inv_sa_ et agissent avec le rôle qu'on leur donne.
Choisir l'espace
Envoyez l'identifiant de l'espace dans X-Tenant-Id. Un jeton appartient à un seul espace : avec un jeton, l'en-tête peut être omis. GET /workspaces s'en passe.
Pages
Les listes répondent { data, next_cursor }. Renvoyez next_cursor dans cursor jusqu'à ce qu'il soit null. limit va jusqu'à 200.
Erreurs
Les erreurs suivent le format problem details (RFC 9457) : un JSON avec title, status, detail et, pour un champ refusé, errors. 401 : jeton absent ou mort ; 403 : permission manquante ; 404 : introuvable, ou ce que vous ne pouvez pas lire.
Limites
600 requêtes par minute et par jeton, et 60 envois de fichiers, annoncés dans les en-têtes RateLimit. Au-delà, 429 avec Retry-After.
Rechercher
GET /items?q=... trouve les objets par un mot de leur nom, sans tenir compte des majuscules, ou par le début de leur numéro de série (tel que tapé ou en capitales). serial_number=... cherche un numéro de série exact. Les deux passent par un index : ils restent rapides sur un grand espace.
Réessayer sans risque
Envoyez un Idempotency-Key avec un POST : la même clé dans les 24 heures rejoue la première réponse au lieu de tout refaire.
Modifications simultanées
Un élément seul répond avec un ETag. Renvoyez-le dans If-Match avec PATCH ou DELETE : si quelqu'un l'a modifié entre-temps, vous recevez 412 au lieu d'écraser sa modification.
Versions
Les changements incompatibles iront dans /api/v2. /api/v1 continuera alors de fonctionner au moins 12 mois, et ses réponses porteront un en-tête Deprecation.
Webhooks
Une organisation peut prévenir jusqu'à 10 adresses HTTPS de ses changements, dans la minute. Chaque POST porte Inventaire-Signature: t=<secondes>,v1=<hex>, le HMAC-SHA256 de <t>.<corps brut> avec le secret du webhook : vérifiez-le, et refusez un t de plus de 5 minutes. Un envoi raté est retenté pendant 24 heures ; dédoublonnez sur l'id de l'événement.
Workspaces
- get
/workspacesList my workspaces
- Il faut:
être membre- Sans X-Tenant-Id
- post
/workspacesCreate a workspace
- Il faut:
être membre- Corps:
{ name, currency, kind }- Sans X-Tenant-Id
- get
/workspaces/{id}Get a workspace
- Il faut:
être membre
- patch
/workspaces/{id}Change a workspace
- Il faut:
settings.manage- Corps:
{ name, currency, kind, lostContact, org }
- get
/settingsGet the shared settings
- Il faut:
être membre
- patch
/settingsChange the shared settings
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Settings
Items
- get
/itemsList items
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.parent_idOnly the direct contents of this item, `root` for the top level.typeOne of place, room, furniture, container, library, object, book.statusOne of owned, lent, forSale, sold, given, moved, broken, repair, lost, stolen, thrown, wanted.tag_idOnly things with this tag.asset_numberThe asset number, exactly.serial_numberThe serial number, exactly as written.barcodeA barcode the thing carries.qWords in the name, or the start of the serial number.
- post
/itemsCreate a item
Requires `type`, `name`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Item
- get
/items/{id}Get a item
Answers with an `ETag`.
- Il faut:
items.read
- patch
/items/{id}Change a item
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Item
- delete
/items/{id}Delete a item
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- get
/items/treeThe tree of places and containers
- Il faut:
items.read- Paramètres:
rootStart from this item instead of the top.
- get
/items/{id}/pathWhere a thing is, from the top
- Il faut:
items.read
- get
/items/{id}/contentsWhat a thing holds, at every depth
- Il faut:
items.read
- post
/items/{id}/moveMove a thing
- Il faut:
la permission de modifier ce qui est écrit- Corps:
{ parentId }
- post
/items/{id}/restoreTake a thing out of the bin
- Il faut:
la permission de modifier ce qui est écrit
- post
/items/{id}/purgeDelete a binned thing for good
- Il faut:
items.purge
- post
/items/{id}/splitSplit a quantity into a new thing
- Il faut:
la permission de modifier ce qui est écrit- Corps:
{ quantity }
- post
/items/{id}/duplicateDuplicate a thing
- Il faut:
la permission de modifier ce qui est écrit- Corps:
{ suffix }
Views
- get
/viewsList views
- Il faut:
être membre- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- post
/viewsCreate a view
Requires `name`, `filter`, `display`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
View
- get
/views/{id}Get a view
Answers with an `ETag`.
- Il faut:
être membre
- patch
/views/{id}Change a view
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
View
- delete
/views/{id}Delete a view
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
People
- get
/peopleList people
- Il faut:
être membre- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- post
/peopleCreate a person
Requires `name`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Person
- get
/people/{id}Get a person
Answers with an `ETag`.
- Il faut:
être membre
- patch
/people/{id}Change a person
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Person
- delete
/people/{id}Delete a person
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- get
/membersList members
- Il faut:
être membre- Paramètres:
format`csv` to download the list (managers only).
- get
/members/{id}Get a member
- Il faut:
être membre
- patch
/members/{id}Change a member's role or suspend them
- Il faut:
members.manage- Corps:
{ role, status }
- delete
/members/{id}Remove a member, or leave
A member may remove themselves; removing someone else needs `members.manage`.
- Il faut:
être membre
- get
/members/{id}/accessWhat a member may do, and why
- Il faut:
être membre- Paramètres:
itemExplain the access to this item.
- get
/invitesList open invitations
- Il faut:
members.manage
- post
/invitesInvite people
One invitation, or up to 200 in `invites`.
- Il faut:
members.manage- Corps:
{ email, role, scopeId, invites }
- post
/invites/{id}/renewRenew an invitation
- Il faut:
members.manage
- delete
/invites/{id}Revoke an invitation
- Il faut:
members.manage
- get
/groupsList groups
- Il faut:
être membre
- post
/groupsCreate a group
- Il faut:
members.manage- Corps:
{ name, memberIds }
- get
/groups/{id}Get a group
- Il faut:
être membre
- patch
/groups/{id}Change a group
- Il faut:
members.manage- Corps:
{ name, memberIds }
- delete
/groups/{id}Delete a group
- Il faut:
members.manage
- get
/rolesList roles, built in and custom
- Il faut:
être membre
- post
/rolesCreate a custom role
- Il faut:
roles.manage- Corps:
{ name, permissions }
- get
/roles/{id}Get a role
- Il faut:
être membre
- patch
/roles/{id}Change a custom role
- Il faut:
roles.manage- Corps:
{ name, permissions }
- delete
/roles/{id}Delete a custom role
- Il faut:
roles.manage
- get
/grantsList grants
- Il faut:
members.manage
- post
/grantsGive a role, on everything or on a place
- Il faut:
members.manage- Corps:
{ subject, roleId, scopeId }
- delete
/grants/{id}Take a grant back
- Il faut:
members.manage
- get
/auditThe audit log, newest first
- Il faut:
audit.read- Paramètres:
actorA member or service account id.actionAn action, or a prefix ending in `*`.targetA target id.fromFrom this ISO time.toUp to this ISO time.cursorThe `next_cursor` of the page before.limit1 to 1000.format`csv` or `jsonl` to download up to 1000 events.
Files
- get
/photosList photos
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- get
/photos/{id}Get a photo
Answers with an `ETag`.
- Il faut:
items.read
- patch
/photos/{id}Change a photo
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Photo
- delete
/photos/{id}Delete a photo
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- post
/photosUpload a photo
Multipart. Send the SHA-256 of the file in `x-sha256`; the upload fails when it does not match.
- Il faut:
items.edit- Corps:
multipart: file, itemId, proof- Envoi de fichier, 60 par minute
- get
/photos/{id}/fileDownload a photo
- Il faut:
items.read- Paramètres:
size`thumb` for the thumbnail.
- get
/documentsList documents
- Il faut:
documents.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- get
/documents/{id}Get a document
Answers with an `ETag`.
- Il faut:
documents.read
- patch
/documents/{id}Change a document
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Document
- delete
/documents/{id}Delete a document
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- post
/documentsUpload a document
Multipart. Send the SHA-256 of the file in `x-sha256`; the upload fails when it does not match.
- Il faut:
documents.edit- Corps:
multipart: file, itemId, kind, title, expiresOn- Envoi de fichier, 60 par minute
- get
/documents/{id}/fileDownload a document
- Il faut:
documents.read
Life
- get
/status-changesList status changes
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- post
/status-changesCreate a status change
Requires `itemId`, `status`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
StatusChange
- get
/status-changes/{id}Get a status change
Answers with an `ETag`.
- Il faut:
items.read
- patch
/status-changes/{id}Change a status change
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
StatusChange
- delete
/status-changes/{id}Delete a status change
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- get
/loansWhat is lent, and to whom
- Il faut:
items.read
- get
/usesList uses
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- post
/usesCreate a use
Requires `itemId`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Use
- get
/uses/{id}Get a use
Answers with an `ETag`.
- Il faut:
items.read
- patch
/uses/{id}Change a use
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Use
- delete
/uses/{id}Delete a use
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- get
/care-tasksList caretasks
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- post
/care-tasksCreate a caretask
Requires `itemId`, `name`, `every`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
CareTask
- get
/care-tasks/{id}Get a caretask
Answers with an `ETag`.
- Il faut:
items.read
- patch
/care-tasks/{id}Change a caretask
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
CareTask
- delete
/care-tasks/{id}Delete a caretask
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- get
/care-recordsList carerecords
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- post
/care-recordsCreate a carerecord
Requires `taskId`, `itemId`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
CareRecord
- get
/care-records/{id}Get a carerecord
Answers with an `ETag`.
- Il faut:
items.read
- patch
/care-records/{id}Change a carerecord
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
CareRecord
- delete
/care-records/{id}Delete a carerecord
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- get
/reviewsList reviews
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- post
/reviewsCreate a review
Requires `zoneId`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Review
- get
/reviews/{id}Get a review
Answers with an `ETag`.
- Il faut:
items.read
- patch
/reviews/{id}Change a review
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Review
- delete
/reviews/{id}Delete a review
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- get
/remindersWhat is due: loans, documents, reviews, swaps
- Il faut:
items.read
- get
/conflictsList conflicts
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- get
/conflicts/{id}Get a conflict
Answers with an `ETag`.
- Il faut:
items.read
- post
/conflicts/{id}/resolveResolve a conflict
- Il faut:
la permission de modifier ce qui est écrit- Corps:
{ keep }
Labels
- get
/labelsList labels
- Il faut:
items.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- patch
/labels/{id}Change a label
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Label
- post
/labelsPrint a batch of blank labels
- Il faut:
labels.print- Corps:
{ count }
- get
/labels/{id}Get a label by its code
- Il faut:
items.read
- get
/labels/resolveWhat a scan points to
- Il faut:
items.read- Paramètres:
scanA code, or the URL a label carries.
- get
/barcodes/{code}Things carrying a barcode
- Il faut:
items.read
Insurance
- get
/policiesList policys
- Il faut:
values.read- Paramètres:
cursorThe `next_cursor` of the page before.limit1 to 200, 50 by default.updated_sinceOnly what changed since this ISO 8601 time.deleted`false` (default), `true` to include the bin, `only` for the bin alone.item_idOnly the ones about this item.
- post
/policiesCreate a policy
Requires `placeId`. An `id` may be given.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Policy
- get
/policies/{id}Get a policy
Answers with an `ETag`.
- Il faut:
values.read
- patch
/policies/{id}Change a policy
Only the fields given change. With `If-Match`, fails with 412 when it changed since.
- Il faut:
la permission de modifier ce qui est écrit- Corps:
Policy
- delete
/policies/{id}Delete a policy
Puts it in the bin.
- Il faut:
la permission de modifier ce qui est écrit
- get
/policies/{id}/coverageIs the place underinsured?
- Il faut:
values.read
- post
/claim-packsMake a claim pack
A ZIP with a PDF report, the list as CSV and every photo and document of the things.
- Il faut:
export.run- Corps:
{ scopeId, locale }
Campaigns
- post
/campaigns/{id}/statementsMake a statement
The PDF the app makes: an estate's statement for one heir (`personId`) or for the notary (`personId` null), once the estate is closed; or a split's statement for all its parties, once the split is open.
- Il faut:
campaigns.manage- Corps:
{ personId, locale }
Found
- get
/foundConversations with finders
- Il faut:
items.read
- get
/found/{id}Get a conversation
- Il faut:
items.read
- post
/found/{id}/replyAnswer the finder
- Il faut:
lostfound.answer- Corps:
{ text }
- post
/found/{id}/meetingAccept or decline the finder's proposal to meet
- Il faut:
lostfound.answer- Corps:
{ accept, slot }
- post
/found/{id}/readMark as read
- Il faut:
items.read
- post
/found/{id}/closeClose a conversation
- Il faut:
lostfound.answer- Corps:
{ rewardGiven }
- post
/found/{id}/reopenReopen a conversation
- Il faut:
lostfound.answer
Exports
- get
/exportsList my exports
- Il faut:
export.run
- post
/exportsStart an export, whole or partial
- Il faut:
export.run- Corps:
{ roots, photosOnly }
- get
/exports/{id}Get an export
- Il faut:
export.run
- get
/exports/{id}/fileDownload an export
- Il faut:
export.run
Access
- get
/tokensList my personal tokens
- Il faut:
être membre
- post
/tokensMake a personal token
The secret is in this answer only. Its permissions are picked from yours; without them it may do all you may.
- Il faut:
être membre- Corps:
{ name, permissions, expiresInDays }
- delete
/tokens/{id}Revoke a personal token
- Il faut:
être membre
- post
/tokens/{id}/rotateReplace a token's secret
- Il faut:
être membre
- get
/service-accountsList service accounts
- Il faut:
api.manage
- post
/service-accountsCreate a service account
- Il faut:
api.manage- Corps:
{ name, roleId, scopeId }
- get
/service-accounts/{id}Get a service account
- Il faut:
api.manage
- patch
/service-accounts/{id}Rename or disable a service account
- Il faut:
api.manage- Corps:
{ name, disabled }
- delete
/service-accounts/{id}Delete a service account, its keys and grants
- Il faut:
api.manage
- post
/service-accounts/{id}/keysMake a key
- Il faut:
api.manage- Corps:
{ name, expiresInDays }
- delete
/service-accounts/{id}/keys/{keyId}Revoke a key
- Il faut:
api.manage
- post
/service-accounts/{id}/keys/{keyId}/rotateReplace a key's secret
- Il faut:
api.manage
Webhooks
- get
/webhooksList webhooks
- Il faut:
api.manage
- post
/webhooksAdd a webhook
Organisations only, at most 10. The URL must use https and resolve to public addresses. Each POST carries `Inventaire-Event`, `Inventaire-Delivery` and `Inventaire-Signature: t=<unix>,v1=<hex>`, an HMAC-SHA256 of `<t>.<body>` with the secret. A non-2xx answer is retried after 1, 5 and 15 minutes, 1, 3 and 6 hours, then every 6 hours for 24 hours; a webhook failing for 3 days is turned off.
- Il faut:
api.manage- Corps:
{ url, events, serviceAccountId }
- get
/webhooks/{id}Get a webhook
- Il faut:
api.manage
- patch
/webhooks/{id}Change a webhook or turn it on or off
- Il faut:
api.manage- Corps:
{ url, events, serviceAccountId, state }
- delete
/webhooks/{id}Delete a webhook and its delivery log
- Il faut:
api.manage
- post
/webhooks/{id}/rotateReplace the signing secret
The previous secret keeps signing for 24 hours: the header carries one `v1` per live secret.
- Il faut:
api.manage
- post
/webhooks/{id}/testSend a test event
- Il faut:
api.manage
- get
/webhooks/{id}/deliveriesList the last deliveries
- Il faut:
api.manage- Paramètres:
limit1 to 200, 50 by default.
- post
/webhooks/{id}/deliveries/{deliveryId}/redeliverSend a delivery again
- Il faut:
api.manage