Skip to main content

Labels

Create a label​

POST /labels

Code samples


curl -X POST https://localhost:9543/api-portal/api/v0.9/labels \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Creates a label for the organization.

Payload

{
"id": "premium",
"displayName": "Premium APIs"
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:label:create`, `dp:label:manage`

Parameters​

NameInTypeRequiredDescription
bodybodyLabelRequesttrueLabel payload.

Example responses

201 Response

{
"id": "premium",
"displayName": "Premium APIs"
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

409 Response

{
"status": "error",
"code": "CONFLICT",
"message": "Conflict"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
201CreatedThe created label.LabelResponse
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
409ConflictThe request conflicts with an existing resource.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Enumerated Values​

PropertyValue
statuserror

Response Headers​

StatusHeaderTypeFormatDescription
201LocationstringuriURL of the created label.

List labels​

GET /labels

Code samples


curl -X GET https://localhost:9543/api-portal/api/v0.9/labels \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Returns all labels configured for the organization.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:label:read`, `dp:label:manage`

Parameters​

NameInTypeRequiredDescription
limitqueryintegerfalseMaximum number of records to return.
offsetqueryintegerfalseNumber of records to skip before returning results.

Example responses

200 Response

{
"list": [
{
"id": "premium",
"displayName": "Premium APIs"
}
],
"count": 1,
"pagination": {
"total": 42,
"limit": 20,
"offset": 0
}
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKPaginated list of label DTOs.Inline
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Status Code 200

NameTypeRequiredRestrictionsDescription
» list[LabelResponse]falsenonenone
»» idstringfalsenoneThe label's handle (unique per org). Not the internal database uuid.
»» displayNamestringfalsenonenone
» countintegerfalsenoneNumber of items returned in this page.
» paginationPaginationfalsenoneStandard pagination metadata returned with collection responses.
»» totalintegertruenoneTotal number of records matching the query.
»» limitintegertruenoneMaximum number of records returned in this response.
»» offsetintegertruenoneNumber of records skipped before this page.

Enumerated Values​

PropertyValue
statuserror

Get a label​

GET /labels/{labelId}

Code samples


curl -X GET https://localhost:9543/api-portal/api/v0.9/labels/{labelId} \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Retrieves a single label by handle.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:label:read`, `dp:label:manage`

Parameters​

NameInTypeRequiredDescription
labelIdpathstringtrueThe label's handle (its id in request/response payloads), not the internal database uuid.

Example responses

200 Response

{
"id": "premium",
"displayName": "Premium APIs"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKLabel DTO.LabelResponse
404Not FoundResource not found.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Update a label​

PUT /labels/{labelId}

Code samples


curl -X PUT https://localhost:9543/api-portal/api/v0.9/labels/{labelId} \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d @payload.json

Updates an existing label by handle.

Payload

{
"id": "premium",
"displayName": "Premium APIs"
}

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:label:update`, `dp:label:manage`

Parameters​

NameInTypeRequiredDescription
labelIdpathstringtrueThe label's handle (its id in request/response payloads), not the internal database uuid.
bodybodyLabelRequesttrueLabel payload.

Example responses

200 Response

{
"id": "premium",
"displayName": "Premium APIs"
}

Bad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.

{
"status": "error",
"code": "MISSING_REQUIRED_PARAMETER",
"message": "Missing required parameter."
}
{
"message": "Missing or invalid fields in the request payload"
}

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

409 Response

{
"status": "error",
"code": "CONFLICT",
"message": "Conflict"
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
200OKLabel DTO.LabelResponse
400Bad RequestBad request. Validation and other bad-request errors are returned as a standard error object (field-level details, when present, are carried in its errors array); some legacy handlers return a message-only object.Inline
404Not FoundResource not found.ErrorResponse
409ConflictThe request conflicts with an existing resource.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Response schema​

Enumerated Values​

PropertyValue
statuserror

Delete a label​

DELETE /labels/{labelId}

Code samples


curl -X DELETE https://localhost:9543/api-portal/api/v0.9/labels/{labelId} \
-H 'Authorization: Bearer {access_token}' \
-H 'Accept: application/json'

Deletes a label by handle.

Authentication​

This operation requires a Bearer JWT access token in the Authorization header. Required scopes (the token must carry at least one of): `dp:label:delete`, `dp:label:manage`

Parameters​

NameInTypeRequiredDescription
labelIdpathstringtrueThe label's handle (its id in request/response payloads), not the internal database uuid.

Example responses

404 Response

{
"status": "error",
"code": "ORG_NOT_FOUND",
"message": "Organization not found."
}

500 Response

{
"status": "error",
"code": "INTERNAL_SERVER_ERROR",
"message": "An unexpected error occurred."
}

Responses​

StatusMeaningDescriptionSchema
204No ContentLabel deleted successfully.None
404Not FoundResource not found.ErrorResponse
500Internal Server ErrorInternal server error.ErrorResponse

Was this page helpful?