A tag is the dynamic NFC identity bound to a physical item. You provision tags under an account; later, each tag is written onto a physical chip and, once in the field, scanned to produce verifications.
Fields
| Field | Type | Notes |
|---|---|---|
id |
string | tag_-prefixed, assigned by the platform. |
protocol |
string | Required at creation. The tag protocol to provision (see below). |
A tag also carries a lifecycle status that advances as the tag is manufactured:
| Status | Meaning |
|---|---|
created |
Provisioned in the platform; not yet written to a chip. |
enqueued |
Queued for writing onto physical hardware. |
configured |
Written to a chip and ready to be scanned in the field. |
A tag can only be verified once it reaches configured — before that it has no
chip behind it, so a scan against it returns 404 (see
Verifications).
The protocol attribute
protocol selects which tag protocol the chip uses. Its accepted values are
chip-specific identifiers coordinated with TAGBASE for your integration — request
the value(s) appropriate to your hardware rather than guessing. In the examples
below it’s shown as "<protocol>".
Create tags
POST /api/v1/tags
Tags are created in a batch under the account whose key you present.
Request
| Attribute | Type | Required | Notes |
|---|---|---|---|
protocol |
string | yes | The tag protocol identifier. |
count |
integer | no | How many to create. Default 1, max 500. |
{
"data": {
"type": "tags",
"attributes": {
"protocol": "<protocol>",
"count": 50
}
}
}
curl https://platform.tagbase.io/api/v1/tags \
-X POST \
-H "Authorization: Bearer $TAGBASE_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{ "data": { "type": "tags", "attributes": { "protocol": "<protocol>", "count": 50 } } }'
const res = await fetch("https://platform.tagbase.io/api/v1/tags", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TAGBASE_API_KEY}`,
"Content-Type": "application/vnd.api+json",
},
body: JSON.stringify({
data: { type: "tags", attributes: { protocol: "<protocol>", count: 50 } },
}),
});
const tags = (await res.json()).data;
$response = $client->post("https://platform.tagbase.io/api/v1/tags", [
"headers" => [
"Authorization" => "Bearer " . getenv("TAGBASE_API_KEY"),
"Content-Type" => "application/vnd.api+json",
],
"json" => [
"data" => ["type" => "tags", "attributes" => ["protocol" => "<protocol>", "count" => 50]],
],
]);
$tags = json_decode((string) $response->getBody(), true)["data"];
tags =
Req.post!("https://platform.tagbase.io/api/v1/tags",
headers: [
{"authorization", "Bearer #{System.fetch_env!("TAGBASE_API_KEY")}"},
{"content-type", "application/vnd.api+json"}
],
json: %{data: %{type: "tags", attributes: %{protocol: "<protocol>", count: 50}}}
).body["data"]
Response — 201 Created
A JSON:API array of the created tags. Each entry is a tags resource id; the
ids are what you store and later reference when verifying scans.
{
"data": [
{ "type": "tags", "id": "tag_abcdef0123456789" },
{ "type": "tags", "id": "tag_0123456789abcdef" }
]
}
Tags are returned in created status. Writing them onto physical chips happens
out of band; your integration holds the ids in the meantime.
Errors
| Status | When |
|---|---|
400 |
No data.attributes, protocol missing/not a string, or count outside 1-500. |
401 |
Missing, invalid, or revoked key. |
422 |
Validation failed — e.g. an unrecognized protocol value. |
Notes
- There is no endpoint to list or read tags after creation. Persist the returned ids when you create the batch.
- Tags belong to the account whose key created them. To keep tenants isolated, create each tenant’s tags with that tenant’s subaccount key.