Tags
As the name suggests, tags are a core part of Protocol — the very reason Protocol exists is so you can have secure conversations with your tags. On this page, we'll dive into the different tag endpoints you can use to manage tags programmatically. We'll look at how to query, create, update, and delete tags.
The tag model
The tag model contains all the information about your tags, such as their username, avatar, and phone number. It also contains a reference to the conversation between you and the tag and information about when they were last active on Protocol.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the tag.
- Name
publication_id
- Type
- number
- Description
The id of the publication.
- Name
user_id
- Type
- number
- Description
The id of the user who created the tag.
- Name
name
- Type
- string
- Description
The name of the tag.
- Name
slug
- Type
- string
- Description
The slug of the tag.
- Name
description
- Type
- string
- Description
The description of the tag.
- Name
meta_title
- Type
- string
- Description
The meta title of the tag.
- Name
meta_description
- Type
- string
- Description
The meta description of the tag.
- Name
featured
- Type
- boolean
- Description
If the tag is featured.
- Name
accent_color
- Type
- string
- Description
The accent color of the tag.
- Name
featured_image
- Type
- string
- Description
The featured image of the tag.
- Name
created_at
- Type
- timestamp
- Description
The timestamp of comment create time.
- Name
updated_at
- Type
- timestamp
- Description
The timestamp of comment update time.
List all tags
This endpoint allows you to retrieve a paginated list of all your tags. By default, a maximum of ten tags are shown per page.
Optional attributes
- Name
limit
- Type
- integer
- Description
Limit the number of tags returned.
Request
curl -G https://api.bloghunch.com/app/{subdomain}/tags \
-H "Authorization: Bearer {token}" \
-d limit=10
Response
{
"meta": {
"total": 2,
"per_page": 20,
"current_page": 1,
"last_page": 1,
"first_page": 1,
"first_page_url": "/?page=1",
"last_page_url": "/?page=1",
"next_page_url": null,
"previous_page_url": null
},
"data": [
{
"id": 61,
"user_id": 1,
"publication_id": 3696,
"featured_image": null,
"name": "test",
"slug": "test",
"description": null,
"meta_title": null,
"meta_description": null,
"featured": 0,
"accent_color": null,
"created_at": "2023-03-05T09:53:13.000Z",
"updated_at": "2023-03-05T09:53:13.000Z"
},
...
]
}