Resource

Label

Organize resources for your project by using labels / tags.

The Label Model

Properties

  • Name
    _id
    Type
    Object ID
    Description

    ID of this object

  • Name
    createdAt
    Type
    Date
    Description

    Date and Time when the object was created.

  • Name
    updatedAt
    Type
    Date
    Description

    Date and Time when the object was updated.

  • Name
    name
    Type
    TextRequired
    Description

    Any friendly name of this object

  • Name
    project
    Type
    Project
    Description

    Relation to Project Resource in which this object belongs

  • Name
    projectId
    Type
    Object IDRequired
    Description

    ID of your Project in which this object belongs

  • Name
    slug
    Type
    SlugRequired
    Description

    Friendly globally unique name for your object

  • Name
    description
    Type
    Long Text
    Description

    Friendly description that will help you remember

  • Name
    createdByUser
    Type
    User
    Description

    Relation to User who created this object (if this object was created by a User)

  • Name
    createdByUserId
    Type
    Object ID
    Description

    User ID who created this object (if this object was created by a User)

  • Name
    color
    Type
    ColorRequired
    Description

    Color of this resource in Hex (#32a852 for example)

GETorPOST/api/label/get-list

List

This endpoint allows you to retrieve a paginated list of all your Label. By default, a maximum of ten Label are shown per page.

Optional Query Params

  • limit
    number
    Number of objects to fetch. By default 10, you can increase this count up to 100
  • skip
    number
    Number of objects to skip. This can be useful in pagination

Optional Request Body

List Request

POST
/api/label/get-list?skip=0&limit=10
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "select": {
    "color": true,
    "name": true,
    "projectId": true,
    "createdByUserId": true,
    "description": true
  },
  "query": {
    "name": "Production"
  },
  "sort": {
    "createdAt": -1
  }
}

Response

{
  "count": 10,
  "limit": 10,
  "skip": 0,
  "data": [
    {
      "_id": "377402b3-28fe-11f1-b591-3fdcef396aba",
      "color": "#32a852",
      "name": "Production",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "Label for all production environment resources and monitors"
    },
    {
      "_id": "377402b4-28fe-11f1-b591-3fdcef396aba",
      "color": "#32a852",
      "name": "Production",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "Label for all production environment resources and monitors"
    },
    {
      "_id": "377402b5-28fe-11f1-b591-3fdcef396aba",
      "color": "#32a852",
      "name": "Production",
      "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
      "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "description": "Label for all production environment resources and monitors"
    }
  ]
}
GETorPOST/api/label/:id/get-item

Get item by ID

This endpoint allows you to retrieve Label by ID.

  • id
    text
    ID of the Object

Optional Request Body

Get Item Request

POST
/api/label/:id/get-item
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "select": {
    "color": true,
    "name": true,
    "projectId": true,
    "createdByUserId": true,
    "description": true
  }
}

Response

{
  "_id": "377402b3-28fe-11f1-b591-3fdcef396aba",
  "color": "#32a852",
  "name": "Production",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "description": "Label for all production environment resources and monitors"
}
POST/api/label/count

Count

This endpoint allows you to retrieve the count of all your Label.

Optional Request Body

Count Request

POST
/api/label/count
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "query": {
    "name": "Production"
  }
}

Response

{
  "count": 107
}
POST/api/label

Create Label

This endpoint allows you to create a new object.

Create Request

POST
/api/label
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "data": {
    "color": "#32a852",
    "name": "Production",
    "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
    "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "description": "Label for all production environment resources and monitors"
  }
}

Response

{
  "_id": "377402b3-28fe-11f1-b591-3fdcef396aba",
  "color": "#32a852",
  "name": "Production",
  "projectId": "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
  "createdByUserId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "description": "Label for all production environment resources and monitors"
}
PUT/api/label/:id

Update by ID

This endpoint allows you to update object by its ID.

Alternative Methods

For clients that do not support PUT requests, you can use POST or GET with the same request headers and body:

POST/api/label/:id/update-item
GET/api/label/:id/update-item

Update Request

PUT
/api/label/:id
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY
Body
{
  "data": {
    "color": "#32a852",
    "name": "Production",
    "description": "Label for all production environment resources and monitors"
  }
}

Response

{}
DELETE/api/label/:id

Delete by ID

This endpoint allows you to delete object by its ID.

Alternative Methods

For clients that do not support DELETE requests, you can use POST or GET with the same request headers and body:

POST/api/label/:id/delete-item
GET/api/label/:id/delete-item

Delete Request

DELETE
/api/label/:id
Headers
Content-Type: application/json
ApiKey: YOUR_API_KEY

Response

{}

Permissions

Your API Token needs permissions to create, update, read or delete this resource. If you do not have permissions to make a request a 4xx status will be sent as response.

Read Permissions

Required to read Label

  • Project Owner
  • Project Admin
  • Project Member
  • Read Label
  • Read All Project Resources

Create Permissions

Required to create Label

  • Project Owner
  • Project Admin
  • Create Label

Update Permissions

Required to update Label

  • Project Owner
  • Project Admin
  • Edit Label

Delete Permissions

Required to delete Label

  • Project Owner
  • Project Admin
  • Delete Label