Update a client
curl --request POST \
--url https://api.caspen.com/v1/clients/{client} \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"profession": "<string>",
"email": "jsmith@example.com",
"date_of_birth": "2023-11-07T05:31:56Z",
"sex": "<string>",
"gender_identity": "<string>",
"pronouns": "<string>",
"emergency_contact_id": 123,
"emergency_contact_relationship": "<string>",
"invoice_contact_id": 123,
"notes": "<string>",
"alert": "<string>",
"referral_type_id": 123,
"referral_description": "<string>",
"referred_by_id": "<string>",
"phone_number": "<string>",
"intolerances": [
"<string>"
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"latitude": 0,
"longitude": 0,
"formatted_address_google_estimate": "<string>",
"place_id": "<string>"
},
"tag_ids": [
123
],
"ndis_details": {
"ndis_number": "<string>",
"plan_start_date": "2023-11-07T05:31:56Z",
"plan_end_date": "2023-11-07T05:31:56Z",
"plan_manager_id": 123,
"plan_nominee_id": 123,
"diagnoses": [
"<string>"
]
},
"medications": [
{
"name": "<string>",
"dosage": "<string>"
}
],
"allergies": [
{
"name": "<string>",
"reaction": "<string>"
}
],
"phone_numbers": [
{
"number": "<string>",
"code": "<string>"
}
],
"related_clients": [
{
"related_client_id": "<string>"
}
],
"linked_contacts": [
{
"contact_id": "<string>",
"include_in_appointment_notifications": true,
"include_in_invoice_notifications": true,
"include_in_progress_note_notifications": true,
"note": "<string>"
}
]
}
'import requests
url = "https://api.caspen.com/v1/clients/{client}"
payload = {
"title": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"profession": "<string>",
"email": "jsmith@example.com",
"date_of_birth": "2023-11-07T05:31:56Z",
"sex": "<string>",
"gender_identity": "<string>",
"pronouns": "<string>",
"emergency_contact_id": 123,
"emergency_contact_relationship": "<string>",
"invoice_contact_id": 123,
"notes": "<string>",
"alert": "<string>",
"referral_type_id": 123,
"referral_description": "<string>",
"referred_by_id": "<string>",
"phone_number": "<string>",
"intolerances": ["<string>"],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"latitude": 0,
"longitude": 0,
"formatted_address_google_estimate": "<string>",
"place_id": "<string>"
},
"tag_ids": [123],
"ndis_details": {
"ndis_number": "<string>",
"plan_start_date": "2023-11-07T05:31:56Z",
"plan_end_date": "2023-11-07T05:31:56Z",
"plan_manager_id": 123,
"plan_nominee_id": 123,
"diagnoses": ["<string>"]
},
"medications": [
{
"name": "<string>",
"dosage": "<string>"
}
],
"allergies": [
{
"name": "<string>",
"reaction": "<string>"
}
],
"phone_numbers": [
{
"number": "<string>",
"code": "<string>"
}
],
"related_clients": [{ "related_client_id": "<string>" }],
"linked_contacts": [
{
"contact_id": "<string>",
"include_in_appointment_notifications": True,
"include_in_invoice_notifications": True,
"include_in_progress_note_notifications": True,
"note": "<string>"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
first_name: '<string>',
last_name: '<string>',
preferred_name: '<string>',
profession: '<string>',
email: 'jsmith@example.com',
date_of_birth: '2023-11-07T05:31:56Z',
sex: '<string>',
gender_identity: '<string>',
pronouns: '<string>',
emergency_contact_id: 123,
emergency_contact_relationship: '<string>',
invoice_contact_id: 123,
notes: '<string>',
alert: '<string>',
referral_type_id: 123,
referral_description: '<string>',
referred_by_id: '<string>',
phone_number: '<string>',
intolerances: ['<string>'],
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country_code: '<string>',
latitude: 0,
longitude: 0,
formatted_address_google_estimate: '<string>',
place_id: '<string>'
},
tag_ids: [123],
ndis_details: {
ndis_number: '<string>',
plan_start_date: '2023-11-07T05:31:56Z',
plan_end_date: '2023-11-07T05:31:56Z',
plan_manager_id: 123,
plan_nominee_id: 123,
diagnoses: ['<string>']
},
medications: [{name: '<string>', dosage: '<string>'}],
allergies: [{name: '<string>', reaction: '<string>'}],
phone_numbers: [{number: '<string>', code: '<string>'}],
related_clients: [{related_client_id: '<string>'}],
linked_contacts: [
{
contact_id: '<string>',
include_in_appointment_notifications: true,
include_in_invoice_notifications: true,
include_in_progress_note_notifications: true,
note: '<string>'
}
]
})
};
fetch('https://api.caspen.com/v1/clients/{client}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.caspen.com/v1/clients/{client}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'preferred_name' => '<string>',
'profession' => '<string>',
'email' => 'jsmith@example.com',
'date_of_birth' => '2023-11-07T05:31:56Z',
'sex' => '<string>',
'gender_identity' => '<string>',
'pronouns' => '<string>',
'emergency_contact_id' => 123,
'emergency_contact_relationship' => '<string>',
'invoice_contact_id' => 123,
'notes' => '<string>',
'alert' => '<string>',
'referral_type_id' => 123,
'referral_description' => '<string>',
'referred_by_id' => '<string>',
'phone_number' => '<string>',
'intolerances' => [
'<string>'
],
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country_code' => '<string>',
'latitude' => 0,
'longitude' => 0,
'formatted_address_google_estimate' => '<string>',
'place_id' => '<string>'
],
'tag_ids' => [
123
],
'ndis_details' => [
'ndis_number' => '<string>',
'plan_start_date' => '2023-11-07T05:31:56Z',
'plan_end_date' => '2023-11-07T05:31:56Z',
'plan_manager_id' => 123,
'plan_nominee_id' => 123,
'diagnoses' => [
'<string>'
]
],
'medications' => [
[
'name' => '<string>',
'dosage' => '<string>'
]
],
'allergies' => [
[
'name' => '<string>',
'reaction' => '<string>'
]
],
'phone_numbers' => [
[
'number' => '<string>',
'code' => '<string>'
]
],
'related_clients' => [
[
'related_client_id' => '<string>'
]
],
'linked_contacts' => [
[
'contact_id' => '<string>',
'include_in_appointment_notifications' => true,
'include_in_invoice_notifications' => true,
'include_in_progress_note_notifications' => true,
'note' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.caspen.com/v1/clients/{client}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"profession\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"date_of_birth\": \"2023-11-07T05:31:56Z\",\n \"sex\": \"<string>\",\n \"gender_identity\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"emergency_contact_id\": 123,\n \"emergency_contact_relationship\": \"<string>\",\n \"invoice_contact_id\": 123,\n \"notes\": \"<string>\",\n \"alert\": \"<string>\",\n \"referral_type_id\": 123,\n \"referral_description\": \"<string>\",\n \"referred_by_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"intolerances\": [\n \"<string>\"\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"formatted_address_google_estimate\": \"<string>\",\n \"place_id\": \"<string>\"\n },\n \"tag_ids\": [\n 123\n ],\n \"ndis_details\": {\n \"ndis_number\": \"<string>\",\n \"plan_start_date\": \"2023-11-07T05:31:56Z\",\n \"plan_end_date\": \"2023-11-07T05:31:56Z\",\n \"plan_manager_id\": 123,\n \"plan_nominee_id\": 123,\n \"diagnoses\": [\n \"<string>\"\n ]\n },\n \"medications\": [\n {\n \"name\": \"<string>\",\n \"dosage\": \"<string>\"\n }\n ],\n \"allergies\": [\n {\n \"name\": \"<string>\",\n \"reaction\": \"<string>\"\n }\n ],\n \"phone_numbers\": [\n {\n \"number\": \"<string>\",\n \"code\": \"<string>\"\n }\n ],\n \"related_clients\": [\n {\n \"related_client_id\": \"<string>\"\n }\n ],\n \"linked_contacts\": [\n {\n \"contact_id\": \"<string>\",\n \"include_in_appointment_notifications\": true,\n \"include_in_invoice_notifications\": true,\n \"include_in_progress_note_notifications\": true,\n \"note\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.caspen.com/v1/clients/{client}")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"profession\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"date_of_birth\": \"2023-11-07T05:31:56Z\",\n \"sex\": \"<string>\",\n \"gender_identity\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"emergency_contact_id\": 123,\n \"emergency_contact_relationship\": \"<string>\",\n \"invoice_contact_id\": 123,\n \"notes\": \"<string>\",\n \"alert\": \"<string>\",\n \"referral_type_id\": 123,\n \"referral_description\": \"<string>\",\n \"referred_by_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"intolerances\": [\n \"<string>\"\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"formatted_address_google_estimate\": \"<string>\",\n \"place_id\": \"<string>\"\n },\n \"tag_ids\": [\n 123\n ],\n \"ndis_details\": {\n \"ndis_number\": \"<string>\",\n \"plan_start_date\": \"2023-11-07T05:31:56Z\",\n \"plan_end_date\": \"2023-11-07T05:31:56Z\",\n \"plan_manager_id\": 123,\n \"plan_nominee_id\": 123,\n \"diagnoses\": [\n \"<string>\"\n ]\n },\n \"medications\": [\n {\n \"name\": \"<string>\",\n \"dosage\": \"<string>\"\n }\n ],\n \"allergies\": [\n {\n \"name\": \"<string>\",\n \"reaction\": \"<string>\"\n }\n ],\n \"phone_numbers\": [\n {\n \"number\": \"<string>\",\n \"code\": \"<string>\"\n }\n ],\n \"related_clients\": [\n {\n \"related_client_id\": \"<string>\"\n }\n ],\n \"linked_contacts\": [\n {\n \"contact_id\": \"<string>\",\n \"include_in_appointment_notifications\": true,\n \"include_in_invoice_notifications\": true,\n \"include_in_progress_note_notifications\": true,\n \"note\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caspen.com/v1/clients/{client}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"profession\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"date_of_birth\": \"2023-11-07T05:31:56Z\",\n \"sex\": \"<string>\",\n \"gender_identity\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"emergency_contact_id\": 123,\n \"emergency_contact_relationship\": \"<string>\",\n \"invoice_contact_id\": 123,\n \"notes\": \"<string>\",\n \"alert\": \"<string>\",\n \"referral_type_id\": 123,\n \"referral_description\": \"<string>\",\n \"referred_by_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"intolerances\": [\n \"<string>\"\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"formatted_address_google_estimate\": \"<string>\",\n \"place_id\": \"<string>\"\n },\n \"tag_ids\": [\n 123\n ],\n \"ndis_details\": {\n \"ndis_number\": \"<string>\",\n \"plan_start_date\": \"2023-11-07T05:31:56Z\",\n \"plan_end_date\": \"2023-11-07T05:31:56Z\",\n \"plan_manager_id\": 123,\n \"plan_nominee_id\": 123,\n \"diagnoses\": [\n \"<string>\"\n ]\n },\n \"medications\": [\n {\n \"name\": \"<string>\",\n \"dosage\": \"<string>\"\n }\n ],\n \"allergies\": [\n {\n \"name\": \"<string>\",\n \"reaction\": \"<string>\"\n }\n ],\n \"phone_numbers\": [\n {\n \"number\": \"<string>\",\n \"code\": \"<string>\"\n }\n ],\n \"related_clients\": [\n {\n \"related_client_id\": \"<string>\"\n }\n ],\n \"linked_contacts\": [\n {\n \"contact_id\": \"<string>\",\n \"include_in_appointment_notifications\": true,\n \"include_in_invoice_notifications\": true,\n \"include_in_progress_note_notifications\": true,\n \"note\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"profession": "<string>",
"email": "<string>",
"date_of_birth": "<string>",
"sex": "<string>",
"gender_identity": "<string>",
"pronouns": "<string>",
"privacy_policy_consent": "accepted",
"medications": [
{
"name": "<string>",
"dosage": "<string>"
}
],
"allergies": [
{
"name": "<string>",
"reaction": "<string>"
}
],
"intolerances": [
"<string>"
],
"emergency_contact_id": "<string>",
"emergency_contact_relationship": "<string>",
"notes": "<string>",
"alert": "<string>",
"referral_type_id": "<string>",
"referral_description": "<string>",
"referred_by_id": "<string>",
"phone_number": "<string>",
"phone_numbers": [
{
"id": "<string>",
"code": "<string>",
"number": "<string>",
"type": "<string>"
}
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
},
"tag_ids": [
"<string>"
],
"created_at": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}Path Parameters
The client ID
Body
accepted, rejected granted, declined online_booking, in_person, over_the_phone, paper_form 500Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
ClientResource
The client's unique identifier.
"cli_01HQFQ9QWTNNPY58FZ8CB3FWWK"
The client's honorific title.
"Ms"
The client's given name.
"Helen"
The client's family name.
"Keller"
The client's preferred name.
"Nell"
The client's profession or occupation.
"Teacher"
The client's email address.
"helen.keller@example.com"
The client's date of birth (ISO 8601).
"1987-06-27"
The client's sex assigned at birth.
"female"
The client's gender identity.
"Woman"
The client's pronouns.
"she/her"
The client's privacy policy consent status.
accepted, rejected "accepted"
The client's medications.
Show child attributes
Show child attributes
The client's allergies.
Show child attributes
Show child attributes
The client's intolerances.
["Gluten", "Lactose"]
The contact identifier for the emergency contact.
"con_01HQFQ9QWTNNPY58FZ8CB3FWWK"
The client's relationship to the emergency contact.
"Guardian"
The client's practitioner or admin notes.
"Client prefers morning appointments."
The client's alert message for staff.
"Requires wheelchair access."
The client's referral type identifier.
"ret_01J11QXSM53YENWF114C0MWGDJ"
The client's referral description.
"Referred by GP at City Clinic."
The client's referring entity identifier.
"cli_01HQQZCM1VDNHXDFEHX4X4KK52"
The client's primary phone number.
"+61400123456"
A list of the client's additional phone numbers.
Show child attributes
Show child attributes
[
{
"id": "pho_01HQR12PABCD1234EFGH56789",
"code": "+61",
"number": "400123456",
"type": "mobile"
}
]
The client's address details.
Show child attributes
Show child attributes
{
"line1": "123 Sample Street",
"line2": null,
"city": "Sydney",
"state": "NSW",
"postal_code": "2000",
"country_code": "AU"
}
The IDs of tags attached to the client.
[
"tag_01HYHYQHA682J0K1RW7B2HVA9F",
"tag_01HYHYW37MTYJPMT5JV4RN99GK"
]
The timestamp when the client was created (ISO 8601).
"2024-01-01T12:00:00Z"
curl --request POST \
--url https://api.caspen.com/v1/clients/{client} \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"profession": "<string>",
"email": "jsmith@example.com",
"date_of_birth": "2023-11-07T05:31:56Z",
"sex": "<string>",
"gender_identity": "<string>",
"pronouns": "<string>",
"emergency_contact_id": 123,
"emergency_contact_relationship": "<string>",
"invoice_contact_id": 123,
"notes": "<string>",
"alert": "<string>",
"referral_type_id": 123,
"referral_description": "<string>",
"referred_by_id": "<string>",
"phone_number": "<string>",
"intolerances": [
"<string>"
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"latitude": 0,
"longitude": 0,
"formatted_address_google_estimate": "<string>",
"place_id": "<string>"
},
"tag_ids": [
123
],
"ndis_details": {
"ndis_number": "<string>",
"plan_start_date": "2023-11-07T05:31:56Z",
"plan_end_date": "2023-11-07T05:31:56Z",
"plan_manager_id": 123,
"plan_nominee_id": 123,
"diagnoses": [
"<string>"
]
},
"medications": [
{
"name": "<string>",
"dosage": "<string>"
}
],
"allergies": [
{
"name": "<string>",
"reaction": "<string>"
}
],
"phone_numbers": [
{
"number": "<string>",
"code": "<string>"
}
],
"related_clients": [
{
"related_client_id": "<string>"
}
],
"linked_contacts": [
{
"contact_id": "<string>",
"include_in_appointment_notifications": true,
"include_in_invoice_notifications": true,
"include_in_progress_note_notifications": true,
"note": "<string>"
}
]
}
'import requests
url = "https://api.caspen.com/v1/clients/{client}"
payload = {
"title": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"profession": "<string>",
"email": "jsmith@example.com",
"date_of_birth": "2023-11-07T05:31:56Z",
"sex": "<string>",
"gender_identity": "<string>",
"pronouns": "<string>",
"emergency_contact_id": 123,
"emergency_contact_relationship": "<string>",
"invoice_contact_id": 123,
"notes": "<string>",
"alert": "<string>",
"referral_type_id": 123,
"referral_description": "<string>",
"referred_by_id": "<string>",
"phone_number": "<string>",
"intolerances": ["<string>"],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>",
"latitude": 0,
"longitude": 0,
"formatted_address_google_estimate": "<string>",
"place_id": "<string>"
},
"tag_ids": [123],
"ndis_details": {
"ndis_number": "<string>",
"plan_start_date": "2023-11-07T05:31:56Z",
"plan_end_date": "2023-11-07T05:31:56Z",
"plan_manager_id": 123,
"plan_nominee_id": 123,
"diagnoses": ["<string>"]
},
"medications": [
{
"name": "<string>",
"dosage": "<string>"
}
],
"allergies": [
{
"name": "<string>",
"reaction": "<string>"
}
],
"phone_numbers": [
{
"number": "<string>",
"code": "<string>"
}
],
"related_clients": [{ "related_client_id": "<string>" }],
"linked_contacts": [
{
"contact_id": "<string>",
"include_in_appointment_notifications": True,
"include_in_invoice_notifications": True,
"include_in_progress_note_notifications": True,
"note": "<string>"
}
]
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
first_name: '<string>',
last_name: '<string>',
preferred_name: '<string>',
profession: '<string>',
email: 'jsmith@example.com',
date_of_birth: '2023-11-07T05:31:56Z',
sex: '<string>',
gender_identity: '<string>',
pronouns: '<string>',
emergency_contact_id: 123,
emergency_contact_relationship: '<string>',
invoice_contact_id: 123,
notes: '<string>',
alert: '<string>',
referral_type_id: 123,
referral_description: '<string>',
referred_by_id: '<string>',
phone_number: '<string>',
intolerances: ['<string>'],
address: {
line1: '<string>',
line2: '<string>',
city: '<string>',
state: '<string>',
postal_code: '<string>',
country_code: '<string>',
latitude: 0,
longitude: 0,
formatted_address_google_estimate: '<string>',
place_id: '<string>'
},
tag_ids: [123],
ndis_details: {
ndis_number: '<string>',
plan_start_date: '2023-11-07T05:31:56Z',
plan_end_date: '2023-11-07T05:31:56Z',
plan_manager_id: 123,
plan_nominee_id: 123,
diagnoses: ['<string>']
},
medications: [{name: '<string>', dosage: '<string>'}],
allergies: [{name: '<string>', reaction: '<string>'}],
phone_numbers: [{number: '<string>', code: '<string>'}],
related_clients: [{related_client_id: '<string>'}],
linked_contacts: [
{
contact_id: '<string>',
include_in_appointment_notifications: true,
include_in_invoice_notifications: true,
include_in_progress_note_notifications: true,
note: '<string>'
}
]
})
};
fetch('https://api.caspen.com/v1/clients/{client}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.caspen.com/v1/clients/{client}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'first_name' => '<string>',
'last_name' => '<string>',
'preferred_name' => '<string>',
'profession' => '<string>',
'email' => 'jsmith@example.com',
'date_of_birth' => '2023-11-07T05:31:56Z',
'sex' => '<string>',
'gender_identity' => '<string>',
'pronouns' => '<string>',
'emergency_contact_id' => 123,
'emergency_contact_relationship' => '<string>',
'invoice_contact_id' => 123,
'notes' => '<string>',
'alert' => '<string>',
'referral_type_id' => 123,
'referral_description' => '<string>',
'referred_by_id' => '<string>',
'phone_number' => '<string>',
'intolerances' => [
'<string>'
],
'address' => [
'line1' => '<string>',
'line2' => '<string>',
'city' => '<string>',
'state' => '<string>',
'postal_code' => '<string>',
'country_code' => '<string>',
'latitude' => 0,
'longitude' => 0,
'formatted_address_google_estimate' => '<string>',
'place_id' => '<string>'
],
'tag_ids' => [
123
],
'ndis_details' => [
'ndis_number' => '<string>',
'plan_start_date' => '2023-11-07T05:31:56Z',
'plan_end_date' => '2023-11-07T05:31:56Z',
'plan_manager_id' => 123,
'plan_nominee_id' => 123,
'diagnoses' => [
'<string>'
]
],
'medications' => [
[
'name' => '<string>',
'dosage' => '<string>'
]
],
'allergies' => [
[
'name' => '<string>',
'reaction' => '<string>'
]
],
'phone_numbers' => [
[
'number' => '<string>',
'code' => '<string>'
]
],
'related_clients' => [
[
'related_client_id' => '<string>'
]
],
'linked_contacts' => [
[
'contact_id' => '<string>',
'include_in_appointment_notifications' => true,
'include_in_invoice_notifications' => true,
'include_in_progress_note_notifications' => true,
'note' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.caspen.com/v1/clients/{client}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"profession\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"date_of_birth\": \"2023-11-07T05:31:56Z\",\n \"sex\": \"<string>\",\n \"gender_identity\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"emergency_contact_id\": 123,\n \"emergency_contact_relationship\": \"<string>\",\n \"invoice_contact_id\": 123,\n \"notes\": \"<string>\",\n \"alert\": \"<string>\",\n \"referral_type_id\": 123,\n \"referral_description\": \"<string>\",\n \"referred_by_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"intolerances\": [\n \"<string>\"\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"formatted_address_google_estimate\": \"<string>\",\n \"place_id\": \"<string>\"\n },\n \"tag_ids\": [\n 123\n ],\n \"ndis_details\": {\n \"ndis_number\": \"<string>\",\n \"plan_start_date\": \"2023-11-07T05:31:56Z\",\n \"plan_end_date\": \"2023-11-07T05:31:56Z\",\n \"plan_manager_id\": 123,\n \"plan_nominee_id\": 123,\n \"diagnoses\": [\n \"<string>\"\n ]\n },\n \"medications\": [\n {\n \"name\": \"<string>\",\n \"dosage\": \"<string>\"\n }\n ],\n \"allergies\": [\n {\n \"name\": \"<string>\",\n \"reaction\": \"<string>\"\n }\n ],\n \"phone_numbers\": [\n {\n \"number\": \"<string>\",\n \"code\": \"<string>\"\n }\n ],\n \"related_clients\": [\n {\n \"related_client_id\": \"<string>\"\n }\n ],\n \"linked_contacts\": [\n {\n \"contact_id\": \"<string>\",\n \"include_in_appointment_notifications\": true,\n \"include_in_invoice_notifications\": true,\n \"include_in_progress_note_notifications\": true,\n \"note\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.caspen.com/v1/clients/{client}")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"profession\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"date_of_birth\": \"2023-11-07T05:31:56Z\",\n \"sex\": \"<string>\",\n \"gender_identity\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"emergency_contact_id\": 123,\n \"emergency_contact_relationship\": \"<string>\",\n \"invoice_contact_id\": 123,\n \"notes\": \"<string>\",\n \"alert\": \"<string>\",\n \"referral_type_id\": 123,\n \"referral_description\": \"<string>\",\n \"referred_by_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"intolerances\": [\n \"<string>\"\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"formatted_address_google_estimate\": \"<string>\",\n \"place_id\": \"<string>\"\n },\n \"tag_ids\": [\n 123\n ],\n \"ndis_details\": {\n \"ndis_number\": \"<string>\",\n \"plan_start_date\": \"2023-11-07T05:31:56Z\",\n \"plan_end_date\": \"2023-11-07T05:31:56Z\",\n \"plan_manager_id\": 123,\n \"plan_nominee_id\": 123,\n \"diagnoses\": [\n \"<string>\"\n ]\n },\n \"medications\": [\n {\n \"name\": \"<string>\",\n \"dosage\": \"<string>\"\n }\n ],\n \"allergies\": [\n {\n \"name\": \"<string>\",\n \"reaction\": \"<string>\"\n }\n ],\n \"phone_numbers\": [\n {\n \"number\": \"<string>\",\n \"code\": \"<string>\"\n }\n ],\n \"related_clients\": [\n {\n \"related_client_id\": \"<string>\"\n }\n ],\n \"linked_contacts\": [\n {\n \"contact_id\": \"<string>\",\n \"include_in_appointment_notifications\": true,\n \"include_in_invoice_notifications\": true,\n \"include_in_progress_note_notifications\": true,\n \"note\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.caspen.com/v1/clients/{client}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"first_name\": \"<string>\",\n \"last_name\": \"<string>\",\n \"preferred_name\": \"<string>\",\n \"profession\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"date_of_birth\": \"2023-11-07T05:31:56Z\",\n \"sex\": \"<string>\",\n \"gender_identity\": \"<string>\",\n \"pronouns\": \"<string>\",\n \"emergency_contact_id\": 123,\n \"emergency_contact_relationship\": \"<string>\",\n \"invoice_contact_id\": 123,\n \"notes\": \"<string>\",\n \"alert\": \"<string>\",\n \"referral_type_id\": 123,\n \"referral_description\": \"<string>\",\n \"referred_by_id\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"intolerances\": [\n \"<string>\"\n ],\n \"address\": {\n \"line1\": \"<string>\",\n \"line2\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"postal_code\": \"<string>\",\n \"country_code\": \"<string>\",\n \"latitude\": 0,\n \"longitude\": 0,\n \"formatted_address_google_estimate\": \"<string>\",\n \"place_id\": \"<string>\"\n },\n \"tag_ids\": [\n 123\n ],\n \"ndis_details\": {\n \"ndis_number\": \"<string>\",\n \"plan_start_date\": \"2023-11-07T05:31:56Z\",\n \"plan_end_date\": \"2023-11-07T05:31:56Z\",\n \"plan_manager_id\": 123,\n \"plan_nominee_id\": 123,\n \"diagnoses\": [\n \"<string>\"\n ]\n },\n \"medications\": [\n {\n \"name\": \"<string>\",\n \"dosage\": \"<string>\"\n }\n ],\n \"allergies\": [\n {\n \"name\": \"<string>\",\n \"reaction\": \"<string>\"\n }\n ],\n \"phone_numbers\": [\n {\n \"number\": \"<string>\",\n \"code\": \"<string>\"\n }\n ],\n \"related_clients\": [\n {\n \"related_client_id\": \"<string>\"\n }\n ],\n \"linked_contacts\": [\n {\n \"contact_id\": \"<string>\",\n \"include_in_appointment_notifications\": true,\n \"include_in_invoice_notifications\": true,\n \"include_in_progress_note_notifications\": true,\n \"note\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"title": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"preferred_name": "<string>",
"profession": "<string>",
"email": "<string>",
"date_of_birth": "<string>",
"sex": "<string>",
"gender_identity": "<string>",
"pronouns": "<string>",
"privacy_policy_consent": "accepted",
"medications": [
{
"name": "<string>",
"dosage": "<string>"
}
],
"allergies": [
{
"name": "<string>",
"reaction": "<string>"
}
],
"intolerances": [
"<string>"
],
"emergency_contact_id": "<string>",
"emergency_contact_relationship": "<string>",
"notes": "<string>",
"alert": "<string>",
"referral_type_id": "<string>",
"referral_description": "<string>",
"referred_by_id": "<string>",
"phone_number": "<string>",
"phone_numbers": [
{
"id": "<string>",
"code": "<string>",
"number": "<string>",
"type": "<string>"
}
],
"address": {
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"state": "<string>",
"postal_code": "<string>",
"country_code": "<string>"
},
"tag_ids": [
"<string>"
],
"created_at": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"errors": {}
}