Skip to content

Tags ​

Part of the Inventory API. Base URL https://your-domain.com/admin/api/v1 — replace the host with your own installation and the token placeholder with a real Bearer token (see Authentication).

List tags ​

GET /admin/api/v1/inventories/tags

Retrieve a paginated list of tags with filtering and sorting

🔒 Requires a valid Bearer token.

Query parameters

ParameterTypeRequiredDescriptionExample
includestringNoComma-separated list of relationships to include. Available options: creatorcreator
filter[id]stringNoComma-separated list of IDs to filter byarchitecto
filter[name]stringNoFilter by tag nameFragile
filter[color]stringNoFilter by color#f97316
sortstringNoSort field-created_at
bash
curl -X GET "https://your-domain.com/admin/api/v1/inventories/tags?include=creator&filter%5Bid%5D=architecto&filter%5Bname%5D=Fragile&filter%5Bcolor%5D=%23f97316&sort=-created_at" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/tags?include=creator&filter%5Bid%5D=architecto&filter%5Bname%5D=Fragile&filter%5Bcolor%5D=%23f97316&sort=-created_at", {
  method: "GET",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
});

const data = await response.json();
console.log(data);
php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/inventories/tags?include=creator&filter%5Bid%5D=architecto&filter%5Bname%5D=Fragile&filter%5Bcolor%5D=%23f97316&sort=-created_at', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/tags?include=creator&filter%5Bid%5D=architecto&filter%5Bname%5D=Fragile&filter%5Bcolor%5D=%23f97316&sort=-created_at"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

response = requests.get(url, headers=headers)

data = response.json()
print(data)

Example response 200

json
{
  "data": [
    {
      "id": null,
      "name": "eius et",
      "color": null,
      "sort": 0,
      "created_at": null,
      "updated_at": null,
      "deleted_at": null
    },
    {
      "id": null,
      "name": "animi quos",
      "color": null,
      "sort": 0,
      "created_at": null,
      "updated_at": null,
      "deleted_at": null
    }
  ],
  "links": {
    "first": "/?page=1",
    "last": "/?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "page": null,
        "active": false
      },
      {
        "url": "/?page=1",
        "label": "1",
        "page": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "page": null,
        "active": false
      }
    ],
    "path": "/",
    "per_page": 10,
    "to": 2,
    "total": 2
  }
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Create tag ​

POST /admin/api/v1/inventories/tags

Create a new tag

🔒 Requires a valid Bearer token.

Body parameters

ParameterTypeRequiredDescription
namestringYesTag name. Must not be greater than 255 characters.
colorstringNoTag color. Must not be greater than 255 characters.
bash
curl -X POST "https://your-domain.com/admin/api/v1/inventories/tags" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Fragile",
  "color": "#f97316"
}'
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/tags", {
  method: "POST",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "name": "Fragile",
  "color": "#f97316"
}),
});

const data = await response.json();
console.log(data);
php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://your-domain.com/admin/api/v1/inventories/tags', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
    'json' => [
    'name' => 'Fragile',
    'color' => '#f97316',
  ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/tags"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

payload = {
    "name": "Fragile",
    "color": "#f97316",
}

response = requests.post(url, headers=headers, json=payload)

data = response.json()
print(data)

Example response 201

json
{
  "data": {
    "id": null,
    "name": "architecto eius",
    "color": null,
    "sort": 0,
    "created_at": null,
    "updated_at": null,
    "deleted_at": null
  },
  "message": "Tag created successfully."
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Show tag ​

GET /admin/api/v1/inventories/tags/{id}

Retrieve a specific tag by ID

🔒 Requires a valid Bearer token.

Path parameters

ParameterTypeRequiredDescription
idintegerYesThe tag ID

Query parameters

ParameterTypeRequiredDescriptionExample
includestringNoComma-separated list of relationships to include. Available options: creatorcreator
bash
curl -X GET "https://your-domain.com/admin/api/v1/inventories/tags/{id}?include=creator" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/tags/{id}?include=creator", {
  method: "GET",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
});

const data = await response.json();
console.log(data);
php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://your-domain.com/admin/api/v1/inventories/tags/{id}?include=creator', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/tags/{id}?include=creator"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

response = requests.get(url, headers=headers)

data = response.json()
print(data)

Example response 200

json
{
  "data": {
    "id": null,
    "name": "aut adipisci",
    "color": null,
    "sort": 0,
    "created_at": null,
    "updated_at": null,
    "deleted_at": null
  }
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Update tag ​

PUT /admin/api/v1/inventories/tags/{id}

Update an existing tag

🔒 Requires a valid Bearer token.

Path parameters

ParameterTypeRequiredDescription
idintegerYesThe tag ID

Body parameters

ParameterTypeRequiredDescription
namestringNoTag name. Must not be greater than 255 characters.
colorstringNoTag color. Must not be greater than 255 characters.
bash
curl -X PUT "https://your-domain.com/admin/api/v1/inventories/tags/{id}" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Fragile",
  "color": "#f97316"
}'
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/tags/{id}", {
  method: "PUT",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "name": "Fragile",
  "color": "#f97316"
}),
});

const data = await response.json();
console.log(data);
php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://your-domain.com/admin/api/v1/inventories/tags/{id}', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
    'json' => [
    'name' => 'Fragile',
    'color' => '#f97316',
  ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/tags/{id}"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

payload = {
    "name": "Fragile",
    "color": "#f97316",
}

response = requests.put(url, headers=headers, json=payload)

data = response.json()
print(data)

Example response 200

json
{
  "data": {
    "id": null,
    "name": "architecto eius",
    "color": null,
    "sort": 0,
    "created_at": null,
    "updated_at": null,
    "deleted_at": null
  },
  "message": "Tag updated successfully."
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Delete tag ​

DELETE /admin/api/v1/inventories/tags/{id}

Soft delete a tag

🔒 Requires a valid Bearer token.

Path parameters

ParameterTypeRequiredDescription
idintegerYesThe tag ID
bash
curl -X DELETE "https://your-domain.com/admin/api/v1/inventories/tags/{id}" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/tags/{id}", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
});

const data = await response.json();
console.log(data);
php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://your-domain.com/admin/api/v1/inventories/tags/{id}', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/tags/{id}"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

response = requests.delete(url, headers=headers)

data = response.json()
print(data)

Example response 200

json
{
  "message": "Tag deleted successfully."
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Restore tag ​

POST /admin/api/v1/inventories/tags/{id}/restore

Restore a soft deleted tag

🔒 Requires a valid Bearer token.

Path parameters

ParameterTypeRequiredDescription
idintegerYesThe tag ID
bash
curl -X POST "https://your-domain.com/admin/api/v1/inventories/tags/{id}/restore" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/tags/{id}/restore", {
  method: "POST",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
});

const data = await response.json();
console.log(data);
php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://your-domain.com/admin/api/v1/inventories/tags/{id}/restore', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/tags/{id}/restore"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

response = requests.post(url, headers=headers)

data = response.json()
print(data)

Example response 200

json
{
  "data": {
    "id": null,
    "name": "aut adipisci",
    "color": null,
    "sort": 0,
    "created_at": null,
    "updated_at": null,
    "deleted_at": null
  },
  "message": "Tag restored successfully."
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Force delete tag ​

DELETE /admin/api/v1/inventories/tags/{id}/force

Permanently delete a tag

🔒 Requires a valid Bearer token.

Path parameters

ParameterTypeRequiredDescription
idintegerYesThe tag ID
bash
curl -X DELETE "https://your-domain.com/admin/api/v1/inventories/tags/{id}/force" \
  -H "Authorization: Bearer {YOUR_AUTH_TOKEN}" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json"
javascript
const response = await fetch("https://your-domain.com/admin/api/v1/inventories/tags/{id}/force", {
  method: "DELETE",
  headers: {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
  },
});

const data = await response.json();
console.log(data);
php
<?php

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://your-domain.com/admin/api/v1/inventories/tags/{id}/force', [
    'headers' => [
        'Authorization' => 'Bearer {YOUR_AUTH_TOKEN}',
        'Accept' => 'application/json',
        'Content-Type' => 'application/json',
    ],
]);

$data = json_decode($response->getBody(), true);
python
import requests

url = "https://your-domain.com/admin/api/v1/inventories/tags/{id}/force"

headers = {
    "Authorization": "Bearer {YOUR_AUTH_TOKEN}",
    "Accept": "application/json",
    "Content-Type": "application/json",
}

response = requests.delete(url, headers=headers)

data = response.json()
print(data)

Example response 200

json
{
  "message": "Tag permanently deleted successfully."
}
Error response — 401
json
{
  "message": "Unauthenticated."
}

Released under the MIT License.