Skip to content
FacilydevelopersDashboard
Build with Facily
DocsREST APIsImport Unit Rates
Search the full API reference Esc to close

Import Unit Rates

Units · REST API reference

Get support
POST/v1/facilities/{facility_id}/unit-rates
Apply a unit-grain sheet of own rates to one facility, all-or-nothing (design 7.5).

Authentication

Bearer API key or Facily session, subject to permissions and facility scope.

Authentication and scope

Request example

Replace bracketed path values with real IDs from your environment. The body, where shown, is generated from the schema and uses illustrative values.

cURL
curl --request POST \
  --url 'https://api.staging.facily.ai/v1/facilities/<FACILITY_ID>/unit-rates' \
  --header "Authorization: Bearer $FACILY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "rows": [
    {
      "standard_rate": 0,
      "unit_id": "00000000-0000-4000-8000-000000000001"
    }
  ]
}'
An example for building your request, not an executed call. Check required fields, allowed values, and environment configuration before sending.

Parameters

facility_idpath · stringrequired

Format: uuid

Request body

application/json · Required

rowsUnitRateImportRowRequest[]required

Min items: 1 · Max items: 2000

Show rows schema
standard_ratenumber | string | nullrequired

Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$

Show standard_rate schema
number | string | null
Variant 1: number
number
Variant 2: string
string
Variant 3: null
null
unit_idstringrequired

Format: uuid

Responses

Expand a status to inspect its schema. Generated examples show structure and synthetic values.

200Successful Response
JSON · generated example
{
  "data": {
    "applied": false,
    "changed": 0,
    "errors": 0,
    "rows": [
      {
        "index": 0,
        "status": "changed",
        "error": "string",
        "target_id": "00000000-0000-4000-8000-000000000001"
      }
    ],
    "unchanged": 0
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

dataRateImportResponserequired

A rate sheet's outcome: all-or-nothing, with a result per row.

Show data schema
appliedbooleanrequired

False when any row failed: then nothing was written.

changedintegerrequired
errorsintegerrequired
rowsRateImportRowResponse[]required
Show rows schema
errorstring | null
Show error schema
string | null
Variant 1: string
string
Variant 2: null
null
indexintegerrequired

The row's position in the request, from 0.

statusstringrequired

Values: "changed", "unchanged", "error"

target_idstring | null

The group or unit the row matched.

Format: uuid

Show target_id schema
string | null

The group or unit the row matched.

Variant 1: string
string
Variant 2: null
null
unchangedintegerrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
400Validation error
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
401Unauthenticated
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
403Permission denied
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
404Not found
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
409Business logic error
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
503Temporary failure
JSON · generated example
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {}
  },
  "meta": {
    "request_id": "string"
  }
}

application/json

errorErrorBodyrequired

The shape of error.* in an error response.

Show error schema
codestringrequired
detailsobject | null
Show details schema
object | null
Variant 1: object
object
Variant 2: null
null
messagestringrequired
metaMetarequired

Envelope metadata. Every response carries one.

Show meta schema
request_idstringrequired
Continue exploringAll units operations
Build something that works beautifully.

Facily API · Contract v1.200 · Reviewed October 29, 2026

Import Unit Rates | Facily Developers