Tags API

This guide will teach you how to use the Tags API, which you'll use to retrieve all the tags from your repository.

What is it?

Prismic has a native document tagging system to help you organize your documents. The Tags API is a tool that allows you to hit an endpoint to retrieve all the tags of your repository.

Tags API endpoint

The tags API endpoint allows you to return all the repository’s tags in an array. Here is an example URL of a tags API endpoint:

https://your-repo-name.cdn.prismic.io/api/tags

When you hit the /api/tags endpoint, you will get an array with all the existing tags of the repository. Any tags added to published documents and documents in releases will appear in the array. Here’s a body response example:

["blue", "yellow", "red"]

Any tags added to drafts and documents in releases will also apear in the response.

If the repository is brand new and without any tags, we return a 404. Otherwise, it will be an empty array [].