Skip to main content
POST https://api.humalike.com/v1/social-learning/actions/extract
Send a chat transcript and receive a structured profile of how the group talks, plus a prompt_block — a rendered, drop-in instruction you can place in an agent’s prompt so it matches that voice.

Authorization

Authorization
string
required
Your bearer token: Bearer <token>. See Authentication.

Request body

transcript
object
required
The conversation to analyze.
transcript.messages
Message[]
required
The messages to analyze, in order. Must contain at least one message.
transcript.source
string
Optional label for where the transcript came from (e.g. a chat name).
Each Message has:
id
string
required
A stable identifier for the message, unique within the transcript.
speaker
string
required
Who sent the message (a display name or stable id).
text
string
required
The message text.
channel
string
Optional channel or room the message was sent in.
timestamp
string
Optional timestamp for the message.
reply_to
string
Optional id of the message this one replies to. Preserving reply structure improves the analysis.
Request
{
  "transcript": {
    "messages": [
      {"id": "m1", "speaker": "ada", "text": "yo we still on for tonight"},
      {"id": "m2", "speaker": "max", "text": "ye 8pm same spot", "reply_to": "m1"}
    ]
  }
}

Response

prompt_block
string
A ready-to-use, human-readable instruction block describing how to write like this group. Drop it straight into an agent’s prompt.
profile
object
The structured profile the prompt_block is rendered from. Top-level fields include summary, register (formality, warmth, casing), style (length, formatting, emoji), lexicon, banned_phrases, address, taboos, humor, roles, norms, in_jokes, and meta. Read individual fields when you want finer control than prompt_block gives.
200 OK
{
  "prompt_block": "Match this group's voice. Write in lowercase; keep messages to one or two short lines; no headers or bullet lists; emoji sparing. ...",
  "profile": {
    "summary": "casual, lowercase, terse group chat",
    "register": {"formality": "casual", "warmth": "friendly", "casing": "lowercase", "confidence": 0.6},
    "style": {"length": "one to two short lines", "formatting": "minimal; no headers or lists", "emoji": "sparing"},
    "lexicon": [],
    "in_jokes": [],
    "meta": {"message_count": 2, "channels": []}
  }
}

Errors

StatusCodeWhen
400VALIDATION_ERRORThe transcript is too large or it could not be analyzed.
401UNAUTHORIZEDThe bearer token is missing, invalid, or expired.
402PAYMENT_REQUIREDYour credit balance can’t cover the request. See Credits and billing.
403forbiddenThe credentials are valid but not permitted for this endpoint.
422VALIDATION_ERRORThe body is malformed or messages is empty.
502UPSTREAM_ERRORA dependency the request relies on was unavailable. Retry.
See Errors for the full envelope shape.

Example

curl https://api.humalike.com/v1/social-learning/actions/extract \
  -H "Authorization: Bearer $HUMALIKE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "transcript": {
      "messages": [
        {"id": "m1", "speaker": "ada", "text": "yo we still on for tonight"},
        {"id": "m2", "speaker": "max", "text": "ye 8pm same spot"}
      ]
    }
  }'