Contact addresses
You can retrieve, create, update, and delete contact addresses through Cloud API.
The endpoints described in this topic can be used when working with contacts that are not account, policy, or job contacts. To work with those types of contacts, you must work with endpoints described in Account contact addresses and Policy contact addresses.
Retrieve contact addresses
- GET
/contacts/{contactId}/addresses - GET
/contacts/{contactId}/addresses/{addressId}
For example, the following retrieves all addresses on a contact:
GET /common/v1/contacts/pc:467/addresses{
"count": 1,
"data": [
{
"attributes": {
"addressLine1": "193 Oak Way",
"addressType": {
"code": "billing",
"name": "Billing"
},
"city": "San Mateo",
"country": "US",
"displayName": "193 Oak Way, San Mateo, CA 94403",
"id": "pc:SKij3GqoHnes8Mkg_S4Ba",
"postalCode": "94403",
"primary": true,
"state": {
"code": "CA",
"name": "California"
}
},
...
}
],
...
}Create a contact address
- POST
/common/v1/contacts/{contactId}/addresses
When you create an address on a contact, unless otherwise specified, it is added as a secondary address.
addressLine1- The first line of the address, as a stringcity- The name of the city, as a stringstate- The state, as a typekey reference to theStatetypelistpostalCode- The postal code, as a string
The following is a minimal example:
POST /common/v1/contacts/pc:532/addressesRequest
body{
"data": {
"attributes": {
"addressLine1": "456 Hillsdale Blvd",
"city": "Albany",
"postalCode": "22222",
"state": {
"code": "CA"
}
}
}
}For organization contacts, if you want the address to be the primary address, set the
primary field to true. When this field is set
to true, the existing primary address automatically becomes a secondary address.
Update a contact address
You can update an address on a contact.
- PATCH
/common/v1/contacts/{contactId}/addresses/{addressId}
For example, the following updates a contact address to add
addressLine2 and addressLine3 properties.
PATCH /common/v1/contacts/pc:532/addresses/pc:873Request
body{
"data": {
"attributes": {
"addressLine2": "Building 4",
"addressLine3": "Suite 200"
}
}
}Delete a contact address
- DELETE
/contacts/{contactId}/addresses/{addressId}
You cannot delete the primary address for a contact.
For example, the following command deletes a contact address. No request body is required.
Command
DELETE /common/v1/contacts/pc:532/addresses/pc:873