Currently we have 4 methods for labels api:

Index
Create
Update
Destroy

Index
This method will list labels from your current project, paginating by 5 labels per page.

Request
curl --request GET \
  --url https://changelogfy.com/api/v1/labels \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer ${TOKEN}' \
  --header 'Content-Type: application/json' \
  --header "x-project-token: ${YOUR_APP_ID}"


Response
{
  "current_page": 1,
  "data": [
    {
      "id": 1,
      "name": "Improvement",
      "color": "#7300FF",
      "order": 1,
      "project_id": 1,
      "created_at": "2021-11-13T01:09:26.000000Z",
      "updated_at": "2021-11-13T01:09:26.000000Z",
      "deleted_at": null,
      "primary_color": "rgba(115,0,255,1.00)",
      "secondary_color": "rgba(115,0,255,0.12)"
    },
    {
      "id": 2,
      "name": "Fix",
      "color": "#FF1197",
      "order": 2,
      "project_id": 1,
      "created_at": "2021-11-13T01:09:26.000000Z",
      "updated_at": "2021-11-13T01:09:26.000000Z",
      "deleted_at": null,
      "primary_color": "rgba(255,17,151,1.00)",
      "secondary_color": "rgba(255,17,151,0.12)"
    }
  ],
  "first_page_url": "https://changelogfy.com/api/v1/labels?page=1",
  "from": 1,
  "last_page": 1,
  "last_page_url": "https://changelogfy.com/api/v1/labels?page=1",
  "links": [
    {
      "url": null,
      "label": "« Previous",
      "active": false
    },
    {
      "url": "https://changelogfy.com/api/v1/labels?page=1",
      "label": "1",
      "active": true
    },
    {
      "url": null,
      "label": "Next »",
      "active": false
    }
  ],
  "next_page_url": null,
  "path": "https://changelogfy.com/api/v1/labels",
  "per_page": 5,
  "prev_page_url": null,
  "to": 2,
  "total": 2
}


Store
This method will create a new label for your current project.

Request
curl --request POST \
  --url https://changelogfy.com/api/v1/labels \
  --header 'Accept: application/json' \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Content-Type: application/json' \
  --header "x-project-token: ${YOUR_APP_ID}"
  --data '{
        "name": "Fix",
        "color": "#cccccc"
    }'


Response
{
  "status": "success",
  "message": "Label created successful."
}


Update
This method will update a label in your current project.

Request
curl --request PUT \
  --url https://changelogfy.com/api/v1/labels/{POST_ID} \
  --header 'Accept: application/json' \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Content-Type: application/json' \
  --header "x-project-token: ${YOUR_APP_ID}"
  --data '{
        "name": "Improvement",
        "color": "#7300FF"
    }'


Response
{
  "status": "success",
  "message": "Label updated successful."
}


Destroy
This method will destroy a label in your current project.

Request
curl --request DELETE \
  --url https://changelogfy.com/api/v1/labels/{POST_ID} \
  --header 'Accept: application/json' \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Content-Type: application/json' \
  --header "x-project-token: ${YOUR_APP_ID}"


Response
{
  "status": "success",
  "message": "Label deleted successful."
}

If you still have questions, please contact us by chat.
Was this article helpful?
Cancel
Thank you!