FLAM

Support

4 Support routes on the FLAM API: Record a support chat that needed a human; The tickets this director has raised; Raise a support ticket, or reply on one.

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/support/escalations

Record a support chat that needed a human

Machine door for FLAM's self-hosted Krispy support Worker. Opens a ticket in the same help desk the studio's ticket form writes to, carrying the transcript and — when the caller knows the house — the plan, the spendable balance and the last develop, read off the database HERE rather than taken from the body. Authenticated by a shared secret in x-krispy-bridge-secret, not by a session: the caller is a Worker.

Parameters

InNameTypeRequiredNotes
headerx-krispy-bridge-secretstringyes

Request bodyapplication/json

FieldTypeRequiredNotes
reason"handoff" | "turn_limit" | "ai_down" | "leak_guard" | "requested"yes
sessionIdstringyes
organizationIdstring (uuid)no
contactEmailstring (email)no
transcriptobject[]no
{
  "reason": "handoff",
  "sessionId": "k_8f3a12c0",
  "organizationId": "00000000-0000-0000-0000-000000000000",
  "contactEmail": "string",
  "transcript": []
}

Responses

StatusMeaning
201The ticket the conversation became.
401Wrong or missing shared secret.
503The bridge is not configured in this environment, or the desk is unreachable.

201 returns:

{
  "id": "string",
  "status": "open",
  "summary": "string",
  "messageCount": 0,
  "unreadCount": 0,
  "createdAt": "string",
  "lastMessageAt": "string"
}

Call it

curl -X POST "https://api.flam.fashion/api/support/escalations" \
  -H "Authorization: Bearer $FLAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason":"handoff","sessionId":"k_8f3a12c0","organizationId":"00000000-0000-0000-0000-000000000000","contactEmail":"string","transcript":[]}'

GET /api/toolkit/support/tickets

The tickets this director has raised

Newest first, open and closed together, read from FLAM's help desk under a verified identity — so a director's threads follow their account rather than the browser they opened them in.

Responses

StatusMeaning
200Every ticket this director has raised.
401Signed out
503The desk is unreachable.

200 returns:

{
  "tickets": [
    {
      "id": "string",
      "status": "open",
      "summary": "string",
      "messageCount": 0,
      "unreadCount": 0,
      "createdAt": "string",
      "lastMessageAt": "string"
    }
  ]
}

Call it

curl -X GET "https://api.flam.fashion/api/toolkit/support/tickets" \
  -H "Authorization: Bearer $FLAM_API_KEY"

POST /api/toolkit/support/tickets

Raise a support ticket, or reply on one

Opens a ticket in FLAM's help desk (PostHog Support) on behalf of the acting house. The plan, the spendable balance and the last develop are read off the database HERE and attached to the message — the director never describes their own account, and what reaches us is measured rather than remembered. Pass ticketId to reply on an existing thread instead. Any role may raise one, viewer included: asking for help is not spending.

Request bodyapplication/json

FieldTypeRequiredNotes
topic"develop" | "billing" | "identity" | "quality" | "access" | "api" | "other"no
subjectstringyes
bodystringyes
contactEmailstring (email)no
currentUrlstringno
ticketIdstringno
{
  "topic": "develop",
  "subject": "The lookbook stopped at frame three",
  "body": "Ran a five-frame look at 2K. Three came back, the last two never did, and the balance looks the same as before I started.",
  "contactEmail": "string",
  "currentUrl": "string",
  "ticketId": "string"
}

Responses

StatusMeaning
201The ticket, as the screen shows it.
400Say a little more — a subject and a few sentences.
401Signed out
503The desk is unreachable. The sentence tells the director where else to write.

201 returns:

{
  "id": "string",
  "status": "open",
  "summary": "string",
  "messageCount": 0,
  "unreadCount": 0,
  "createdAt": "string",
  "lastMessageAt": "string"
}

Call it

curl -X POST "https://api.flam.fashion/api/toolkit/support/tickets" \
  -H "Authorization: Bearer $FLAM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"topic":"develop","subject":"The lookbook stopped at frame three","body":"Ran a five-frame look at 2K. Three came back, the last two never did, and the balance looks the same as before I started.","contactEmail":"string","currentUrl":"string","ticketId":"string"}'

GET /api/toolkit/support/tickets/{id}

The messages on one ticket

The whole thread, oldest first. Internal notes are excluded by the help desk itself. Answers are written by a person — FLAM runs no bot on this path.

Parameters

InNameTypeRequiredNotes
pathidstringyes

Responses

StatusMeaning
200The conversation.
401Signed out
503The desk is unreachable, or this thread is not yours.

200 returns:

{
  "status": "string",
  "messages": [
    {
      "id": "string",
      "content": "string",
      "author": "customer",
      "authorName": "string",
      "createdAt": "string"
    }
  ]
}

Call it

curl -X GET "https://api.flam.fashion/api/toolkit/support/tickets/{id}" \
  -H "Authorization: Bearer $FLAM_API_KEY"