---
title: "Batch add and update facility specialties"
method: PATCH
path: "/facilities/{id}/specialties"
tags: ["Facility"]
---

# Batch add and update facility specialties

`PATCH /facilities/{id}/specialties`

Applies multiple specialty updates and additions to a facility in a single request. Updates modify existing TenantFacilitySpecialty records (specialty FK, effective date, isPrimary). Additions create new specialty associations at the facility level.

## Path parameters

- `id` string, required

## Headers

- `tenant-id` string

## Request body

- ManageFacilitySpecialtiesRequest
  - `updates` UpdateSpecialtyItem[] — Existing specialties to update
    - `tenantFacilitySpecialtyId` string, required — ID of the existing TenantFacilitySpecialty record to update
    - `newTenantSpecialtyId` string — ID of the new TenantSpecialty to replace the current one
    - `effectiveDate` string — New effective date in YYYY-MM-DD format
    - `isPrimary` boolean — Whether this specialty is primary
  - `additions` AddSpecialtyItem[] — New specialties to add
    - `tenantSpecialtyId` string, required — ID of the tenant specialty to associate
    - `effectiveDate` string — Effective date in YYYY-MM-DD format
    - `isPrimary` boolean — Whether this specialty is primary
  - `changeReason` string — Optional reason for change, applied to all operations

## Response `200`

Specialties managed successfully

- ManageFacilitySpecialtiesResponse
  - `updatedSpecialties` JsonNode[] — Results from updated specialty records
    - `empty` boolean
    - `valueNode` boolean
    - `containerNode` boolean
    - `missingNode` boolean
    - `array` boolean
    - `object` boolean
    - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
    - `pojo` boolean
    - `number` boolean
    - `integralNumber` boolean
    - `floatingPointNumber` boolean
    - `short` boolean
    - `int` boolean
    - `long` boolean
    - `float` boolean
    - `double` boolean
    - `bigDecimal` boolean
    - `bigInteger` boolean
    - `textual` boolean
    - `boolean` boolean
    - `null` boolean
    - `binary` boolean
  - `addedSpecialties` AssociateFacilitySpecialtyResponse[] — Results from newly added specialty associations
    - `facilitySpecialty` TenantFacilitySpecialtyResponse
      - `id` string
      - `tenantFacilityId` string
      - `tenantSpecialtyId` string
      - `tenantId` string
      - `createdAt` string, date
      - `updatedAt` string, date
      - `data` JsonNode
        - `empty` boolean
        - `valueNode` boolean
        - `containerNode` boolean
        - `missingNode` boolean
        - `array` boolean
        - `object` boolean
        - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
        - `pojo` boolean
        - `number` boolean
        - `integralNumber` boolean
        - `floatingPointNumber` boolean
        - `short` boolean
        - `int` boolean
        - `long` boolean
        - `float` boolean
        - `double` boolean
        - `bigDecimal` boolean
        - `bigInteger` boolean
        - `textual` boolean
        - `boolean` boolean
        - `null` boolean
        - `binary` boolean
    - `facilityLocationSpecialty` TenantFacilityLocationSpecialtyResponse
      - `id` string
      - `tenantFacilityLocationId` string
      - `tenantId` string
      - `tenantSpecialtyId` string
      - `createdAt` string, date
      - `updatedAt` string, date
      - `data` JsonNode
        - `empty` boolean
        - `valueNode` boolean
        - `containerNode` boolean
        - `missingNode` boolean
        - `array` boolean
        - `object` boolean
        - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
        - `pojo` boolean
        - `number` boolean
        - `integralNumber` boolean
        - `floatingPointNumber` boolean
        - `short` boolean
        - `int` boolean
        - `long` boolean
        - `float` boolean
        - `double` boolean
        - `bigDecimal` boolean
        - `bigInteger` boolean
        - `textual` boolean
        - `boolean` boolean
        - `null` boolean
        - `binary` boolean
    - `groupFacilitySpecialty` TenantGroupFacilitySpecialtyResponse
      - `id` string
      - `tenantGroupFacilityId` string
      - `tenantSpecialtyId` string
      - `data` JsonNode
        - `empty` boolean
        - `valueNode` boolean
        - `containerNode` boolean
        - `missingNode` boolean
        - `array` boolean
        - `object` boolean
        - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
        - `pojo` boolean
        - `number` boolean
        - `integralNumber` boolean
        - `floatingPointNumber` boolean
        - `short` boolean
        - `int` boolean
        - `long` boolean
        - `float` boolean
        - `double` boolean
        - `bigDecimal` boolean
        - `bigInteger` boolean
        - `textual` boolean
        - `boolean` boolean
        - `null` boolean
        - `binary` boolean
    - `groupFacilityLocationSpecialty` TenantGroupFacilityLocationSpecialtyResponse
      - `id` string
      - `tenantGroupFacilityLocationId` string
      - `tenantGroupFacilitySpecialtyId` string
      - `data` JsonNode
        - `empty` boolean
        - `valueNode` boolean
        - `containerNode` boolean
        - `missingNode` boolean
        - `array` boolean
        - `object` boolean
        - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
        - `pojo` boolean
        - `number` boolean
        - `integralNumber` boolean
        - `floatingPointNumber` boolean
        - `short` boolean
        - `int` boolean
        - `long` boolean
        - `float` boolean
        - `double` boolean
        - `bigDecimal` boolean
        - `bigInteger` boolean
        - `textual` boolean
        - `boolean` boolean
        - `null` boolean
        - `binary` boolean
    - `groupFacilityNetworkSpecialty` TenantGroupFacilityNetworkSpecialtyResponse
      - `id` string
      - `tenantGroupFacilityNetworkId` string
      - `tenantGroupFacilitySpecialtyId` string
      - `data` JsonNode
        - `empty` boolean
        - `valueNode` boolean
        - `containerNode` boolean
        - `missingNode` boolean
        - `array` boolean
        - `object` boolean
        - `nodeType` 'ARRAY' | 'BINARY' | 'BOOLEAN' | 'MISSING' | 'NULL' | 'NUMBER' | 'OBJECT' | 'POJO' | 'STRING'
        - `pojo` boolean
        - `number` boolean
        - `integralNumber` boolean
        - `floatingPointNumber` boolean
        - `short` boolean
        - `int` boolean
        - `long` boolean
        - `float` boolean
        - `double` boolean
        - `bigDecimal` boolean
        - `bigInteger` boolean
        - `textual` boolean
        - `boolean` boolean
        - `null` boolean
        - `binary` boolean
    - `notCreated` SpecialtyNotCreated[] — Specialty associations that could not be created. Empty when all requested levels succeeded.
      - `level` 'GROUP' | 'LOCATION' | 'NETWORK_GROUP' | 'NETWORK_LOCATION', required
      - `reason` 'MISSING_DEPENDENCY' | 'DOWNSTREAM_ERROR' | 'CONFLICT' | 'VALIDATION_ERROR', required
      - `message` string, required — User-facing message explaining what went wrong and how to fix it
  - `errors` SpecialtyNotCreated[] — Operations that failed, empty when all succeeded
    - `level` 'GROUP' | 'LOCATION' | 'NETWORK_GROUP' | 'NETWORK_LOCATION', required
    - `reason` 'MISSING_DEPENDENCY' | 'DOWNSTREAM_ERROR' | 'CONFLICT' | 'VALIDATION_ERROR', required
    - `message` string, required — User-facing message explaining what went wrong and how to fix it

## Other responses

- `400` — Invalid request body
- `404` — Facility not found
- `500` — Internal server error

---

[API](https://skmtc.net/certifyos/apis/certify-api-layer.md) · [All operations](https://skmtc.net/certifyos/apis/certify-api-layer/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/certifyos/certify-api-layer/versions/3d27e9019c7b/schema)
