Member Names
Send Zing the first and last name you hold for each member. Zing stores them with the member’s partner_user_id and shows them in the Partner Portal, so your team sees members under the names your systems use.
How member names work
- Separate from the app name. The names you send are stored separately. They never overwrite the name the member chose in the Zing app, and the app does not show them.
- Shown in the Partner Portal. The portal shows your names on member lists and profiles, and member search matches them.
- Returned by the Pull API.
GET /usersandGET /users/{partner_user_id}returnfirst_nameandlast_name. Both arenulluntil you set them. - Cleared on removal.
DELETE /users/{partner_user_id}clears both names.
Endpoints
| Method | Path | Description |
|---|---|---|
| PATCH | /users/{partner_user_id}/name | Set the first name, last name, or both for one member. |
| POST | /users/names:batch | Set names for up to 500 members in one request. |
Both endpoints use the same base URL, API key authentication, and rate limits as the Pull API. Send the body as JSON with Content-Type: application/json.
When to use each
- Batch — Use
POST /users/names:batchfor the initial backfill of existing members and for periodic syncs from your member system. Split larger sets into requests of up to 500 members. - Single — Use
PATCH /users/{partner_user_id}/namewhen one member’s name changes, for example right after a profile update in your system.
Update rules
Both endpoints apply the same rules to each member:
- Only the fields you send change. A field you omit keeps its current value.
nullor a blank string clears a field. For example,{"last_name": null}removes the last name and leaves the first name as it is.- Values are trimmed. Leading and trailing whitespace is removed before the value is stored.
- At least one field is required. Send
first_name,last_name, or both.
Each name must:
- Be a string or
null. - Be at most 150 characters after trimming.
- Not contain the NUL character (
\u0000).
Unknown fields are rejected with 400. Only first_name and last_name are accepted in the single request body, plus partner_user_id in each batch item.
Set one member’s name
PATCH /users/{partner_user_id}/nameRequest body
| Field | Type | Description |
|---|---|---|
first_name | string | null | Optional. First name. null or a blank string clears it. |
last_name | string | null | Optional. Last name. null or a blank string clears it. |
Responses
- 200 — Names stored. The response contains the member’s current
first_nameandlast_name. - 400 — Invalid body: no name fields, an unknown field, a value that is not a string, a name longer than 150 characters, or a NUL character.
- 404 — No member with this
partner_user_idexists for your partner account, or the member was removed.
Example
curl -sS -X PATCH \
-H "Authorization: Api-Key <API KEY>" \
-H "Content-Type: application/json" \
-d '{"first_name": "Jane", "last_name": "Doe"}' \
"https://api.dev-ai.coach/v1/users/partner-usr-123/name"Example response:
{
"partner_user_id": "partner-usr-123",
"first_name": "Jane",
"last_name": "Doe"
}To change only the first name, send only that field. The last name stays Doe:
{
"first_name": "Janie"
}Unknown member:
{
"detail": "User not found."
}Set names in a batch
POST /users/names:batchRequest body
| Field | Type | Description |
|---|---|---|
items | array | Required. 1 to 500 items. |
items[].partner_user_id | string | Required. The member’s partner_user_id, 1 to 255 characters. Each ID may appear only once per request. |
items[].first_name | string | null | Optional. Same rules as the single endpoint. |
items[].last_name | string | null | Optional. Same rules as the single endpoint. |
Each item must include first_name, last_name, or both.
Validation is all or nothing
Zing validates the whole request before writing anything. If any item is invalid, or the same partner_user_id appears more than once, the request returns 400 and no names are changed. The detail message names the failing path, for example items.1.last_name.
Responses
- 200 — The request was valid.
resultshas one entry per item, in request order:updated— Names stored.first_nameandlast_namehold the member’s current names.not_found— No member with thispartner_user_idexists for your partner account, or the member was removed. Nothing is stored and both names arenull.
- 400 — Invalid request: missing or empty
items, more than 500 items, a duplicatepartner_user_id, an item without name fields, an unknown field, or an invalid name.
A batch with not_found items still returns 200. Check status on each result.
Example
In this request, partner-usr-123 already has the last name Doe, and partner-usr-999 is not a member of this partner account.
curl -sS -X POST \
-H "Authorization: Api-Key <API KEY>" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"partner_user_id": "partner-usr-456", "first_name": "Giulia", "last_name": "Bianchi"},
{"partner_user_id": "partner-usr-123", "first_name": "Jane"},
{"partner_user_id": "partner-usr-999", "last_name": null}
]
}' \
"https://api.dev-ai.coach/v1/users/names:batch"Example response:
{
"results": [
{
"partner_user_id": "partner-usr-456",
"status": "updated",
"first_name": "Giulia",
"last_name": "Bianchi"
},
{
"partner_user_id": "partner-usr-123",
"status": "updated",
"first_name": "Jane",
"last_name": "Doe"
},
{
"partner_user_id": "partner-usr-999",
"status": "not_found",
"first_name": null,
"last_name": null
}
]
}Example: rejected batch
The same partner_user_id appears twice, so the whole request is rejected and nothing is written:
{
"items": [
{"partner_user_id": "partner-usr-123", "first_name": "Jane"},
{"partner_user_id": "partner-usr-123", "last_name": "Doe"}
]
}Response (400):
{
"detail": "items: Value error, Duplicate partner_user_id: partner-usr-123."
}Fix the request and send it again. Combine the fields for one member into a single item.
Considerations
- Retries — Both endpoints are safe to retry. Sending the same names again stores the same values.
not_foundresults — Zing has no member with thatpartner_user_idfor your partner account. Check the ID againstGET /users, and include the member again in your next periodic sync.- Rate limits — If you receive
429, wait for theRetry-Afterseconds before retrying. Send batches one after another rather than in parallel.
For the full request and response schemas, see the Reference (opens in new window).