Flow Examples
Components of Interaction
- Lead: Person whose details are being submitted.
- Client application: Website, app, or backend that collects lead information and calls the Patient Registry API.
- Trialbee Patient Registry API: Public REST API for creating lead records.
- Trialbee Honey: Internal Trialbee system where the lead is stored and processed.
Flow example
Sequence diagram
Visual example
1. Create lead
Create lead with POST /rest/v1/leads
Request
POST https://omniapi.trialbee.com/rest/v1/leads
Body (full example)
{
"tenantId": "tenant-12345",
"email": "user@example.com",
"consent": {
"timestamp": "2026-10-01T12:00:00Z",
"text": "I consent to the terms and conditions.",
"url": "https://example.com/consent"
},
"gender": "female",
"countryCode": "PT",
"locale": "pt-PT",
"postalCode": "12345"
}
Minimal valid example
{
"tenantId": "tenant-12345",
"email": "user@example.com",
"consent": {
"timestamp": "2026-10-01T12:00:00Z"
},
"gender": "unknown"
}
Successful response
{
"statusCode": 201,
"message": "Successful registration",
"person": {
"email": "user@example.com",
"phoneNumber": null,
"postalCode": "12345",
"therapeuticAreas": null,
"tenantId": "tenant-12345",
"consent": {
"text": "I consent to the terms and conditions.",
"timestamp": "2026-01-01T12:00:00Z"
},
"id": "id-12345",
"createdAt": "2026-02-22T14:03:35.838Z",
"updatedAt": "2026-02-22T14:03:35.838Z",
"lastConsent": {
"text": "I consent to the terms and conditions.",
"timestamp": "2026-01-01T12:00:00Z",
"person": {
"id": "person-12345"
},
"url": null,
"id": "01234"
},
"lead": {
"icdCodes": [],
"countryCode": "PT",
"languageCode": "pt",
"yearOfBirth": null,
"gender": "female",
"coordinates": null,
"id": "lead-12345",
"createdAt": "2026-01-22T14:03:35.838Z",
"updatedAt": "2026-01-22T14:03:35.838Z"
}
}
}
Outcome
- A new lead record is created in Trialbee Honey.