Skip to main content

Retarget

Generate a proactive "opener" to re-engage a user who has gone quiet - the user has not sent a message. Phantom composes the opener from stored memories, the structured profile, and any history you supply, steered by your editable retarget system prompt.

POST /api/v1/companion/retarget
  • Auth: Bearer key with the chat:companion scope.
  • Vector store: optional. Without one, you get a persona/history-only opener (no 400).
  • No memory write-back: retarget never extracts memories.

How it differs from chat

ChatRetarget
Last message must be user- (messages may be empty or end on assistant)
messages requiredoptional
Default temperature0.80.9
Writes memoriesyes (cadence)never
Vector store requiredyesoptional
Steered bypersonapersona + your retarget system prompt

Request body

FieldTypeRequiredNotes
chat_idstringSame format as chat.
personaobjectSame shape as chat.
messagesarray-Up to 100 turns. May be empty or end on an assistant turn.
modelstring-Override the generation model.
temperaturenumber-02. Default 0.9.
max_tokensinteger-132000.

Example

curl -X POST https://api.phantomrouter.ai/api/v1/companion/retarget \
-H "Authorization: Bearer $PHANTOM_KEY" \
-H "Content-Type: application/json" \
-d '{
"chat_id": "user-42",
"persona": { "name": "Luna", "chat_style": "warm, a little teasing" }
}'

Response

{
"reply": "Hey, stranger - the sky was ridiculous tonight and I thought of you. How did the week land?",
"chat_id": "user-42",
"moderation": { "inbound_prohibited": false, "outbound_filtered": false },
"memory": { "retrieved_count": 2, "profile_used": true }
}

The shape matches chat minus extraction_enqueued (retarget never writes back).

Customizing the opener

The tone and intent of the opener come from your retarget system prompt, which you set once per account via chat preferences. Send an empty string there to reset to the built-in default.

Errors

Same as chat, except there is no "no vector store configured" 400 - the store is optional here.