Create Contact

POST {{url}}/{{tenantName}}/{{instanceName}}/patients/{{patientId}}/contacts

Description

This endpoint allows you to create a new contact for a specific patient. By making a POST request to this endpoint, you can add a contact record with relevant information such as name, phone number, email, and relationship to the patient.

Parameters

The endpoint requires the following parameters:

  • {{url}}: The base URL of the API.
  • {{tenantName}}: The name of the tenant or organization.
  • {{instanceName}}: The name of the specific instance within the tenant.
  • {{patientId}}: The unique identifier of the patient for whom the contact is being created.

Request Headers

The following headers must be included in the request:

  • Authorization: A token or credentials to authenticate the request.
  • Content-Type: The format of the request payload, typically set to application/json.

Request Body

The request body should contain the necessary information to create the contact. The required fields may include:

  • name: The name of the contact.
  • phone: The phone number of the contact. (Note: when working with patients and fields such as phone, phone must be specified in the international format, E.164 format, without zero)
  • email: The email address of the contact.
  • relationship: The relationship of the contact to the patient.
  • pdtRecordId : profile record ID

Response

The response to a successful request will include the newly created contact object, typically with an associated unique identifier.

Error Handling

If an error occurs, the response will include an appropriate HTTP status code along with an error message or code to indicate the specific issue encountered. Common error codes include 400 for bad requests and 401 for unauthorized access.

Authorization

Proper authorization credentials must be provided in the request headers to access this endpoint. Consult the API documentation or contact the system administrator to obtain the necessary authorization details.

Request Body

{"name"=>"John Doe", "email"=>"email@email.com", "emailLabel"=>"email label", "emailPdtFieldName"=>"pdt-email-field", "phone"=>"+14155552671", "phoneLabel"=>"phone label", "phonePdtFieldName"=>"pdt-phone-field", "secondaryPhone"=>"+14155552671", "secondaryPhoneLabel"=>"phone label", "secondaryPhonePdtFieldName"=>"pdt-phone-field", "pdtRecordId"=>"a76221fe-74ef-4915-8d24-31832144a457", "relation"=>"Husband"}