Upsert a bin
Create or update a single bin. Pass id to update the matching bin; omit id to create a new one. A create responds 201 with the new bin; an update responds 200 with the updated bin. Both responses carry the full bin, including its server-assigned id and timestamps.
A bin is a named sub-location used by bin inventory tracking — packages, batches, plants, plant groups and assembly outputs are associated to a bin to record where within a location they physically sit. This endpoint only names and renames the bin itself; it never moves, creates, or consumes inventory, and it does not change which packages, batches or plants are associated to a bin. Renaming a bin is reflected everywhere that bin is already referenced.
Names are unique per company, case-insensitively — Cooler and cooler collide — and cannot contain commas. A create or update that would collide with an existing name, or that includes a comma, is rejected with a 400 and a human-readable message.
Bins only exist for companies that have bin inventory tracking enabled; if it is disabled the request is rejected. Updates are scoped to your company — an id for a bin you do not own is treated as not found.
Required permission: settings_permissions_bins.
BearerAuthorizationBearer <token>API token generated in Distru (Settings → Distru API). Send it on every request as Authorization: Bearer YOUR_API_TOKEN.
application/json- body
id?stringThe bin's ID. Provide it to update that bin (only name can change); omit it to create a new bin. An ID for a bin outside your company returns 404.
name*stringThe bin's name. Required on both create and update. Must be unique within your company (compared case-insensitively) and cannot contain a comma; violating either returns a 400. This is the only editable field on update.
The updated bin
*/*- response
A single bin
data?A bin used to track where inventory is physically stored
curl -X POST 'https://app.distru.com/public/v1/bins' \ -H 'Content-Type: application/json' \ -d '{ "name": "Vault"}'{ "data": { "id": "string", "inserted_datetime": "string", "name": "string", "updated_datetime": "string" }}