Skip to content
View as Markdown

POST Get Or Generate Contact Summary​

POST
/ai/contact-summary

Read, generate, or regenerate the AI summary shown on a contact profile.

The two flags decide which of three behaviours you get:

generate regenerate Behaviour
no no Return the cached summary if one exists for the current site locale, otherwise return an empty summary and cached: false. Makes no provider call.
yes no Return the cache when valid, otherwise generate and cache a new summary.
any yes Ignore the cache and generate a fresh summary.

Summaries are cached in subscriber meta under _ai_contact_summary and are keyed to the site language (Settings → General → Site Language), not the admin user's profile language. A cached summary generated under a different locale is treated as a miss. Summaries cached before locale tracking existed are reused only while the site locale is English.

Generation blocks for up to 45 seconds.

Required capability: fcrm_read_contacts

Enforced by AiPolicy::contactSummary().

Authorizations​

ApplicationPasswords

WordPress Application Passwords — use Basic auth with your WordPress username and an application password in the format: username:application_password

Type
API Key (header: Authorization)

Request Body​

application/json
JSON
{
"subscriber_id": 0,
"generate": "no",
"regenerate": "no"
}

Responses​

The cached or freshly generated summary.

application/json
JSON
{
"summary": {
"content": "string",
"generated_at": "string",
"provider": "string",
"model": "string",
"locale": "string",
"counts": {
}
},
"cached": true
}

Playground​

Authorization
Body

Samples​

Powered by VitePress OpenAPI