PT EN

Interrupções

URL base: $BUSINESS_API

O objecto

idstring · obrigatório
tenant_idstring · obrigatório
titlestring · obrigatório
interruption_typestring · obrigatório

um de maintenance, emergency, rationing

statusstring · obrigatório

um de planned, active, completed, cancelled

service_area_idstring · obrigatório
dma_idstring · opcional
descriptionstring · opcional
start_timestring (date-time) · obrigatório
end_timestring (date-time) · obrigatório
affected_customers_estinteger · opcional
created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório
O objecto
{
  "id": "sup_2xVSEXVGkjH84PdmebPICxjIkZH",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "title": "Fuga na Rua 3",
  "interruption_type": "maintenance",
  "status": "planned",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "description": "Leitura confirmada no local.",
  "start_time": "2026-11-19T09:30:00Z",
  "end_time": "2026-11-19T09:30:00Z",
  "affected_customers_est": 1,
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Listar interrupções

Registos

GET /interruptions

Returns the tenant's planned and unplanned supply interruptions with type, status, service area, DMA, start and end times and estimated affected customers. Results are cursor-paginated (default 20, maximum 100); the handler also accepts service_area_id and status filters. Customers in an affected service area see open interruptions through the consumer API. Requires the interruptions:read permission.

Parâmetros

limitinteger · consulta · opcional

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

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Supply interruptions

Mostrar atributos
dataarray of SupplyInterruption · obrigatório
Mostrar atributos filhos
idstring · obrigatório
tenant_idstring · obrigatório
titlestring · obrigatório
interruption_typestring · obrigatório

um de maintenance, emergency, rationing

statusstring · obrigatório

um de planned, active, completed, cancelled

service_area_idstring · obrigatório
dma_idstring · opcional
descriptionstring · opcional
start_timestring (date-time) · obrigatório
end_timestring (date-time) · obrigatório
affected_customers_estinteger · opcional
created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório
has_moreboolean · opcional
next_cursorstring · opcional

Erros 403

Permissões interruptions:read · Funções: admin, analyst, customer_service, field_reader, field_supervisor, operations, owner, viewer

curl -X GET "$BUSINESS_API/interruptions" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "sup_2xVSEXVGkjH84PdmebPICxjIkZH",
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "title": "Fuga na Rua 3",
      "interruption_type": "maintenance",
      "status": "planned",
      "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
      "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
      "description": "Leitura confirmada no local.",
      "start_time": "2026-11-19T09:30:00Z",
      "end_time": "2026-11-19T09:30:00Z",
      "affected_customers_est": 1,
      "created_at": "2026-11-19T09:30:00Z",
      "updated_at": "2026-11-19T09:30:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Agendar uma interrupção

Registos

POST /interruptions

Creates a supply interruption with status planned and returns it with 201. title and service_area_id are required (400 otherwise); interruption_type defaults to maintenance (other values: emergency, rationing), and DMA, description, start and end times and an affected-customer estimate are optional. Open interruptions in an area become visible to that area's customers. Requires the operations:write permission.

Corpo application/json

titlestring · obrigatório
interruption_typestring · opcional

um de maintenance, emergency, rationing

service_area_idstring · obrigatório
dma_idstring · opcional
descriptionstring · opcional
start_timestring (date-time) · opcional
end_timestring (date-time) · opcional
affected_customers_estinteger · opcional

Devolve

201 Supply interruption scheduled

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
titlestring · obrigatório
interruption_typestring · obrigatório

um de maintenance, emergency, rationing

statusstring · obrigatório

um de planned, active, completed, cancelled

service_area_idstring · obrigatório
dma_idstring · opcional
descriptionstring · opcional
start_timestring (date-time) · obrigatório
end_timestring (date-time) · obrigatório
affected_customers_estinteger · opcional
created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Erros 400 · 403

Permissões operations:write · Funções: admin, field_supervisor, operations, owner

curl -X POST "$BUSINESS_API/interruptions" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Fuga na Rua 3",
  "interruption_type": "maintenance",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "description": "Leitura confirmada no local.",
  "start_time": "2026-11-19T09:30:00Z",
  "end_time": "2026-11-19T09:30:00Z",
  "affected_customers_est": 1
}'
Resposta 201
{
  "id": "sup_2xVSEXVGkjH84PdmebPICxjIkZH",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "title": "Fuga na Rua 3",
  "interruption_type": "maintenance",
  "status": "planned",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "description": "Leitura confirmada no local.",
  "start_time": "2026-11-19T09:30:00Z",
  "end_time": "2026-11-19T09:30:00Z",
  "affected_customers_est": 1,
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Obter uma interrupção

Registos

GET /interruptions/{id}

Returns one supply interruption with its type, status, service area, DMA, schedule and estimated affected customers. Returns 404 when it is not in the tenant. Requires the interruptions:read permission.

Parâmetros

idstring · caminho · obrigatório

Identifier of the interruption (an out_ prefixed ID) within the current tenant.

Devolve

200 Interruption details

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
titlestring · obrigatório
interruption_typestring · obrigatório

um de maintenance, emergency, rationing

statusstring · obrigatório

um de planned, active, completed, cancelled

service_area_idstring · obrigatório
dma_idstring · opcional
descriptionstring · opcional
start_timestring (date-time) · obrigatório
end_timestring (date-time) · obrigatório
affected_customers_estinteger · opcional
created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Erros 403 · 404

Permissões interruptions:read · Funções: admin, analyst, customer_service, field_reader, field_supervisor, operations, owner, viewer

curl -X GET "$BUSINESS_API/interruptions/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "sup_2xVSEXVGkjH84PdmebPICxjIkZH",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "title": "Fuga na Rua 3",
  "interruption_type": "maintenance",
  "status": "planned",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "description": "Leitura confirmada no local.",
  "start_time": "2026-11-19T09:30:00Z",
  "end_time": "2026-11-19T09:30:00Z",
  "affected_customers_est": 1,
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Concluir uma interrupção

Registos

POST /interruptions/{id}/complete

Sets the interruption's status to completed and returns it, so it is no longer shown to customers as open. The current status is not checked, so a cancelled or already completed interruption is also set to completed. Returns 404 for an unknown interruption. Requires the operations:write permission.

Parâmetros

idstring · caminho · obrigatório

Identifier of the interruption to complete within the current tenant.

Devolve

200 Interruption completed

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
titlestring · obrigatório
interruption_typestring · obrigatório

um de maintenance, emergency, rationing

statusstring · obrigatório

um de planned, active, completed, cancelled

service_area_idstring · obrigatório
dma_idstring · opcional
descriptionstring · opcional
start_timestring (date-time) · obrigatório
end_timestring (date-time) · obrigatório
affected_customers_estinteger · opcional
created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Erros 403 · 404

Permissões operations:write · Funções: admin, field_supervisor, operations, owner

curl -X POST "$BUSINESS_API/interruptions/{id}/complete" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "sup_2xVSEXVGkjH84PdmebPICxjIkZH",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "title": "Fuga na Rua 3",
  "interruption_type": "maintenance",
  "status": "planned",
  "service_area_id": "ser_23fmkpfkC17kSVJ2spjyiBbOED9",
  "dma_id": "dma_2gE3tiwbLQQnDGcrVkstPO8Bjkg",
  "description": "Leitura confirmada no local.",
  "start_time": "2026-11-19T09:30:00Z",
  "end_time": "2026-11-19T09:30:00Z",
  "affected_customers_est": 1,
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}