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 a Phantom-managed 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
Writes memoriesyes (cadence)never
Vector store requiredyesoptional
Steered bypersonapersona + a Phantom-managed retarget 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.
note

temperature and max_tokens are not request parameters — generation settings are configured per endpoint by the Phantom Router team.

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

Like chat, the response is a conversation chain: any messages you supplied echoed back with the opener appended as the final assistant turn (when you send no history, the chain is just the opener).

{
"chat_id": "user-42",
"messages": [
{
"role": "assistant",
"content": "Hey, stranger - the sky was ridiculous tonight and I thought of you. How did the week land?"
}
],
"moderation": { "enabled": false, "inbound_prohibited": false }
}

The shape matches chat. Moderation is inbound-only: retarget screens any messages history you supply, never the generated opener. moderation.enabled is false when no Omnifence key is configured or when you send no history — as above, there was nothing to check. Retarget never writes memory back, so there's no extraction.

The opener's voice

The tone and intent of the opener come from a system prompt that Phantom manages - it is not customer-configurable. Your stored memories and the user's structured profile are injected automatically on top of it.

Errors

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