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:companionscope. - 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
| Chat | Retarget | |
|---|---|---|
Last message must be user | ✓ | - (messages may be empty or end on assistant) |
messages required | ✓ | optional |
Default temperature | 0.8 | 0.9 |
| Writes memories | yes (cadence) | never |
| Vector store required | yes | optional |
| Steered by | persona | persona + your retarget system prompt |
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
chat_id | string | ✓ | Same format as chat. |
persona | object | ✓ | Same shape as chat. |
messages | array | - | Up to 100 turns. May be empty or end on an assistant turn. |
model | string | - | Override the generation model. |
temperature | number | - | 0–2. Default 0.9. |
max_tokens | integer | - | 1–32000. |
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.