Internal
22 Internal routes on the FLAM API: Approve one invitation applicant after human confirmation; Research one applicant's safe public storefront; Ask.
Base URL https://api.flam.fashion. Send Authorization: Bearer flam_sk_… on every call; a handful of routes are session-only and say so. How keys and roles work.
POST /api/internal/analyst/actions/invitations/{id}/approve
Approve one invitation applicant after human confirmation
Uses a separate action credential, resolves the email from the pending application row, issues the existing idempotent platform invitation, and appends an Eve audit record.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string (uuid) | yes | — |
Request body — application/json
| Field | Type | Required | Notes |
|---|---|---|---|
reason | string | yes | — |
{
"reason": "string"
}Responses
| Status | Meaning |
|---|---|
200 | The applicant was invited, or already held the same invitation. |
401 | Missing or invalid action token |
404 | Unknown application |
409 | Application is no longer pending |
200 returns:
{}Call it
curl -X POST "https://api.flam.fashion/api/internal/analyst/actions/invitations/{id}/approve" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason":"string"}'POST /api/internal/analyst/actions/invitations/{id}/research
Research one applicant's safe public storefront
Resolves the stored applicant email and link, rejects social/private hosts, fetches only the public homepage and Shopify products endpoint, and persists bounded findings.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string (uuid) | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | Bounded storefront research. |
401 | Missing or invalid action token |
404 | Unknown application |
200 returns:
{}Call it
curl -X POST "https://api.flam.fashion/api/internal/analyst/actions/invitations/{id}/research" \
-H "Authorization: Bearer $FLAM_API_KEY"POST /api/internal/analyst/actions/recordings/{id}/summarize
Ask PostHog to analyze one session replay
Triggers PostHog's asynchronous single-session summary workflow with a bounded focus area. It does not return snapshots or enable public sharing.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string | yes | — |
Request body — application/json
| Field | Type | Required | Notes |
|---|---|---|---|
focusArea | string | yes | — |
{
"focusArea": "string"
}Responses
| Status | Meaning |
|---|---|
200 | PostHog accepted the replay for asynchronous analysis. |
401 | Missing or invalid action token |
503 | PostHog analysis is not configured |
200 returns:
{}Call it
curl -X POST "https://api.flam.fashion/api/internal/analyst/actions/recordings/{id}/summarize" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"focusArea":"string"}'GET /api/internal/analyst/assets/{id}/preview
Read one bounded asset thumbnail for visual analysis
Streams only an existing generated thumbnail after bearer authentication. It never lists R2 keys, serves originals, or grants bucket access.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string (uuid) | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | Thumbnail bytes |
401 | Missing or invalid analyst token |
404 | Unknown asset, deleted asset, missing thumbnail, or missing object |
Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/assets/{id}/preview" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/chat-quality
How the chat is doing — self-found lapses, and what it wished it could do
Aggregated chat shortfalls by code, with counts and a few example sentences. No identities, no transcripts.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Chat lapses and wishes, grouped. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/chat-quality" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/deliverability
Read email delivery outcomes for the FLAM analyst
Counts by delivery status and by template — never an address, a subject or a body. Only rows the delivery webhook has actually touched are counted: before its first write nothing updated a row, so older letters are frozen at 'sent' and would read as a perfect delivery rate.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Delivery outcomes, aggregate only. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/deliverability" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/experiments
Read bounded PostHog experiment state and aggregate results
Lists experiments or loads one experiment and runs its fixed aggregate metric queries. It cannot launch, pause, end, or ship a variant.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | limit | integer | no | — |
| query | status | "all" | "complete" | "draft" | "exposure_frozen" | "paused" | "running" | "stopped" | no | — |
| query | experimentId | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Experiment state and, for a selected experiment, aggregate results. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/experiments" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/failures
Read grouped recent failures for the FLAM analyst
Groups generation failures into stable signatures without returning job ids, user identities, prompts, or images.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Grouped generation failure patterns. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/failures" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/feature-flags
Read bounded PostHog feature flag state
Returns flag status, rollout configuration, variants, and experiment links without mutation capability or person evaluations.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | limit | integer | no | — |
| query | active | "true" | "false" | "all" | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Feature flag state, or an explicit unavailable state. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/feature-flags" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/funnel
Read FLAM's fixed acquisition and activation funnel
Runs a fixed PostHog query over FLAM's typed event catalog. No caller-supplied SQL, event properties, or person identities are returned.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Ordered funnel stages with event and actor counts. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/funnel" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/invitations
Read the bounded invitation applicant queue
Returns applicants, their intake answers, and the optional brand link for review. It cannot approve, decline, or modify an application.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
| query | limit | integer | no | — |
| query | status | "pending" | "invited" | "declined" | "all" | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Applicant queue. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/invitations" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/learnings
Read recent cross-house learnings for the FLAM analyst
Returns active house-level lessons, playbooks, outcome patterns, and image readings. Person memories and evidence identifiers are intentionally excluded.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
| query | limit | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Recent house-level learnings. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/learnings" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/longstory
Read Longstory lessons, interventions, evidence, and cost
Returns governed Longstory evidence for the platform or one explicitly selected house. Platform results suppress one-house themes; person memories, transcripts, prompts, and raw evidence are excluded.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
| query | limit | integer | no | — |
| query | organizationId | string | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Bounded Longstory proof and lessons. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/longstory" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/product-usage
Read bounded PostHog product usage for the FLAM analyst
Runs fixed aggregate HogQL queries. The caller cannot supply SQL, and the response contains event names and counts rather than event properties or identities.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Aggregate product analytics, or an explicit unavailable state. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/product-usage" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/recordings
Read bounded PostHog session replay metadata
Returns replay activity, error, URL, and summary metadata plus links for human review. It excludes person identity and raw recording payloads.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
| query | limit | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Recent session replay metadata, or an explicit unavailable state. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/recordings" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/recordings/{id}/analysis
Read PostHog's stored AI analysis of one session replay
Returns a bounded, identity-minimized PostHog replay summary and an authenticated human review link. It never returns raw snapshots or creates a public sharing link.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | Stored analysis, or an explicit not-yet-generated state. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/recordings/{id}/analysis" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/rejections
Read explicit generation rejection evidence
Returns explicit regenerate/delete gestures and low ratings with their judge context. Silent frames are never counted as rejection.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
| query | limit | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Recent explicit rejection evidence. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/rejections" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/snapshot
Read a bounded platform snapshot for the FLAM analyst
Read-only, bearer-gated aggregate operational, commercial, memory, and learning health. It returns no prompts, images, emails, person memories, or mutation capability.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Aggregate platform snapshot. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/snapshot" \
-H "Authorization: Bearer $FLAM_API_KEY"GET /api/internal/analyst/support
Read bounded PostHog support tickets
Returns recent support ticket content for the operating analyst. Ticket access is bounded and bearer-gated; replies and status changes are not exposed here.
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| query | hours | integer | no | — |
| query | limit | integer | no | — |
| query | ticketId | string | no | — |
| query | status | "new" | "open" | "pending" | "on_hold" | "resolved" | no | — |
Responses
| Status | Meaning |
|---|---|
200 | Recent tickets or one ticket thread. |
401 | Missing or invalid analyst token |
200 returns:
{}Call it
curl -X GET "https://api.flam.fashion/api/internal/analyst/support" \
-H "Authorization: Bearer $FLAM_API_KEY"POST /api/internal/replay-renders/{id}/complete
Store a completed replay video render
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string | yes | — |
Responses
| Status | Meaning |
|---|---|
200 | Render stored |
400 | Invalid render bytes or checksum |
401 | Invalid renderer credential |
404 | Claimed render not found |
200 returns:
{
"ok": true
}Call it
curl -X POST "https://api.flam.fashion/api/internal/replay-renders/{id}/complete" \
-H "Authorization: Bearer $FLAM_API_KEY"POST /api/internal/replay-renders/{id}/fail
Record a failed replay video render
Parameters
| In | Name | Type | Required | Notes |
|---|---|---|---|---|
| path | id | string | yes | — |
Request body — application/json (required)
| Field | Type | Required | Notes |
|---|---|---|---|
code | string | yes | — |
{
"code": "string"
}Responses
| Status | Meaning |
|---|---|
200 | Failure recorded |
401 | Invalid renderer credential |
404 | Claimed render not found |
200 returns:
{
"ok": true
}Call it
curl -X POST "https://api.flam.fashion/api/internal/replay-renders/{id}/fail" \
-H "Authorization: Bearer $FLAM_API_KEY" \
-H "Content-Type: application/json" \
-d '{"code":"string"}'POST /api/internal/replay-renders/claim
Claim one replay render job
Machine-only endpoint used by the scoped Hetzner renderer.
Responses
| Status | Meaning |
|---|---|
200 | A claimed job, or null when the queue is empty |
401 | Invalid renderer credential |
200 returns:
{
"job": {
"id": "string",
"evidenceId": "string",
"format": "mp4",
"archive": null
}
}Call it
curl -X POST "https://api.flam.fashion/api/internal/replay-renders/claim" \
-H "Authorization: Bearer $FLAM_API_KEY"