Criar paciente
Cria a ficha com as regras do cadastro da clínica: nome, WhatsApp e e-mail são obrigatórios; quem tem menos de 18 anos vem com o responsável legal; CPF com dígito; documento estrangeiro para quem não tem CPF. CPF repetido é 409 com o id da ficha que já existe.
Escopo do app: patients:write. Pelo OAuth, vale o perfil da pessoa.
curl --request POST \
--url https://api.westhetics.io/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Amanda Ribeiro Costa",
"whatsapp": "11987654321",
"email": "amanda@email.com",
"docNumber": "44595830890"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Amanda Ribeiro Costa',
whatsapp: '11987654321',
email: 'amanda@email.com',
docNumber: '44595830890'
})
};
fetch('https://api.westhetics.io/v1/patients', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.westhetics.io/v1/patients"
payload = {
"name": "Amanda Ribeiro Costa",
"whatsapp": "11987654321",
"email": "amanda@email.com",
"docNumber": "44595830890"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"audience": "patient",
"status": "active",
"name": "Amanda Ribeiro Costa",
"birthDate": "1992-04-18",
"isMinor": false,
"docType": "cpf",
"docNumber": "44595830890",
"foreignDocument": null,
"rg": null,
"gender": "female",
"maritalStatus": "married",
"occupation": "Arquiteta",
"email": "amanda@email.com",
"whatsapp": "+5511987654321",
"address": {
"postalCode": "01310100",
"street": "Avenida Paulista",
"number": "1000",
"complement": "apto 52",
"district": "Bela Vista",
"city": "São Paulo",
"state": "SP",
"country": "BR"
},
"guardian": null,
"imageConsent": "yes",
"instagram": "amanda.ribeiro",
"referralSource": {
"channel": "instagram",
"detail": null
},
"notes": null,
"patientSince": "2026-10-15",
"selfRegisteredAt": null,
"mergedIntoId": null,
"createdAt": "2026-10-15T14:30:00Z",
"updatedAt": "2026-10-15T14:30:00Z",
"archivedAt": null
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}Autorizações
A chave do app de integração, criada em Integrações. Escopos: patients:read (Listar, buscar e ler pacientes; os eventos patient..); patients:write (Criar e editar pacientes. Inclui ler.); anamneses:read (Listar e ler anamneses, sem as respostas; os eventos anamnesis..); anamneses:write (Enviar, reenviar e cancelar anamnese. Inclui ler.); anamneses:answers (Ler as respostas da anamnese preenchida. É dado de saúde.); documents:read (Atendimentos, documentos, status da assinatura e o PDF; os eventos appointment.* e signature_request.*.); documents:write (Gerar contrato e termos e enviar para assinatura, reenviar e cancelar. Inclui ler.); catalog:read (Procedimentos, prestadores e modelos de documento da clínica.); webhooks:write (Criar, alterar e remover os webhooks do próprio app pela API.)
Cabeçalhos
Corpo
curl --request POST \
--url https://api.westhetics.io/v1/patients \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Amanda Ribeiro Costa",
"whatsapp": "11987654321",
"email": "amanda@email.com",
"docNumber": "44595830890"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Amanda Ribeiro Costa',
whatsapp: '11987654321',
email: 'amanda@email.com',
docNumber: '44595830890'
})
};
fetch('https://api.westhetics.io/v1/patients', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.westhetics.io/v1/patients"
payload = {
"name": "Amanda Ribeiro Costa",
"whatsapp": "11987654321",
"email": "amanda@email.com",
"docNumber": "44595830890"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"audience": "patient",
"status": "active",
"name": "Amanda Ribeiro Costa",
"birthDate": "1992-04-18",
"isMinor": false,
"docType": "cpf",
"docNumber": "44595830890",
"foreignDocument": null,
"rg": null,
"gender": "female",
"maritalStatus": "married",
"occupation": "Arquiteta",
"email": "amanda@email.com",
"whatsapp": "+5511987654321",
"address": {
"postalCode": "01310100",
"street": "Avenida Paulista",
"number": "1000",
"complement": "apto 52",
"district": "Bela Vista",
"city": "São Paulo",
"state": "SP",
"country": "BR"
},
"guardian": null,
"imageConsent": "yes",
"instagram": "amanda.ribeiro",
"referralSource": {
"channel": "instagram",
"detail": null
},
"notes": null,
"patientSince": "2026-10-15",
"selfRegisteredAt": null,
"mergedIntoId": null,
"createdAt": "2026-10-15T14:30:00Z",
"updatedAt": "2026-10-15T14:30:00Z",
"archivedAt": null
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}{
"error": {
"code": "bad_request",
"message": "<string>",
"requestId": "<string>",
"fields": {}
}
}