Update practice
/v1/practices/{practiceId}Updates one practice owned by the platform. Set liveEnabled to true or false to control Live access with an approved platform and a Live request. Affinity Admin decisions take precedence. Requires practices:write. Send Idempotency-Key when you retry the same request.
Request example
Replace example values with your Test data. Check the field rules below before you send a request.
{
"liveEnabled": false,
"address": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"state": "<string>"
},
"attestations": {
"authorizedPracticeRelationship": false,
"authorizedPhiTransfer": false,
"minimumNecessaryPhi": false,
"providerDataAccuracy": false
},
"complianceContact": {
"email": "<string>",
"name": "<string>",
"phone": "<string>"
},
"externalId": "<string>",
"legalName": "<string>",
"metadata": "<string>",
"name": "<string>",
"prescribers": [
{
"credentials": "<string>",
"licenseStates": [
"<string>"
],
"name": "<string>",
"npi": "<string>"
}
],
"primaryContact": {
"email": "<string>",
"name": "<string>",
"phone": "<string>"
},
"supportEmail": "<string>",
"supportPhone": "<string>",
"timezone": "<string>"
}curl -X PATCH 'https://api.affinityrx.com/v1/practices/{practiceId}' \
-H "Authorization: Bearer $AFFINITY_API_KEY" \
-H 'Affinity-Version: 2026-09-28' \
-H 'Content-Type: application/json' \
--data @request.jsonResponse example
These examples show the body structure. Values can differ. Select a status code to see its response.
{
"address": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"state": "<string>"
},
"contacts": {
"compliance": {
"email": "<string>",
"name": "<string>",
"phone": "<string>"
},
"primary": {
"email": "<string>",
"name": "<string>",
"phone": "<string>"
}
},
"createdAt": "<string>",
"externalId": "<string>",
"id": "prac_01j2y8m6jcc9tt24af5pw9x1bc",
"legalName": "<string>",
"livemode": false,
"metadata": "<string>",
"name": "<string>",
"object": "practice",
"prescribers": [
{
"credentials": "<string>",
"licenseStates": [
"<string>"
],
"name": "<string>",
"npi": "<string>"
}
],
"liveEnabled": false,
"supportEmail": "<string>",
"supportPhone": "<string>",
"timezone": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 400,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 401,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 403,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 404,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 409,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 422,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}{
"code": "<string>",
"data": "<string>",
"detail": "<string>",
"instance": "<string>",
"requestId": "<string>",
"status": 429,
"title": "<string>",
"traceId": "<string>",
"type": "<string>"
}Implementation specification
Use these field types and limits to build your integration. Download the OpenAPI document for the complete contract.
Path parameters
practiceIdstringrequiredPattern: ^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$
Headers
Affinity-VersionstringSelects the HTTP API contract for this request only. When omitted, API-key requests use their service account’s stored version. Does not change the stored default.
Pin requests to 2026-09-28.
Idempotency-KeystringRequest body specification application/json
liveEnabledbooleanEnable or disable Live access for an owned practice. Requires an approved platform and a Live request. Affinity Admin decisions take precedence.
addressobject | nullShow address fields
Any of · 1: object
cityanyrequiredPattern: ^[^\u0000\p{Cs}]*$
Show city fields
All of · 1: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
countryany | nullShow country fields
Any of · 1: any
All of · 1: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
Any of · 2: null
null
line1anyrequiredPattern: ^[^\u0000\p{Cs}]*$
Show line1 fields
All of · 1: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
line2any | null | nullShow line2 fields
Any of · 1: any | null
Any of · 1: any
All of · 1: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
Any of · 2: null
null
Any of · 2: null
null
postalCodeanyrequiredPattern: ^[^\u0000\p{Cs}]*$
Show postalCode fields
All of · 1: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
stateanyrequiredPattern: ^[^\u0000\p{Cs}]*$
Show state fields
All of · 1: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
Any of · 2: null
null
attestationsobject | nullShow attestations fields
Any of · 1: object
authorizedPracticeRelationshipbooleanrequiredauthorizedPhiTransferbooleanrequiredminimumNecessaryPhibooleanrequiredproviderDataAccuracybooleanrequiredAny of · 2: null
null
complianceContactobject | null | nullShow complianceContact fields
Any of · 1: object | null
Any of · 1: object
emailstringrequirednamestringrequiredphonestring | null | nullShow phone fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
Any of · 2: null
null
Any of · 2: null
null
externalIdstring | null | nullShow externalId fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
legalNamestring | null | nullShow legalName fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
metadataobject | nullShow metadata fields
Any of · 1: object
object
Any of · 2: null
null
namestring | nullShow name fields
Any of · 1: string
string
Any of · 2: null
null
prescribersobject[] | nullShow prescribers fields
Any of · 1: object[]
Array items · object
credentialsstring | null | nullShow credentials fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
licenseStatesstring[]requiredShow licenseStates fields
Array items · string
string
namestringrequirednpistringrequiredAny of · 2: null
null
primaryContactobject | null | nullShow primaryContact fields
Any of · 1: object | null
Any of · 1: object
emailstringrequirednamestringrequiredphonestring | null | nullShow phone fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
Any of · 2: null
null
Any of · 2: null
null
supportEmailstring | null | nullShow supportEmail fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
supportPhonestring | null | nullShow supportPhone fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
timezonestring | null | nullOptional IANA timezone override. Omit to leave unchanged; null clears it. No timezone is inferred when creating a record.
Show timezone fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
Response specifications
200Successful response
application/json
addressobject | nullrequiredShow address fields
Any of · 1: object
cityany & anyrequiredShow city fields
All of · 1: any
any
Pattern: ^[^\u0000\p{Cs}]*$
All of · 2: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
countryany & any | nullShow country fields
Any of · 1: any & any
All of · 1: any
any
Pattern: ^[^\u0000\p{Cs}]*$
All of · 2: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
Any of · 2: null
null
line1any & anyrequiredShow line1 fields
All of · 1: any
any
Pattern: ^[^\u0000\p{Cs}]*$
All of · 2: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
line2any & any | null | nullShow line2 fields
Any of · 1: any & any | null
Any of · 1: any & any
All of · 1: any
any
Pattern: ^[^\u0000\p{Cs}]*$
All of · 2: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
Any of · 2: null
null
Any of · 2: null
null
postalCodeany & anyrequiredShow postalCode fields
All of · 1: any
any
Pattern: ^[^\u0000\p{Cs}]*$
All of · 2: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
stateany & anyrequiredShow state fields
All of · 1: any
any
Pattern: ^[^\u0000\p{Cs}]*$
All of · 2: any
any
Pattern: ^[^\p{Cc}\u200B\u2028-\u202E\u2066-\u2069]*$
Any of · 2: null
null
contactsobjectrequiredNo additional properties
Show contacts fields
complianceobject | nullrequiredShow compliance fields
Any of · 1: object
emailstringrequirednamestringrequiredphonestring | null | nullShow phone fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
Any of · 2: null
null
primaryobject | nullrequiredShow primary fields
Any of · 1: object
emailstringrequirednamestringrequiredphonestring | null | nullShow phone fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
Any of · 2: null
null
createdAtstringrequiredexternalIdstring | nullrequiredShow externalId fields
Any of · 1: string
string
Any of · 2: null
null
idstringrequiredPattern: ^prac_[0-7][0-9a-hjkmnp-tv-z]{25}$
legalNamestring | nullrequiredShow legalName fields
Any of · 1: string
string
Any of · 2: null
null
livemodebooleanrequiredmetadataobjectrequirednamestringrequiredobjectstringrequiredAllowed: "practice"
prescribersobject[]requiredShow prescribers fields
Array items · object
credentialsstring | null | nullShow credentials fields
Any of · 1: string | null
Any of · 1: string
string
Any of · 2: null
null
Any of · 2: null
null
licenseStatesstring[]requiredShow licenseStates fields
Array items · string
string
namestringrequirednpistringrequiredliveEnabledbooleanrequiredWhether this practice currently has Live access. False for Test practices.
supportEmailstring | nullrequiredShow supportEmail fields
Any of · 1: string
string
Any of · 2: null
null
supportPhonestring | nullrequiredShow supportPhone fields
Any of · 1: string
string
Any of · 2: null
null
timezonestring | nullrequiredShow timezone fields
Any of · 1: string
string
Any of · 2: null
null
400HTTP 400
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
401Unauthorized
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
403Forbidden
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
404Not found
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
409Conflict
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
422Validation error
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri
429Too many requests
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri