Update delivery address
/v1/practices/{practiceId}/patients/{patientId}/addresses/{addressId}Request example
Replace example values with your Test data. Check the field rules below before you send a request.
{
"address": {
"city": "<string>",
"country": "US",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"state": "<string>"
},
"label": "<string>",
"recipientName": "<string>",
"preferredShipping": false
}curl -X PATCH 'https://api.affinityrx.com/v1/practices/{practiceId}/patients/{patientId}/addresses/{addressId}' \
-H "Authorization: Bearer $AFFINITY_API_KEY" \
-H 'Affinity-Version: 2026-09-28' \
-H 'Idempotency-Key: <Idempotency-Key>' \
-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.
{
"id": "addr_01j2y8m6jcc9tt24af5pw9x1bc",
"address": {
"city": "<string>",
"country": "<string>",
"line1": "<string>",
"line2": "<string>",
"postalCode": "<string>",
"state": "<string>"
},
"label": "<string>",
"preferredShipping": false,
"recipientName": "<string>",
"archivedAt": "<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": 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}$
patientIdstringrequiredPattern: ^pat_[0-7][0-9a-hjkmnp-tv-z]{25}$
addressIdstringrequiredPattern: ^addr_[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-KeystringrequiredAffinity-Actor-IdstringRequired for user actors and optional for system actors. Omit both actor headers to use the authenticated service account as a system actor.
Affinity-Actor-TypestringUse user when a person initiated the action and system for autonomous work. Omit both actor headers to default to system.
Request body specification application/json
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]*$
countrystring | nullShow country fields
Any of · 1: string
string
Allowed: "US"
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
postalCodestringrequiredstatestringrequiredAny of · 2: null
null
labelstring | nullShow label fields
Any of · 1: string
string
Pattern: ^[^\u0000\p{Cs}]*$
Any of · 2: null
null
recipientNameany | null | nullShow recipientName 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
preferredShippingboolean | nullShow preferredShipping fields
Any of · 1: boolean
boolean
Any of · 2: null
null
Response specifications
200Successful response
application/json
idstringrequiredPattern: ^addr_[0-7][0-9a-hjkmnp-tv-z]{25}$
addressobjectrequiredNo additional properties
Show address fields
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]*$
labelstringrequiredPattern: ^[^\u0000\p{Cs}]*$
preferredShippingbooleanrequiredrecipientNameany & any | nullrequiredShow recipientName 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
archivedAtstring | nullrequiredShow archivedAt 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
429Too many requests
application/json
codestringrequireddataobjectdetailstringrequiredinstancestringrequiredrequestIdstringrequiredstatusintegerrequiredMinimum: 400
Maximum: 599
titlestringrequiredtraceIdstringtypestringrequiredFormat: uri