# Entities

Your own records, such as partners or suppliers.


An entity is a kind of record your team keeps in TAGBASE, such as a partner
or a supplier. You decide which fields a record has, the same way you build a
[category](/docs/dashboard/categories). Each entity gets
its own page under **[Entities](/dashboard/entities)** in the sidebar, with a
table of its records.

## Create an entity

Open **[Entities](/dashboard/entities/new)** and choose **Create Entity**.
Give it a singular name, such as Partner. TAGBASE writes the plural for the
sidebar and page titles, so Pharmacy becomes Pharmacies.

Add fields with the editor you know from categories, or start from the
Partner, Clinic or Supplier preset and add to it. The name also sets the
entity's address, for example `/dashboard/entities/partners`. Renaming the
entity later keeps that address.

## Fields

Entities take every field type a category offers:

- **Text** and **Multiline Text**: free text, up to 1,000 and 10,000
  characters.
- **Email**, **Phone**, and **URL**: TAGBASE checks the value when you save. A
  URL must start with `https://` or `http://`.
- **Number**: optionally between a minimum and a maximum.
- **Date**, **Checkbox**, **Select**, and **Country**.

Two settings only make sense for records:

- **Unique**: no two records may share a value in this field. Use it for a
  code your ERP matches records on.
- **Public**: the value shows on the verification page of a linked tag, and
  the verification API returns it. Fields are internal until you mark them
  public.

## Records

Open an entity in the sidebar to see its records. Each record goes by its
first text field in tables, forms and the agent's answers; reorder the fields
to change which one. Click a record's ID to edit it, and copy the ID from the
dialog. Search by any value, or paste an ID. To delete several records at
once, tick their checkboxes.

To remove every record, choose Delete all partners… in the menu next to Create.
The label uses the plural name, for example Delete all clinics….
TAGBASE deletes those records and the tag links on them. The entity stays,
with its fields and the category fields that point at it.

To delete the entity itself, choose Delete Entity… in the same menu.
TAGBASE deletes all its records and removes its fields from your categories.

## Link records to tags

Add an entity to a [category](/docs/dashboard/categories) from the
Entities part of the Add Field menu. When you create a product with that
category, pick a record, for example the partner that sells it, and every tag
of the product links to it. Editing a tag lets you move it to another record.

A tag links to the record itself and keeps no copy of it. When you edit the
partner, every linked tag shows the change. Deleting the record unlinks its
tags.

The record's fields work as placeholders in the product's title and
description, for example `{{partner.name}}`. The tags API shows the whole
record in the tag's data, under the entity's key:

```json
{"batch": "B-7", "partner": {"id": "ent_...", "name": "Brenner Pharma", "country": "US"}}
```

A verification shows only the record's public fields, without its ID. A
record with no public field does not appear there at all.

## Import and export

**Export** downloads the records as a UTF-8 CSV file: the ID first, then one
column per field, headed by the field's label.

**Import** reads that file back, or any CSV with a header row. The header
lists every field by its label, in the entity's order, and may start with an
ID column. Download Example in the import dialog gives you a file with the
right header and one example row. A row with an ID, or with a value a Unique
field already holds, updates that record. Every other row creates one. Countries may be
written as names or two-letter codes, and checkboxes as yes or no.

An import saves every row or none. When a row does not fit, nothing changes
and the dialog lists the rows to fix, counting the header as row 1.

## Ask the agent

Tell the TAGBASE Agent what you need, for example "Keep track of our
distributors: company, contact email, country, and a distributor code no two
may share." It proposes the fields, marks the code unique so an import can
match a row, and shows a button to create the entity. It can also fill in
records and rename fields. Before it deletes an entity or a record, it shows
a button and waits.

## Who sees entities

Records stay inside your team. Mark a field public when a customer should see it.
A customer then sees that field on the verification page, and the verification API returns it.

