Skip to main content

Tags

Tags

List Tags

  • Authentication: Optional
GET /api/v1/tags

The list of tags returned by this endpoint depends on the role of the authenticated user. Private Tags are only returned for users with either administrator or collaborator role. Tags are ordered by name.

Example

GET <baseURL>/api/v1/tags

Response

200 OK
---
[
{
"id": 8,
"name": "Under Consideration",
"slug": "under-consideration",
"color": "87BE1F",
"isPublic": true
},
{
"id": 86,
"name": "Hard",
"slug": "hard",
"color": "E60737",
"isPublic": false
}
]

Create a Tag

  • Authentication: Required
  • Required Role: Administrator
POST /api/v1/tags

Parameters

NameTypeDescription
namestringRequired. The display name of the tag. Maximum 30 characters, and it must be unique.
colorstringRequired. The Hex color of the tag, as 6 characters without #.
isPublicbooleantrue for public tags or false for private tags. Default: false

Example

POST <baseURL>/api/v1/tags
---
{
"name": "impact: big",
"color": "FE422D",
"isPublic": true
}

Response

200 OK
---
{
"id": 1003,
"name": "impact: big",
"slug": "impact-big",
"color": "FE422D",
"isPublic": true
}

Edit a Tag

  • Authentication: Required
  • Required Role: Administrator
PUT /api/v1/tags/{slug}

All properties of the tag are replaced by the values sent. The slug of the tag is generated from its name, so changing the name also changes the slug.

Parameters

NameTypeDescription
slugstringRequired. The slug of the tag to be edited.
namestringRequired. The display name of the tag. Maximum 30 characters, and it must be unique.
colorstringRequired. The Hex color of the tag, as 6 characters without #.
isPublicbooleantrue for public tags or false for private tags. Default: false

Example

PUT <baseURL>/api/v1/tags/impact-big
---
{
"name": "impact: small",
"color": "063589",
"isPublic": true
}

Response

200 OK
---
{
"id": 1003,
"name": "impact: small",
"slug": "impact-small",
"color": "063589",
"isPublic": true
}

Delete a Tag

  • Authentication: Required
  • Required Role: Administrator
DELETE /api/v1/tags/{slug}

The tag is also removed from all posts.

Parameters

NameTypeDescription
slugstringRequired. The slug of the tag to be deleted.

Example

DELETE <baseURL>/api/v1/tags/impact-small

Response

200 OK
---
{}

Tag a Post

  • Authentication: Required
  • Required Role: Collaborator or Administrator
POST /api/v1/posts/{number}/tags/{slug}

Parameters

NameTypeDescription
numbernumberRequired. The number of the post to add the tag.
slugstringRequired. The slug of the tag to be added.

Example

POST <baseURL>/api/v1/posts/47/tags/impact-big

Response

200 OK
---
{}

Untag a Post

  • Authentication: Required
  • Required Role: Collaborator or Administrator
DELETE /api/v1/posts/{number}/tags/{slug}

Parameters

NameTypeDescription
numbernumberRequired. The number of the post to remove the tag.
slugstringRequired. The slug of the tag to be removed.

Example

DELETE <baseURL>/api/v1/posts/47/tags/impact-big

Response

200 OK
---
{}