API Reference
REST API for the Rigicon Healthcare CRM. All patient data is stored encrypted using AES-256-GCM across two isolated databases. Authenticated endpoints require a JWT Bearer token.
https://rigicon.per10.net
/api/login
Login
Authenticate with email and password. Returns a JWT token valid for 3600 seconds. Pass this token as a Bearer token in all subsequent requests.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| string | required | User email address | |
| password | string | required | User password |
/api/patients
Auth required
List Patients
Returns a paginated list of all non-deleted patients. PII fields (name, email, phone) are decrypted on the fly. Supports full-text search across name and email.
Query Parameters
| Parameter | Type | Description | |
|---|---|---|---|
| search | string | optional | Filter by name or email (case-insensitive) |
| page | integer | optional | Page number. Default: 1 |
| per_page | integer | optional | Results per page. Default: 20, Max: 100 |
/api/patients
Auth required
Create Patient
Registers a new patient. Name, email and phone are encrypted with AES-256-GCM before storage. The email HMAC hash is stored separately for lookup without decrypting.
Request Body
| Field | Type | Description | |
|---|---|---|---|
| name | string | required | Patient full name. Max 255 chars. |
| string | required | Valid email address. | |
| phone | string | optional | Phone number in any format. |
/api/patients/{id}
Auth required
Get Patient
Retrieves a single patient by ID. PII fields are fetched from the PII database and decrypted on the fly. Soft-deleted patients return 404.
Path Parameters
| Parameter | Type | Description | |
|---|---|---|---|
| id | string | required | Patient UUID (hex string) |
/api/patients/{id}
Auth required
Update Patient
Partially updates a patient record. Only provided fields are updated. PII fields (name, email, phone) are re-encrypted on update. Email hash is recalculated if email changes.
Request Body
| Field | Type | Description | |
|---|---|---|---|
| name | string | optional | New name — re-encrypted |
| string | optional | New email — re-encrypted, hash updated | |
| phone | string | optional | New phone — re-encrypted |
| status | string | optional | active · inactive · archived |
/api/patients/{id}
Auth required
Delete Patient
Soft-deletes a patient by setting deleted_at. The patient is excluded from all queries but PII data is retained in the PII database for audit compliance.
Soft Delete Only
Records are never permanently deleted. PII is preserved in rigicon_pii even after deletion.
/api/health
Health Check
No authentication required. Returns server status and PHP version.
Error Reference
| Status | Meaning | Body |
|---|---|---|
| 200 | OK | Requested data |
| 201 | Created | New resource |
| 204 | No Content | Empty |
| 400 | Bad Request | {"error": "message"} |
| 401 | Unauthorized | {"error": "Unauthorized: Token missing"} |
| 404 | Not Found | {"error": "Patient not found"} |
| 422 | Validation Error | {"errors": ["Name is required"]} |