introduction

Welcome to the API documentation! Our API conforms to the REST architectural style, emphasizing principles like statelessness and a uniform interface for resource interaction.

The API communicates using application/json format, ensuring compatibility with various programming languages and platforms, and all interactions are secured via HTTPS (Hypertext Transfer Protocol Secure) to maintain data confidentiality and integrity.

Each marketplace created is issued a unique API key. Depending on the mode (live or test) in which the platform was created, the scope of the API key will be restricted to that specific mode. API keys must be passed in the request headers as Bearer tokens for authentication and authorization purposes.

To facilitate a smooth developer experience, we strive to maintain consistency and backward compatibility across different API versions, helping ensure seamless transitions and minimizing disruptions to existing integrations.

You can access the API using the base URL https://api.candle.so/:version, which provides a clear and standardized entry point for making API requests. Be sure to specify the correct version in the URL and include your API key in the request headers to successfully interact with the API.

authentication

Authentication

Authentication for our API is conducted using API keys, which are passed in the request headers for each API call. Depending on whether your platform is in test mode or live mode, the corresponding API key should be included in the Authorization header as a Bearer token.

Header Format

Ensure that the Authorization header follows this format:

  • Test Mode: Authorization: Bearer ambient_test_xxx

  • Live Mode: Authorization: Bearer ambient_live_xxx

date formats

Date Formats

Dates within the API are consistently formatted using the UTC ISO standard (YYYY-MM-DDTHH:MM:SSZ), ensuring uniformity and ease of interpretation across different systems and time zones.

Internally, dates are stored in UTC ISO format, having been converted from the user's preferred timezone to maintain consistency and prevent discrepancies in date representations.

When working with user-specific data, the API respects individual timezone preferences stored in user profiles. All datetime fields such as effective_datetime, issued_datetime, and created timestamps maintain their UTC format while allowing client applications to handle timezone conversion based on user preferences.

error handling

Error Handling

Error handling within the API relies on standard HTTP response codes, allowing developers to identify the nature of the error encountered during API interactions.

In addition to HTTP response codes, errors received from third-party integrations, such as Stripe, are passed along to provide detailed insights into the root cause of issues related to external services.

Guides
Coming Soon, guides to help you get started

Magic Link Authentication

Request a magic link via email

Parameters:

No parameters
POST
/auth/otp/request
The Response
{}

Verify OTP

Verifies a one-time password and returns access tokens

Parameters:

No parameters
POST
/auth/otp/verify
The Response
{}

Refresh Session

Refreshes authentication tokens using a refresh token

Parameters:

No parameters
POST
/auth/refresh
The Response
{}

Sign In With Password

Authenticates a user using their email and password, returning access and refresh tokens on success.

Parameters:

No parameters
POST
/auth/signin
The Response
{}

Sign Up With Password

Creates a new user account using email and password authentication, returning access and refresh tokens on success.

Parameters:

No parameters
POST
/auth/signup
The Response
{}

Delete an authenticated user's account

Permanently deletes the currently authenticated user's account and all associated data including profiles, medical records, chats, and family connections. This action cannot be undone.

Parameters:

No parameters
DELETE
/auth/user
The Response
{}

Get Current User

Retrieves the current authenticated user's information including profile data, preferences, and settings

Parameters:

No parameters
GET
/auth/user
The Response
{}

List User Chats (Admin)

Lists all chats for a specific user. Accessible by admins or the user themselves.

Parameters:

No parameters
GET
/chats
The Response
{}

Create Chat (Admin)

Creates a new chat for a specific user. Accessible by admins or the user themselves.

Parameters:

No parameters
POST
/chats
The Response
{}

Mark Message as Read

Updates the read timestamp for a message

Parameters:

No parameters
PUT
/chats/messages/:message_id/read
The Response
{}

Get Next Questionnaire Question

Gets the next unanswered question from the default questionnaire and sends it to the user's chat

Parameters:

No parameters
GET
/chats/profile/:profile_id/questionnaire
The Response
{}

Get Chat Details (Admin)

Gets a specific chat with all its messages. Accessible by admins or chat members.

Parameters:

No parameters
GET
/chats/:id
The Response
{}

List All Families

Returns a paginated list of families with member counts (admin only)

Parameters:

No parameters
GET
/families
The Response
{}

Create Family

Creates a new family with user as admin

Parameters:

No parameters
POST
/families
The Response
{}

Get User's Families

Retrieves all families that a specific user is a member of (authenticated users only)

Parameters:

No parameters
GET
/families/user/:user_id
The Response
{}

Get Family by ID

Retrieves a specific family with member information

Parameters:

No parameters
GET
/families/:id
The Response
{}

Update Family

Updates family information (admin only)

Parameters:

No parameters
PUT
/families/:id
The Response
{}

Send Family Invitation

Sends an email invitation to join a family

Parameters:

No parameters
POST
/families/:id/invite
The Response
{}

Join Family with Invitation

Processes a request to join a family using an invitation token

Parameters:

No parameters
POST
/families/:id/join
The Response
{}

Get Family Members with Wearable Data

Retrieves all members of a specific family with their wearable data (admin or family members only)

Parameters:

No parameters
GET
/families/:id/member
The Response
{}

Add Family Member

Creates a new profile and adds them as a member to the specified family (family members only)

Parameters:

No parameters
POST
/families/:id/member
The Response
{}

Remove Family Member

Removes a member from a family unit

Parameters:

No parameters
DELETE
/families/:id/member/:member_id
The Response
{}

Update Family Member

Updates family member information such as age and relationship

Parameters:

No parameters
PUT
/families/:id/member/:member_id
The Response
{}

Get Family Member Epic Medical Records

Retrieves Epic medical records for a specific family member (admin or family members only)

Parameters:

No parameters
GET
/families/:id/member/:member_id/medical_records/epic
The Response
{}

Get Family Member Particle Medical Records

Retrieves Particle medical records for a specific family member (admin or family members only)

Parameters:

No parameters
GET
/families/:id/member/:member_id/medical_records/particle
The Response
{}

Get Family Member Questionnaire

Retrieves a specific questionnaire for a family member including progress data

Parameters:

No parameters
GET
/families/:id/member/:member_id/questionnaire/:questionnaire_id
The Response
{}

Get Questionnaire Completion Status

Returns completion status and progress metrics for a family member's questionnaire

Parameters:

No parameters
GET
/families/:id/member/:member_id/questionnaire/:questionnaire_id/completion
The Response
{}

Submit Audio Answer for Family Member

Submits an audio-based answer to a questionnaire slide for a family member

Parameters:

No parameters
POST
/families/:id/member/:member_id/questionnaire/:questionnaire_id/section/:section_id/slide/:slide_id/audio
The Response
{}

Submit Text Answer for Family Member

Submits a text-based answer to a questionnaire slide for a family member

Parameters:

No parameters
POST
/families/:id/member/:member_id/questionnaire/:questionnaire_id/section/:section_id/slide/:slide_id/text
The Response
{}

Associate Profile with Family

Associates an existing user profile with a family unit

Parameters:

No parameters
POST
/families/:id/profile/:profile_id
The Response
{}

List All Partners

Returns a paginated list of partners with status (admin only)

Parameters:

No parameters
GET
/partners
The Response
{}

Create Partner

Creates new partner account with default questionnaire and client keys (admin only)

Parameters:

No parameters
POST
/partners
The Response
{}

Get Partner by ID

Retrieves a specific partner with associated users (admin only)

Parameters:

No parameters
GET
/partners/:id
The Response
{}

Update Partner

Updates partner information (admin only)

Parameters:

No parameters
PUT
/partners/:id
The Response
{}

Deactivate Partner

Soft deactivates a partner account (admin only)

Parameters:

No parameters
PUT
/partners/:id/deactivate
The Response
{}

Set Active Questionnaire for Partner

Sets a specific questionnaire as active for a partner (admin only)

Parameters:

No parameters
PUT
/partners/:id/questionnaire/:questionnaire_id/active
The Response
{}

Remove User-Partner Association

Removes association between user and partner

Parameters:

No parameters
DELETE
/partners/:id/user/:user_id
The Response
{}

Associate User with Partner

Creates association between user and partner

Parameters:

No parameters
POST
/partners/:id/user/:user_id
The Response
{}

List All Profiles

Returns a paginated list of profiles with user associations (admin only)

Parameters:

No parameters
GET
/profiles
The Response
{}

Accept Terms

Records the authenticated user's acceptance of healthcare terms and conditions by updating their profile's terms_accepted timestamp. No request body required - automatically applies to the authenticated user.

Parameters:

No parameters
PUT
/profiles/terms
The Response
{}

Get Profile by User ID

Retrieves comprehensive profile information including onboarding status by user ID (admin or owner only)

Parameters:

No parameters
GET
/profiles/user/:user_id
The Response
{}

Get Profile by ID

Retrieves a specific profile with user information

Parameters:

No parameters
GET
/profiles/:id
The Response
{}

Update Profile

Updates profile information with partial update support

Parameters:

No parameters
PUT
/profiles/:id
The Response
{}

Sync Device

Register or update device information for push notifications. Only the profile owner can sync their devices.

Parameters:

No parameters
POST
/profiles/:id/devices/sync
The Response
{}

Update Profile Onboarding Step

Updates the status of a specific onboarding step for a profile (admin only)

Parameters:

No parameters
PUT
/profiles/:id/onboarding/:step
The Response
{}

Get Profile Summary

Retrieves AI-generated summary for a profile

Parameters:

No parameters
GET
/profiles/:id/summary
The Response
{}

Generate Profile Summary

Triggers AI generation of profile summary

Parameters:

No parameters
POST
/profiles/:id/summary
The Response
{}

List All Questionnaires

Returns a paginated list of questionnaires with filtering and sorting

Parameters:

No parameters
GET
/questionnaires
The Response
{}

Create Questionnaire

Creates a new custom questionnaire

Parameters:

No parameters
POST
/questionnaires
The Response
{}

Get Default Questionnaire

Retrieves the default active questionnaire. If partner_id is provided, returns the partner's default questionnaire, otherwise returns the global default questionnaire.

Parameters:

No parameters
GET
/questionnaires/default
The Response
{}

Create Default Questionnaire

Creates a system-wide default questionnaire with standard sections and slides (one per partner or global)

Parameters:

No parameters
POST
/questionnaires/default
The Response
{}

Submit Audio Answer to Slide

Submit an audio answer to a questionnaire slide (admin can answer on behalf of users)

Parameters:

No parameters
POST
/questionnaires/slides/:slide_id/answer/audio
The Response
{}

Submit Text Answer to Slide

Submit a text answer to a questionnaire slide (admin can answer on behalf of users)

Parameters:

No parameters
POST
/questionnaires/slides/:slide_id/answer/text
The Response
{}

Delete Questionnaire

Deletes a questionnaire and all associated sections and slides (admin only)

Parameters:

No parameters
DELETE
/questionnaires/:id
The Response
{}

Get Questionnaire by ID

Retrieves a specific questionnaire with all sections and slides

Parameters:

No parameters
GET
/questionnaires/:id
The Response
{}

Set Questionnaire Active State

Sets a questionnaire as active or inactive for a partner or globally (admin only). Only 1 questionnaire per scope can be active.

Parameters:

No parameters
PUT
/questionnaires/:id/active
The Response
{}

Get User Questionnaire Responses

Retrieves all responses for a specific questionnaire and profile (admin or profile owner only)

Parameters:

No parameters
GET
/questionnaires/:id/profile/:profile_id/responses
The Response
{}

Add Section to Questionnaire

Adds a new section to an existing questionnaire

Parameters:

No parameters
POST
/questionnaires/:id/section
The Response
{}

Delete Section

Deletes a section and all associated slides (admin only)

Parameters:

No parameters
DELETE
/questionnaires/:id/section/:section_id
The Response
{}

Update Section

Updates a questionnaire section

Parameters:

No parameters
PUT
/questionnaires/:id/section/:section_id
The Response
{}

Reorder Questionnaire Section

Updates the display order of a section within a questionnaire (admin or partner only)

Parameters:

No parameters
PUT
/questionnaires/:id/section/:section_id/reorder
The Response
{}

Add Slide to Section

Adds a new slide to a specific section within a questionnaire

Parameters:

No parameters
POST
/questionnaires/:id/section/:section_id/slide
The Response
{}

Delete Slide

Deletes a questionnaire slide (admin only)

Parameters:

No parameters
DELETE
/questionnaires/:id/section/:section_id/slide/:slide_id
The Response
{}

Update Slide

Updates a questionnaire slide

Parameters:

No parameters
PUT
/questionnaires/:id/section/:section_id/slide/:slide_id
The Response
{}

Reorder Questionnaire Slide

Updates the display order of a slide within a section (admin or partner only)

Parameters:

No parameters
PUT
/questionnaires/:id/section/:section_id/slide/:slide_id/reorder
The Response
{}

List All Users

Returns a paginated list of users with filtering and sorting

Parameters:

No parameters
GET
/users
The Response
{}

Create User via Auth

Creates a new user via Supabase Auth (admin only)

Parameters:

No parameters
POST
/users
The Response
{}

Find User By Email

Retrieves a user by their email address (case-insensitive)

Parameters:

No parameters
GET
/users/email/:email
The Response
{}

Delete User (Hard Delete)

Permanently deletes user account and all associated data (admin only)

Parameters:

No parameters
DELETE
/users/:id
The Response
{}

Get User by ID

Retrieves specific user with profile information (admin only)

Parameters:

No parameters
GET
/users/:id
The Response
{}

Update User

Updates user information (admin only)

Parameters:

No parameters
PUT
/users/:id
The Response
{}

Deactivate User

Soft deactivates user account preventing login (admin only)

Parameters:

No parameters
PUT
/users/:id/deactivate
The Response
{}

List User Documents

Retrieves all documents for a specific user (admin or owner only)

Parameters:

No parameters
GET
/users/:id/documents
The Response
{}

Upload User Document

Uploads a document for a specific user (admin or owner only)

Parameters:

No parameters
POST
/users/:id/documents
The Response
{}

Download User Document

Generates a secure download URL for a user's document (admin or owner only)

Parameters:

No parameters
GET
/users/:id/documents/download
The Response
{}

Delete User Document

Deletes a specific document for a user (admin or owner only)

Parameters:

No parameters
DELETE
/users/:id/documents/:document_id
The Response
{}

Get User's Epic Medical Records

Retrieves all Epic medical records (labs, medications, vitals) for a specific user (admin or owner only)

Parameters:

No parameters
GET
/users/:id/medical_records/epic
The Response
{}

Get User's Particle Medical Records

Retrieves all Particle medical records for a specific user (admin or owner only)

Parameters:

No parameters
GET
/users/:id/medical_records/particle
The Response
{}

Sync Particle Health Records

Syncs medical records from Particle Health for a specific user (admin or owner only)

Parameters:

No parameters
POST
/users/:id/medical_records/particle/sync
The Response
{}

Get User Questionnaire Completion

Retrieves completion status and progress for a user's questionnaire

Parameters:

No parameters
GET
/users/:id/questionnaire/:questionnaire_id/completion
The Response
{}

Update User Role

Updates a user's role (admin, user)

Parameters:

No parameters
PUT
/users/:id/role
The Response
{}

Wearables

Get Wearable Data

Retrieves comprehensive wearable device health and fitness data for the authenticated user, providing detailed insights from connected fitness trackers, smartwatches, health monitors, and IoT wellness devices. This endpoint aggregates multi-dimensional health metrics including step counts, heart rate measurements, sleep patterns, calorie expenditure, activity levels, blood oxygen saturation, stress indicators, and other biometric data collected from various wearable devices and health monitoring systems. Users can filter data by specific date ranges to analyze health trends over time, focus on particular metric types for targeted health analysis, and access historical data for comprehensive wellness tracking and medical assessment. The system maintains complete data provenance including source device information, measurement timestamps, and metadata about data collection conditions, enabling healthcare providers and AI health assistants to deliver personalized medical recommendations based on objective health data. Essential for continuous health monitoring, chronic disease management, fitness goal tracking, sleep quality assessment, cardiovascular health analysis, and providing AI health assistants with real-time biometric data for personalized medical guidance and wellness coaching tailored to individual health patterns and activity levels.

Parameters:

No parameters
GET
/wearables
The Response
{}

Get Wearable Data

Get wearable data for authenticated user with optional date range

Parameters:

No parameters
GET
/wearables/public
The Response
{}

Submit Wearable Data

Submits, synchronizes, or updates wearable device health and fitness data for specific metric types, enabling comprehensive health monitoring and AI-powered medical analysis through seamless device integration. This endpoint supports idempotent data submission from various wearable devices including fitness trackers, smartwatches, continuous glucose monitors, blood pressure cuffs, smart scales, and other IoT health devices, automatically handling duplicate data detection and conflict resolution. Users can submit complex health metrics such as step counts, heart rate variability, sleep stages, calorie expenditure, blood oxygen levels, stress measurements, activity intensities, and other biometric data with complete temporal accuracy and device attribution. The system maintains comprehensive data integrity through timezone-aware timestamp processing, source device tracking, and metadata preservation for clinical accuracy. When no new data is submitted, the endpoint intelligently returns existing historical data for the specified date range, enabling applications to synchronize device data and maintain consistent health tracking. Essential for continuous health monitoring integration, chronic disease management through objective data collection, fitness goal tracking with real-time progress updates, and providing AI health assistants with accurate biometric data for personalized medical recommendations, wellness coaching, and health trend analysis based on comprehensive wearable device data streams.

Parameters:

metric_type
string
The type of metric being submitted (steps, heart_rate, sleep, calories, etc.)
POST
/wearables/:metric_type
The Response
{}

Webhook

Was this helpful?
Yes
No

Endpoints

Webhook

Webhook endpoint that accepts any payload, logs it, and responds with 200.

Parameters:

No parameters
POST
/webhook
The Response
{}