/v1/facilities/{facility_id}/lead-close-reasonsAuthentication
Bearer API key or Facily session, subject to permissions and facility scope.
Authentication and scopeRequest 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 --request POST \
--url 'https://api.staging.facily.ai/v1/facilities/<FACILITY_ID>/lead-close-reasons' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"reason": "string",
"facility_ids": [
"00000000-0000-4000-8000-000000000001"
],
"sort_order": 0
}'Parameters
facility_idpath · stringrequiredFormat: uuid
Request body
application/json · Required
facility_idsstring[] | nullFacilities the entry applies at. Omit for the facility in the path; [] for every facility (Corporate, needs an organization-wide grant). A non-empty list must include the path facility.
Show facility_ids schema
string[] | nullFacilities the entry applies at. Omit for the facility in the path; [] for every facility (Corporate, needs an organization-wide grant). A non-empty list must include the path facility.
Variant 1: string[]
string[]Variant 2: null
nullreasonstringrequiredShown when a lead is closed.
Min length: 1 · Max length: 100
sort_orderintegerPosition in lists, lowest first.
Default: 0 · Minimum: 0
Responses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
201Successful Response
{
"data": {
"active": false,
"created_at": "2026-10-29T12:00:00Z",
"facility_ids": [
"00000000-0000-4000-8000-000000000001"
],
"id": "00000000-0000-4000-8000-000000000001",
"reason": "string",
"sort_order": 0,
"system_key": "string",
"updated_at": "2026-10-29T12:00:00Z"
},
"meta": {
"request_id": "string"
}
}application/json
dataLeadCloseReasonResponserequiredShow data schema
activebooleanrequiredfalse when the reason is retired.
created_atstringrequiredWhen the reason was created.
Format: date-time
facility_idsstring[]requiredFacilities the entry applies at; [] means every facility.
Show facility_ids schema
stringidstringrequiredUnique identifier for this close reason.
Format: uuid
reasonstringrequiredShown when a lead is closed.
sort_orderintegerrequiredPosition in lists, lowest first.
system_keystring | nullrequiredSet on a reason the system itself uses, such as reservation_expired; such a reason cannot be retired.
Show system_key schema
string | nullSet on a reason the system itself uses, such as reservation_expired; such a reason cannot be retired.
Variant 1: string
stringVariant 2: null
nullupdated_atstringrequiredWhen the reason was last modified.
Format: date-time
metaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired400Validation error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired401Unauthenticated
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired403Permission denied
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired404Not found
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired409Business logic error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired503Temporary failure
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired