Documentation

Tags

How to list, create, get, update and delete tags

Request Overview

Actions

Returns

Description

GET /api/v1/tags

Collection

Get all tags

POST /api/v1/tags

201 Object

Create tag

GET /api/v1/tags/{id}

200 Object

Get a tag

PATCH /api/v1/tags/{id}

200 Object

Update a tag

DELETE /api/v1/tags/{id}

200

Delete a tag

Fields

Tag Object

Field

Type

Required

Specifics

name

String

yes

Some name

slug

String

Auto slug of name

color

String

Must be a valid hex. #ffffff

type

String

tickets, docs, all

Requests

Get All Tags

GET /api/v1/tags Returns, a collection of tags

GET /api/v1/tags HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8

200 Response

HTTP/1.1 200 OK
Content-Type: application/json
...

{
  "data": [
    {
      "id": 1,
      "name": "Question",
      "slug": "question",
      "color": "#1477EA",
      "type": "tickets"
    },
    {
      "id": 2,
      "name": "Bug",
      "slug": "bug",
      "color": "#EE4E4E",
      "type": "docs"
    },
    ...
  ],
  "links": {
    ...
  },
  "meta": {
    ...
  }
}
Information about links and meta please read this article.

Create Tags

POST /api/v1/tags Creates a new tag

POST /api/v1/tags HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8

 {
  "name": "Question",
  "slug": "question",
  "color": "#1477EA",
  "type": "tickets"
},

201 Response

HTTP/1.1 201 OK
Content-Type: application/json
...

{
  "data": {
    // Object like in get tag request
  }
}

Get Tag

GET /api/v1/tags/{id} Returns the tag object

GET /api/v1/tags/{{id}} HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8

200 Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Encoding: gzip
...

{
  "data": {
      "id": 1,
      "name": "Question",
      "slug": "question",
      "color": "#1477EA",
      "type": "tickets"
    },
}

Update Tag

PATCH /api/v1/tags/{id} Returns the tag object

PATCH /api/v1/tags/{{id}} HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8

{
  "name": "Question-2",
  "color": "#EE4E4E",
  "type": "all"
},

200 Response

HTTP/1.1 200 OK
Content-Type: application/json
...

{
  "data": {
    // Object like in get tag request
  }
}

Delete Tag

DELETE /api/v1/tags/{id} Deletes an existing tag.

DELETE /api/v1/tags/{{id}} HTTP/1.1
Authorization: Bearer {{token}}
Hs-Client-Id: {{hs_client_id}}
Host: api.helpspace.com
Content-Type: application/json; charset=utf-8

200 Response

HTTP/1.1 200 OK

{
  "message": "Object deleted permanently."
}