POST /updateUserPersona
- Auth: header
x-api-key: <API_KEY>(if enforced upstream; function itself only validates method/body) - Method:
POST - Body:
parentDocId(string, required) — business IDsubDocId(string, required) — participant/user IDupdates(object, required)- For array fields (e.g.,
themes,values,personality,writingTechniques), values are appended using FirestorearrayUnion - For scalar/object fields (e.g.,
role), values replace existing
- For array fields (e.g.,
- Behavior: updates
businesses/{parentDocId}/participants/{subDocId}with a mixed replace/append strategy - Responses:
- 200:
{ ok: true } - 400: missing/invalid inputs
- 405: wrong method
- 500: internal error
- 200:
Example request body:
{
"parentDocId": "biz123",
"subDocId": "user456",
"updates": {
"role": "coach",
"themes": [{ "type": "A", "description": "new desc" }]
}
}
Source: apps/functions/updateUserPersona.js.