---
title: "Add a service to a place"
method: POST
path: "/places/{id}/services"
tags: ["Places", "Services"]
---

# Add a service to a place

`POST /places/{id}/services`

## Request

- Base URL: `https://api.faireplace.com/api`
- URL: `https://api.faireplace.com/api/places/{id}/services`
- Auth: HTTP bearer

Attaches a service (heating, elevator, caretaker, …) to a building.

Two ways to call it:

- **omit `service_id`**: a new service is created for this place and
  the identifier is generated server-side;
- **pass `service_id`**: that identifier is used as-is, which is what
  you want when you mirror services that already have an id in your own
  system.

A service left without a `name` is stored as `"Service par défaut"`.

**Validation**: when `is_chargeable` is `true`,
`default_distribution_key_id` is required: a chargeable service with no
distribution key could not be spread across the tenants at
regularisation time, so the call is rejected with `400` rather than
creating a service that would break the yearly charge run.

## Path parameters

- `id` string, uuid, required

## Request body

- LinkServiceToPlace: Data for adding a service to a place. **Validation rules:** - If `is_chargeable = true`, `default_distribution_key_id` is **required** - Validation is performed before persistence - If validation fails, an HTTP 400 error is returned with an explicit message
  - `service_id` string, uuid, nullable: Service ID (optional, automatically generated if not provided)
  - `name` string, nullable: Service name (e.g., Heating, Elevator)
  - `is_chargeable` boolean, nullable: Indicates whether the service can be billed as charges. **If `true`, `default_distribution_key_id` becomes required.**
  - `space_type` 'INDOOR_COMMON' | 'OUTDOOR_COMMON' | 'PRIVATE' | 'TECHNICAL' | 'GARDEN' | 'PARKING' | 'TELECOM_SERVICES': Space type for place services
  - `description` string, nullable: Detailed service description
  - `default_distribution_key_id` string, uuid, nullable: Default distribution key for billing. **Required if `is_chargeable = true`**. Automatically used when creating a charge if `distribution_key_id` is not provided.
  - `category_id` string, uuid, nullable: Charge category ID if the service is billable

## Response `201`

Service added to the place

- PlaceService
  - `id` string, uuid, nullable
  - `place_id` string, uuid, nullable
  - `service_id` string, uuid, nullable
  - `name` string, nullable
  - `description` string, nullable
  - `is_chargeable` boolean, nullable
  - `category_id` string, uuid, nullable
  - `space_type` 'INDOOR_COMMON' | 'OUTDOOR_COMMON' | 'PRIVATE' | 'TECHNICAL' | 'GARDEN' | 'PARKING' | 'TELECOM_SERVICES': Space type for place services
  - `default_distribution_key_id` string, uuid, nullable
  - `created_at` string, date-time, nullable

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/faireplace/apis/faireplace-property-management-api.md) · [All operations](https://skmtc.dev/faireplace/apis/faireplace-property-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/faireplace/apis/faireplace-property-management-api/revisions/69de39762919?raw)
