PT EN

Áreas de serviço

URL base: $BUSINESS_API

O objecto

idstring · obrigatório
tenant_idstring · obrigatório
namestring · obrigatório
statusstring · obrigatório
O objecto
{
  "id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "name": "Ana Matsinhe",
  "status": "active"
}

Listar áreas de serviço

Registos

GET /service-areas

Returns a cursor-paginated page of the tenant's service areas, the geographic zones used to group properties and reading routes. You can also pass q to match part of the name (case-insensitive), and limit and after to page. Requires business:service-areas:read.

Parâmetros

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

qstring · consulta · opcional

Resource-specific text search.

statusstring · consulta · opcional

Returns only service areas with this exact status, for example active; omit it to return all.

Devolve

200 Service areas in the authenticated utility tenant

Mostrar atributos
dataarray of ServiceArea · obrigatório
Mostrar atributos filhos
idstring · obrigatório
tenant_idstring · obrigatório
namestring · obrigatório
statusstring · obrigatório
has_moreboolean · obrigatório
next_cursorstring · opcional

Erros 400 · 403

Permissões business:service-areas:read · Funções: admin, analyst, billing_clerk, customer_service, field_reader, field_supervisor, finance, operations, owner, viewer

curl -X GET "$BUSINESS_API/service-areas" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "name": "Ana Matsinhe",
      "status": "active"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Criar uma área de serviço

Registos

POST /service-areas

Creates a service area in the caller's tenant with the given name and returns it with status active. The name is trimmed and must not be empty (400 otherwise). Properties and reading routes can then reference the area by its ID. Requires business:service-areas:create.

Corpo application/json

namestring · obrigatório

Devolve

201 Service area created

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
namestring · obrigatório
statusstring · obrigatório

Erros 400 · 403

Permissões business:service-areas:create · Funções: admin, owner

curl -X POST "$BUSINESS_API/service-areas" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ana Matsinhe"
}'
Resposta 201
{
  "id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "name": "Ana Matsinhe",
  "status": "active"
}