If you use JSONPad for more than one app, your lists, tokens and identities for all of those apps end up side by side. Tags let you group related resources together, so you can quickly find everything that belongs to one of your apps.
Lists, items, indexes, identities and tokens can all have tags. For example, you could tag everything used by a recipe app with recipe-app, and also tag the resources it uses in production with production.
Set tags when creating or updating a resource. Setting tags replaces all of the resource's existing tags, and an empty array removes them.
curl https://api.jsonpad.io/lists \
-H "Content-Type: application/json" \
-H "x-api-token: <YOUR TOKEN>" \
-d '{ "name": "Recipes", "tags": ["recipe-app", "production"] }'Tags are included whenever the resource is returned:
{name: "Recipes"tags: [0: "recipe-app"1: "production"]}-) and underscores (_).Recipe-App is stored as recipe-app.When fetching a page of lists, items, indexes or identities, use the tagged query parameter to only fetch resources with a tag:
GET https://api.jsonpad.io/lists?tagged=recipe-appSeparate tags with commas to fetch resources that have any of the tags:
GET https://api.jsonpad.io/lists?tagged=recipe-app,cookbook-appRepeat the parameter to fetch resources that have all of the tags:
GET https://api.jsonpad.io/lists?tagged=recipe-app&tagged=productionIn the JS SDK, pass a string to match any of its comma-separated tags, or an array to match all of them:
await jsonpad.fetchLists({ tagged: ['recipe-app', 'production'] });tagged always filters by tag, so an index with the path name tagged can't be used as a filter.Identities can't set their own tags, so tags can't be set when registering an identity or when an identity updates itself. Use update an identity instead.
Tokens can only be tagged in the dashboard.
You can add and remove tags when editing a resource in the dashboard. While you type, we'll suggest tags you've already used, which helps to avoid near-duplicate tags.
Click on a tag anywhere in the dashboard to find everything with that tag. You can also search for tags in the search bar:
#recipe-app (or tag:recipe-app) finds everything tagged recipe-app.#recipe-app #production finds everything with both tags.tag:recipe-app,cookbook-app finds everything with either tag.#recipe-app type:token only finds tokens with the tag.