Skip to Content
API ReferencePlatform API

Platform API

The Platform API is an internal API within my-loop-health used by the admin dashboard and command center for cross-service operations. It uses API key authentication instead of Clerk JWTs.

Base URL: https://my.loop.health/api/platform

Authentication: API key in the request header or query parameter.


Customer Profiles

Get Profile by Clerk User ID

curl -X GET "https://my.loop.health/api/platform/profiles/:clerkUserId" \ -H "x-api-key: $PLATFORM_API_KEY"

Returns the customer profile including subscription tier, linked accounts, and metadata.

Sync Intake Data

curl -X POST "https://my.loop.health/api/platform/profiles/:clerkUserId/sync-intake" \ -H "x-api-key: $PLATFORM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "intakeData": { "conditions": ["hypertension"], "medications": ["lisinopril"], "goals": ["longevity", "recovery"] } }'

Protocol Stacks

List Stacks

curl -X GET "https://my.loop.health/api/platform/stacks" \ -H "x-api-key: $PLATFORM_API_KEY"

Create Stack from Template

curl -X POST "https://my.loop.health/api/platform/stacks/from-template" \ -H "x-api-key: $PLATFORM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "templateId": "template_abc", "clerkUserId": "user_clerk_123" }'

Get Stacks by User

curl -X GET "https://my.loop.health/api/platform/stacks/by-user/:clerkId" \ -H "x-api-key: $PLATFORM_API_KEY"

Manage Stack Items

# Get stack details curl -X GET "https://my.loop.health/api/platform/stacks/:id" \ -H "x-api-key: $PLATFORM_API_KEY" # Update stack items curl -X PUT "https://my.loop.health/api/platform/stacks/:id/items" \ -H "x-api-key: $PLATFORM_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "items": [...] }' # Manage cycle curl -X POST "https://my.loop.health/api/platform/stacks/:id/cycle" \ -H "x-api-key: $PLATFORM_API_KEY"

User Management

Get User Details

curl -X GET "https://my.loop.health/api/platform/user/:clerkId" \ -H "x-api-key: $PLATFORM_API_KEY"

Get Customer by Email

curl -X GET "https://my.loop.health/api/platform/customers/by-email/:email" \ -H "x-api-key: $PLATFORM_API_KEY"

Get Customer Stacks

curl -X GET "https://my.loop.health/api/platform/customers/:clerkUserId/stacks" \ -H "x-api-key: $PLATFORM_API_KEY"

Analytics

Adherence Analytics

curl -X GET "https://my.loop.health/api/platform/analytics/adherence" \ -H "x-api-key: $PLATFORM_API_KEY"

Returns aggregated protocol adherence metrics across all users.

User Activity

curl -X GET "https://my.loop.health/api/platform/activity/:clerkId" \ -H "x-api-key: $PLATFORM_API_KEY"

Returns recent activity for a specific user.


curl -X GET "https://my.loop.health/api/platform/products/search?q=bpc-157" \ -H "x-api-key: $PLATFORM_API_KEY"

Searches the product catalog by name, SKU, or category.