Skip to main content
POST
/
barbers
/
{barberId}
/
services
Assign services to a barber
curl --request POST \
  --url https://api.guile.app/barbers/{barberId}/services \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "services": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "name": "<string>",
      "cost": "456.78",
      "duration": "<string>"
    }
  ]
}
'
{
  "successCount": 3,
  "failureCount": 1,
  "successes": [
    {
      "id": "service-123",
      "name": "Beard Trim"
    }
  ],
  "assigned": [
    {
      "id": "barber-service-123",
      "service": {
        "id": "service-456",
        "name": "Skin Fade"
      }
    }
  ],
  "failures": [
    {
      "type": "https://docs.guile.app/problems/serviceAlreadyAssigned",
      "title": "Service already assigned",
      "occurredAt": "2024-01-15T10:30:00Z",
      "attributes": {
        "service": {
          "id": "service-369",
          "name": "Skin Fade"
        }
      }
    }
  ]
}

Path Parameters

barberId
string<uuid>
required

The unique, opaque system identifier for a resource. This case-sensitive ID is also used as path parameters in URLs or in other properties or parameters that reference a resource by ID rather than URL.

Body

application/json

Properties for assigning services to a barber.

services
object[]
required

The services to assign to the barber.

Required array length: 1 - 25 elements

Response

Ok. The operation succeeded.

Result of assigning services to a barber.

successCount
integer<int32>
required

The number of services successfully assigned.

Example:

3

failureCount
integer<int32>
required

The number of services that failed to be assigned.

Example:

1

successes
object[]
required

The services that were successfully assigned.

Maximum array length: 25
Example:
[
{ "id": "service-123", "name": "Beard Trim" }
]
assigned
object[]
required

The barber service assignments that were created.

Maximum array length: 25
Example:
[
{
"id": "barber-service-123",
"service": { "id": "service-456", "name": "Skin Fade" }
}
]
failures
object[]
required

Details of services that failed to be assigned.

Maximum array length: 25
Example:
[
{
"type": "https://docs.guile.app/problems/serviceAlreadyAssigned",
"title": "Service already assigned",
"occurredAt": "2024-01-15T10:30:00Z",
"attributes": {
"service": { "id": "service-369", "name": "Skin Fade" }
}
}
]