Skip to content

Create a service category

Request

Creates a service category in the Location catalog. The response is the new category as listServiceCategories returns it; the Location header holds its URL.

  • Name. Leading and trailing spaces are trimmed. A name with a link (a URL or any word.word without a space) fails with 422 at /name, as in createService: Altegio would remove the link. A name that is empty after trimming, and characters outside the Basic Multilingual Plane (emoji), fail with 422 too.
  • Weight. Without weight the category gets the highest weight among the services and categories of the Location plus one, but not more than 2147483647.

The body must be a JSON object sent as application/json: another media type fails with 415 unsupported_media_type, broken JSON or a body that is not an object with 400 malformed_request.

Security
OAuth2(Required scopes: services:write) or ApiKey
Path
location_idintegerrequired

Identifier of the Location. Verified against the credential on every call — a Location the credential cannot access responds with 404.

Bodyapplication/jsonrequired
namestring, [ 1 .. 16000 ] charactersrequired

Name of the category. Leading and trailing spaces are trimmed. A link (a URL or any word.word without a space), an empty name and characters outside the Basic Multilingual Plane (emoji) fail with 422.

weightinteger, [ 0 .. 2147483647 ]

Display order (higher first). Defaults to the highest weight among the services and categories of the Location plus one, but not more than 2147483647.

curl -i -X POST \
  'https://developer.alteg.io/_mock/en/b2b-v3/openapi/locations/{location_id}/service_categories' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Haircuts",
    "weight": 10
  }'

Responses

The created service category. Location holds its URL, /api/v3/locations/{location_id}/service_categories/{id}.

Headers
RateLimit-Remaininginteger, (int32), >= 0

Requests left in the most constrained policy window that applies to this request.

RateLimit-Resetinteger, (int32), >= 0

On 429, seconds until the most constrained policy frees up; it equals Retry-After there. On a successful response it reports the length of that policy's window rather than the time left in the current one, so treat it as the window size, not as a countdown — the counter to pace against is RateLimit-Remaining.

RateLimit-Policystring

Most constrained policy applied to the request, as <limit>;w=<window in seconds>.

Example:"10;w=60"
Locationstring

URL of the created resource.

X-Request-Idstring

Request identifier for support and log correlation.

Bodyapplication/json
idintegerread-onlyrequired
objectstringread-onlyrequired
Value:"service_category"
namestringrequired
chain_idinteger or nullread-onlyrequired

Id of the chain that manages the category; null for a category of this Location alone. A chain category is not accepted by createService or updateService.

weightintegerrequired

Display order the business set in Altegio (higher first). Lists are ordered by id; sort by weight on the client.

Response
{ "id": 205, "object": "service_category", "name": "Haircuts", "chain_id": null, "weight": 10 }