APITag

Upsert a tag

POST
/public/v1/tags

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.

Authorization

Bearer
headerAuthorizationBearer <token>

API token generated in Distru (Settings → Distru API). Send it on every request as Authorization: Bearer YOUR_API_TOKEN.

Request Body

application/json
  1. body
id?string

ID 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*string

The 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.

Response Body

The updated tag

*/*
  1. response

A single tag envelope

data?

A tag

Example Request
curl -X POST 'https://app.distru.com/public/v1/tags' \  -H 'Content-Type: application/json' \  -d '{  "name": "Top Shelf"}'
Example Response
{  "data": {    "id": "string",    "name": "string"  }}