/v1/lead-sources/{source_id}Authentication
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 PATCH \
--url 'https://api.staging.facily.ai/v1/lead-sources/<SOURCE_ID>' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"active": false,
"category": "web",
"facility_ids": [
"00000000-0000-4000-8000-000000000001"
],
"name": "string",
"sort_order": 0
}'Parameters
source_idpath · stringrequiredFormat: uuid
Request body
application/json · Required
activeboolean | nullfalse retires the source from new leads.
Show active schema
boolean | nullfalse retires the source from new leads.
Variant 1: boolean
booleanVariant 2: null
nullcategorystring | nullweb, print or lead; null clears it.
Values: "web", "print", "lead"
Show category schema
string | nullweb, print or lead; null clears it.
Variant 1: string
stringValues: "web", "print", "lead"
Variant 2: null
nullfacility_idsstring[] | nullThe new facility set; [] for every facility. Needs the configure permission on every one.
Show facility_ids schema
string[] | nullThe new facility set; [] for every facility. Needs the configure permission on every one.
Variant 1: string[]
string[]Variant 2: null
nullnamestring | nullThe new name.
Min length: 1 · Max length: 100
Show name schema
string | nullThe new name.
Variant 1: string
stringVariant 2: null
nullsort_orderinteger | nullPosition in lists, lowest first.
Minimum: 0
Show sort_order schema
integer | nullPosition in lists, lowest first.
Variant 1: integer
integerVariant 2: null
nullResponses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"active": false,
"category": "string",
"created_at": "2026-10-29T12:00:00Z",
"facility_ids": [
"00000000-0000-4000-8000-000000000001"
],
"id": "00000000-0000-4000-8000-000000000001",
"name": "string",
"sort_order": 0,
"updated_at": "2026-10-29T12:00:00Z"
},
"meta": {
"request_id": "string"
}
}application/json
dataLeadSourceResponserequiredShow data schema
activebooleanrequiredfalse when the source is retired from new leads.
categorystring | nullrequiredweb, print or lead; null for none.
Show category schema
string | nullweb, print or lead; null for none.
Variant 1: string
stringVariant 2: null
nullcreated_atstringrequiredWhen the source was created.
Format: date-time
facility_idsstring[]requiredFacilities the entry applies at; [] means every facility.
Show facility_ids schema
stringidstringrequiredUnique identifier for this source.
Format: uuid
namestringrequiredShown in the lead's source list.
sort_orderintegerrequiredPosition in lists, lowest first.
updated_atstringrequiredWhen the source 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