Open App

Labels

API endpoints for labels

List labels

GET /api/v1/labels

Parameters

NameInTypeRequiredDescription
organizationIdquerystringNoOrganization scope id. Omit for token default; pass an empty value for personal scope where supported.
limitqueryintegerNoMaximum number of items to return.
offsetqueryintegerNoNumber of items to skip.

Example request

curl -X GET \
"https://api.getpilfer.com/api/v1/labels?organizationId=<organizationId>&limit=<limit>&offset=<offset>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": [
    {
      "_id": "string",
      "name": "string",
      "colour": "string"
    }
  ]
}

Other statuses: 401, 403.

Response body type

{ data: Label[] }


Create label

POST /api/v1/labels

Example request

curl -X POST \
"https://api.getpilfer.com/api/v1/labels" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"name":"string","organizationId":"string","colour":"string"}'

Example response

Status: 201

{
  "data": {
    "_id": "string",
    "name": "string",
    "colour": "string"
  }
}

Other statuses: 400, 401, 403.

Response body type

{ data: Label }


Get label

GET /api/v1/labels/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesConvex document id

Example request

curl -X GET \
"https://api.getpilfer.com/api/v1/labels/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": {
    "_id": "string",
    "name": "string",
    "colour": "string"
  }
}

Other statuses: 401, 403, 404.

Response body type

{ data: Label }


Update label

PATCH /api/v1/labels/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesConvex document id

Example request

curl -X PATCH \
"https://api.getpilfer.com/api/v1/labels/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"
-d '{"name":"string","colour":"string"}'

Example response

Status: 200

{
  "data": {
    "_id": "string",
    "name": "string",
    "colour": "string"
  }
}

Other statuses: 400, 401, 403, 404.

Response body type

{ data: Label }


Delete label

DELETE /api/v1/labels/{id}

Parameters

NameInTypeRequiredDescription
idpathstringYesConvex document id

Example request

curl -X DELETE \
"https://api.getpilfer.com/api/v1/labels/<id>" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json"

Example response

Status: 200

{
  "data": {}
}

Other statuses: 401, 403, 404.

Response body type

{ data: DeleteResult }