Afya-Health
  1. Patient
Afya-Health
  • Auth
    • Login
      POST
    • Signup
      POST
  • ForgotPassword
    • Verify OTP
      POST
    • ForgotPassword
      POST
    • ResetPassword
      POST
  • Profile
    • Get User Profile
      GET
    • Update user profile
      POST
  • Family Members
    • Add Family Member
      POST
    • Update Family Members
      PUT
    • Delete Family Member
      DELETE
  • Address
    • Get User address
      GET
    • Add Address
      POST
    • Update address
      PUT
    • Delete Address
      DELETE
  • Languages
    • List AppLabels
      GET
    • Add/Update Label
      POST
    • List Languages
      GET
  • Products
    • Get Products
      GET
    • Create Product
      POST
    • Update Product
      PUT
    • Delete Product
      DELETE
    • Update product items
      PUT
  • Permissions
    • Get Permissions
  • Config
    • List Practice Config
    • Add Update Config
    • List Master Config
    • Add Update Master Config
  • Appointment Schedule
    • Create Schedule
    • Update Schedule
    • Delete Schedule
    • Get Schedule by ID
    • Get Schedule list
  • Test Tags
    • Get Test Tags
    • Create Test Tag
    • Update Test Tag
    • Delete Test Tag
  • Test Parameters
    • Get Test Parameters
    • Create Test Parameters
    • Update Test Parameters
    • Delete Test Parameters
  • Category
    • Get Category
    • Create Category
    • Update Category
    • Delete Category
  • Device
    • Register Device
  • File
    • Upload File
  • Appointment
    • Create Appointment Order
    • Get Appointments List
    • Update Appointment Status
    • Get Appointment by ID
    • Get Appointment Slots
    • GetStartJourneyDirection
  • Reports
    • Upload Report
    • List All Reports
    • List Reports By Appointment
    • Delete Report
    • Update Report File
  • Staff
    • Add Staff Member
    • List Staff Member
    • Update Staff Member
    • Delete Staff Member
    • Get Staff member by ID
  • Patient
    • List Patients
      GET
    • Add Patient
      POST
    • Update Patient
      PUT
    • Delete Patient
      DELETE
    • Get patient by ID
      GET
  • Notifications
    • List User Notifications
    • Update Notification read status
  1. Patient

Add Patient

Developing
POST
/api/service/v1/user/patients

Request

Header Params
Accept
string 
optional
Example:
application/json
Content-Type
string 
optional
Example:
application/json
practice-code
string 
optional
Example:
DEFAULT
Authorization
string 
optional
Example:
{{token}}
Body Params application/json
first_name
string 
required
middle_name
string 
required
last_name
string 
required
email
string 
required
gender
string 
required
phone_primary
string 
required
country_code
string 
required
birth_date
string 
required
language_code
string 
required
image
string 
required
Example
{
    "first_name": "John",
    "middle_name": "Doe",
    "last_name": "Doe",
    "email": "john.doe28@example.com",
    "gender": "male",
    "phone_primary": "1234567890",
    "country_code": "123",
    "birth_date": "1990-01-01",
    "language_code": "en",
    "image" : "679b1661fa2cf444260082b6"
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://afyahealth.doctodoor.com:5600/api/service/v1/user/patients' \
--header 'Accept: application/json' \
--header 'practice-code: DEFAULT' \
--header 'Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3YjJkZmZlNWJmMjdlMzk1NTUzMjE0MyIsImVtYWlsIjoiZGVlcC5tYXJzb25pYUBwbGVuYXJ0ZWNoLmNvbSIsInN1YiI6IjY3YjJkZmZlNWJmMjdlMzk1NTUzMjE0MyIsImlhdCI6MTc0MTc4MjA4NCwiZXhwIjoxNzQ5NTU4MDg0fQ.KAMsweSbJPDxpLijKdjgp3YEFauw8KYLLumCBpqQfAA' \
--header 'Content-Type: application/json' \
--data-raw '{
    "first_name": "John",
    "middle_name": "Doe",
    "last_name": "Doe",
    "email": "john.doe28@example.com",
    "gender": "male",
    "phone_primary": "1234567890",
    "country_code": "123",
    "birth_date": "1990-01-01",
    "language_code": "en",
    "image" : "679b1661fa2cf444260082b6"
}'

Responses

🟢200Success
application/json
Body
error
boolean 
required
status_code
integer 
required
message
string 
required
data
object 
required
roles
array [object {8}] 
required
is_master_admin
integer 
required
is_temporary_password
integer 
required
is_deleted
integer 
required
is_active
integer 
required
deleted_at
null 
required
language_code
string 
required
family_members
array[string]
required
first_name
string 
required
middle_name
string 
required
last_name
string 
required
full_name
string 
required
gender
string 
required
email
string 
required
phone_primary
string 
required
country_code
string 
required
birth_date
string 
required
image
object 
required
created_at
string 
required
updated_at
string 
required
id
string 
required
Examples
{
    "error": false,
    "status_code": 200,
    "message": "Patient Added Successfully",
    "data": {
        "roles": [
            {
                "practice": "677bb5bd4291b96cd0623e93",
                "deleted_at": null,
                "is_deleted": 0,
                "name": "Patient",
                "slug": "patient",
                "created_at": "2025-01-06T10:51:41.295Z",
                "updated_at": "2025-01-06T10:51:41.295Z",
                "id": "677bb5bd4291b96cd0623e98"
            }
        ],
        "is_master_admin": 0,
        "is_temporary_password": 0,
        "is_deleted": 0,
        "is_active": 1,
        "deleted_at": null,
        "language_code": "en",
        "family_members": [],
        "first_name": "John",
        "middle_name": "Doe",
        "last_name": "Doe",
        "full_name": "John Doe Doe",
        "gender": "male",
        "email": "john.doe28@example.com",
        "phone_primary": "1234567890",
        "country_code": "123",
        "birth_date": "1990-01-01T00:00:00.000Z",
        "image": {
            "original_name": "Screenshot from 2025-01-09 19-15-40.png",
            "file_name": "public/profiles/646ff243-3775-448f-ab01-2ea318902417_1738217054924_Screenshot_from_2025-01-09_19-15-40.png",
            "path": "https://afyahealth.doctodoor.com.s3.us-east-1.amazonaws.com/public/profiles/646ff243-3775-448f-ab01-2ea318902417_1738217054924_Screenshot_from_2025-01-09_19-15-40.png",
            "size": 65614,
            "mimeType": "image/png",
            "created_at": "2025-01-30T06:04:17.668Z",
            "updated_at": "2025-01-30T06:04:17.668Z",
            "id": "679b1661fa2cf444260082b6",
            "media_url": "https://d3ektmb2e4ajpb.cloudfront.net/public/profiles/646ff243-3775-448f-ab01-2ea318902417_1738217054924_Screenshot_from_2025-01-09_19-15-40.png"
        },
        "created_at": "2025-01-30T06:35:03.657Z",
        "updated_at": "2025-01-30T06:35:03.657Z",
        "id": "679b1d975f2df04735ce8bd1"
    }
}
Previous
List Patients
Next
Update Patient
Built with