Account contacts
In addition to the account holder, an account may have any number of additional contacts.
Querying for account contacts
Use the following endpoints to retrieve information about contacts for a specific account:
- GET
/accounts/{accountId}/contacts
- GET
/accounts/{accountId}/contacts/{contactId}
Masking the taxID
field
The AccountContact
resource has a taxID
field which
stores the tax ID of the contact. In the Cloud API base configuration, this field is
masked in responses so that only the last four digits appear. For example, the
following is the response for a GET that retrieves a contact.
{
"data": {
"attributes": {
"displayName": "Ray Newton",
"taxId": "***-**-6789"
}
}
}
For some callers, such as internal or external users, the masking of tax ID may be appropriate as it protects personally identifiable information. For other callers, such as services, this masking may cause a problem as the callers may reference contacts internally using the tax ID.
There are two ways that the taxId
field can be unmasked:
- You can configure the field so that it is always unmasked. For information on how to configure this, see the Cloud API Developer Guide.
- You can grant the caller the
restunmasktaxid
system permission. Any caller who has a role with this permission will get responses with unmasked tax IDs. For information on how to configure this, see the section on API role special permissions in the Cloud API Developer Guide.
Creating account contacts
Use the following endpoint to create an AccountContact
for a given
account:
- POST
/accounts/{accountId}/contacts
Minimum creation criteria
You must specify the following information:
contactSubtype
(typically set to eitherPerson
orCompany
)firstName
andlastName
(forPerson
contacts)companyName
(forCompany
contacts)primaryAddress
, with at least:addressLine1
city
state
postalCode
For example, the following request creates a new contact for account pc:202.
POST /account/v1/accounts/pc:202/contacts
{
"data": {
"attributes": {
"contactSubtype": "Person",
"firstName": "Samantha",
"lastName": "Stewart",
"primaryAddress": {
"addressLine1": "2850 S. Delaware St.",
"city": "San Mateo",
"postalCode": "94403",
"state": {
"code": "CA"
}
}
}
}
}
Modifying account contacts
Use the following endpoints to modify or delete an account contact:
- PATCH
/account/v1/accounts/{accountId}/contacts/{contactId}
- DELETE
/account/v1/accounts/{accountId}/contacts/{contactId}
For example, the following request assigns an email for account contact pc:444 on account pc:202.
PATCH /account/v1/accounts/pc:202/contacts/pc:444
{
"data": {
"attributes": {
"emailAddress1": "sstewart@email.com"
}
}
}
The following request deletes account contact pc:444 on account pc:202.
DELETE /account/v1/accounts/pc:202/contacts/pc:444
<no request body>