v1

latestOpenAPI 3.0.02026-07-2447166133.5 KB
Contacts

Create a contact

This operation creates a contact within an organization.

Creating a new contact requires at least of the following fields to be populated (givenName, familyName, phoneNumbers, faxNumbers, emailAddresses).

post/contacts

Headers

s-idempotency-keystring

A unique value generated by the client used to recognize subsequent retries of the same request. Idempotency keys can be up to 255 characters long.

Request body

category'patient' | 'professional'
companyNamestring

The contact's company. This field can also be used to specify the name of a non-patient contact, such as another healthcare facility.

dateOfBirthstring date

The contact's date of birth in the format YYYY-MM-DD.

familyNamestring

The contact's family name (typically last name in US)

gender'unknown' | 'male' | 'female' | 'other'
genderDetailstring

Optional free-text details for gender

givenNamestring

The contact's given name (typically first name in US)

internalMemberIdsstring[]

The ids of the teammates, teams and/or your organization that are members of the contact. Contact Membership must be enabled for the organization for this field to be interacted with.

middleNamestring

The contact's middle name

pronounsstring

The contact's pronouns

tagIdsContactTagId[]

An array of Spruce contact tag ids

Example request

{
  "category": "patient",
  "companyName": "Walgreens",
  "dateOfBirth": "2000-01-30",
  "emailAddresses": [
    {
      "label": "Work",
      "value": "contact@example.com"
    }
  ],
  "familyName": "Smith",
  "faxNumbers": [
    {
      "label": "Work"
    }
  ],
  "gender": "unknown",
  "genderDetail": "Non-binary",
  "givenName": "Joe",
  "middleName": "William",
  "organizationContactFields": [
    {
      "id": "managedCustomField_0E5QDGJC03000",
      "value": "CVS"
    }
  ],
  "phoneNumbers": [
    {
      "label": "Work"
    }
  ],
  "pronouns": "he/him",
  "tagIds": [
    "tag_0E5QDGJC03000"
  ]
}

Response

created

apiURLstring url required

An absolute URL for fetching this contact from the API

appURLstring url required

An absolute URL to view the contact in the Spruce app

canDeleteboolean required

Whether the contact may be deleted.

canEditboolean required

Whether the contact may be edited.

category'patient' | 'professional' | 'clinic' | 'unknown' required
companyNamestring

The contact's company. This field can also be used to specify the name of a non-patient contact, such as another healthcare facility.

createdstring date-time required

The date this contact was added to Spruce

dateOfBirthstring date

The contact's date of birth in the format YYYY-MM-DD.

displayNamestring required

The contact's full name for easy display to a user. This is determined by combining the givenName, middleName, and familyName, or if those are all empty, falling back to companyName, phone number or email address.

familyNamestring

The contact's family name (typically last name in US)

gender'unknown' | 'male' | 'female' | 'other' required
genderDetailstring

Optional free-text details for gender

givenNamestring

The contact's given name (typically first name in US)

hasAccountboolean required

Whether the contact has created a Spruce account for secure messaging, video calling, etc.

hasPendingInviteboolean required

Whether the contact has a pending Spruce account invitation

idstring required

Spruce's contact ID

internalMemberIdsstring[] required

The ids of the teammates, teams and/or your organization that are members of the contact. Contact Membership must be enabled for the organization for this field to be interacted with.

middleNamestring

The contact's middle name

objectstring required

String representing the object's type

pronounsstring

The contact's pronouns

Example response

{
  "apiURL": "https://api.sprucehealth.com/contact/entity_0E5QDGJC03000",
  "appURL": "https://app.sprucehealth.com/org/entity_0D4QABCC06000/contact/entity_0E5QDGJC03000",
  "canDelete": true,
  "canEdit": true,
  "category": "patient",
  "companyName": "Walgreens",
  "created": "2021-01-30T08:30:00Z",
  "customContactFields": [
    {
      "id": "entityCustomField_0E5QDGJC03000",
      "name": "Preferred Pharmacy",
      "value": "CVS"
    }
  ],
  "dateOfBirth": "2000-01-30",
  "displayName": "Joe William Smith",
  "emailAddresses": [
    {
      "id": "entityContact_26RRC7PQ6JG00",
      "label": "Work",
      "value": "contact@example.com"
    }
  ],
  "familyName": "Smith",
  "faxNumbers": [
    {
      "displayValue": "(222) 555-0000",
      "id": "entityContact_26RRC7PQ6JG00",
      "label": "Work"
    }
  ],
  "gender": "unknown",
  "genderDetail": "Non-binary",
  "givenName": "Joe",
  "hasAccount": true,
  "hasPendingInvite": true,
  "id": "entity_0E5QDGJC03000",
  "integrationLinks": [
    {
      "contactId": "entity_0E5QDGJC03000",
      "externalId": "elation_140797386655555",
      "type": "elation"
    }
  ],
  "middleName": "William",
  "organizationContactFields": [
    {
      "id": "managedCustomField_0E5QDGJC03000",
      "name": "Preferred Pharmacy",
      "value": "CVS"
    }
  ],
  "phoneNumbers": [
    {
      "displayValue": "(222) 555-0000",
      "id": "entityContact_26RRC7PQ6JG00",
      "label": "Work"
    }
  ],
  "pronouns": "he/him",
  "tags": [
    {
      "id": "tag_0E5QDGJC03000",
      "value": "Smith"
    }
  ]
}