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: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 |
| Writes memories | yes (cadence) | never |
| Vector store required | yes | optional |
| Steered by | persona | persona + a Phantom-managed retarget 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. |
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.