Upsert a tag
Creates a new tag or renames an existing one. Pass id to update the tag with that ID; omit id to
create a new tag. A create returns 201, an update returns 200; both return the saved tag.
A tag is only a label. Creating or renaming one does not attach it to anything, and touches no inventory and no compliance system (Metrc/BioTrack) — these are Distru-internal labels, unrelated to Metrc's physical package tags. Renaming a tag keeps it attached to every product and tax it was already on, so those records simply reflect the new name.
name must be unique within the company, compared case-insensitively — "Indica" and "indica" collide, and
a duplicate is rejected with a validation error. Updating a tag to a name already used by another tag is
likewise rejected.
Any authenticated API key for the company may manage tags; no additional settings permission is required.
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?stringID of the tag to update. When present, the tag with this ID is renamed and the response is 200. When omitted, a new tag is created and the response is 201. A non-existent ID returns 404.
name*stringThe tag's display name. Required. Up to 255 characters. Must be unique within the company, case-insensitively. Allowed characters are letters, digits, spaces, underscores, and ~#-$/|%&'(). — other symbols and emoji are rejected — and it may not contain two colons (::) in a row. On update, the value fully replaces the previous name.
The updated tag
*/*- response
A single tag envelope
data?A tag
curl -X POST 'https://app.distru.com/public/v1/tags' \ -H 'Content-Type: application/json' \ -d '{ "name": "Top Shelf"}'{ "data": { "id": "string", "name": "string" }}