This guide will teach you how to use the Tags API, which you'll use to retrieve all the tags from your repository.
📦 Beta Access
The tags API is currently in the beta stage of its development cycle. If you can't access the endpoint, you can request access via the Prismic community forum.
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 tags of the repository in an array. Here an example URL of a tags API endpoint:
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 .
Was this article helpful?
Can't find what you're looking for? Get in touch with us on our Community Forum.