Create

POST /api/labels

Create a new label

application/json

Body Required

  • name string Required

    Minimum length is 1, maximum length is 50.

  • bgColor string Required

    Maximum length is 20.

  • resourceType string Required

    Values are user or location.

Responses

  • 201 application/json

    Successful Response

    Hide response attributes Show response attributes object
  • 422 application/json

    Validation Error

    Hide response attribute Show response attribute object
    • detail array[object]
      Hide detail attributes Show detail attributes object
POST /api/labels
curl \
 -X POST https://metropolitanabogota.org/api/labels \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"name":"string","bgColor":"string","resourceType":"user"}'
Request example
{
  "name": "string",
  "bgColor": "string",
  "resourceType": "user"
}
Response examples (201)
{
  "name": "string",
  "bgColor": "string",
  "id": "string",
  "resourceType": "string",
  "createdAt": "2024-05-04T09:42:00+00:00"
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}