Person Update
PATCH/v1/api/people/:id
Updates a person. PUT on the same path is accepted and does the same thing.
Only the fields you send change. A field sent as null keeps its stored value. The exception is enabled, which is set to true when left out.
Fields that are unique keys in the tenant's people rule (CPF, email and/or phone) do not change through this endpoint. The API ignores the values sent for them and keeps the stored ones.
To set the person's loyalty level, send loyaltyTier with loyaltyCredentialId. The change goes into the person's loyalty history as an upgrade, a downgrade or an update, following the order of the levels in the credential. To opt the person into a loyalty program, send loyaltyProgramId. The API checks the level and the program before saving anything, so an invalid one returns 400 and leaves the person unchanged.
Request
Path Parameters
- application/json
Body
First name.
Last name.
Email. Ignored when email is a unique key in the people rule.
Phone. Ignored when phone is a unique key in the people rule.
CPF. Ignored when CPF is a unique key in the people rule.
Passport.
Date of birth.
Country of origin.
Registration source.
Street.
Address number.
Zip code.
Address complement.
Neighborhood.
City.
State.
Possible values: [ADULT, CHILD, null]
Classification of the age group (Adult or Child).
Loyalty level to set for the person. It must be one of the levels ("Níveis") registered in the credential sent in loyaltyCredentialId, which is required with it.
When the loyalty level expires, ISO 8601 (e.g. 2027-10-01T00:00:00Z). Optional, only used with loyaltyTier.
ID of the manual loyalty credential (type "Fidelidade Manual") that holds the level. Required with loyaltyTier.
ID of a loyalty program registered in Niara ("Programa de Fidelidade"). Opts the person into that program.
Opt-in date, ISO 8601 (e.g. 2026-03-01T10:00:00-03:00). Optional, requires loyaltyProgramId. A date sent replaces the stored one. Without it, the opt-in date is the time of the call, unless the person already opted into that program, in which case the stored date stays.
Legacy flag with no effect on loyalty programs. To opt the person into a program, send loyaltyProgramId.
Person ID. Leave it out, the ID in the path is enough. If you send it, the API uses this value instead of the one in the path.
Default value: true
Whether the person is enabled or not. Set to true when left out.
Responses
- 200
- 400
- 404
The person after the update.
- application/json
- Schema
- Example (from schema)
Schema
First name.
Last name.
Email.
Phone.
CPF.
Passport.
Date of birth.
Country of origin.
Registration source.
Street.
Address number.
Zip code.
Address complement.
Neighborhood.
City.
State.
Possible values: [ADULT, CHILD, null]
Classification of the age group (Adult or Child).
Legacy field, no longer updated. Read the person's levels from loyaltyData[].tier in the GET endpoints.
Legacy flag. It does not tell whether the person opted into a loyalty program.
Id.
Creation date.
Default value: true
Whether the person is enabled or not.
{
"firstName": "string",
"lastName": "string",
"email": "string",
"phone": "string",
"cpf": "string",
"passport": "string",
"dob": "string",
"country": "string",
"registrationSource": "string",
"addressStreetName": "string",
"addressNumber": "string",
"addressZipCode": "string",
"addressAdditionalInformation": "string",
"addressDistrict": "string",
"addressCity": "string",
"addressState": "string",
"id": "string",
"creationDate": "string",
"enabled": true
}
Invalid loyalty level or loyalty program. Nothing was saved.
- application/json
- Schema
- Example (from schema)
- tierWithoutCredential
- tierNotInCredential
- unknownProgram
Schema
What went wrong, in Portuguese.
Always empty in this API.
{
"errorCode": 404,
"errorMessage": "string",
"errorType": "AmazingNiaraException",
"errorData": {}
}
{
"errorCode": 400,
"errorMessage": "Informe o loyaltyCredentialId junto com o loyaltyTier.",
"errorType": "AmazingNiaraException",
"errorData": {}
}
{
"errorCode": 400,
"errorMessage": "Nível Diamante não cadastrado na credencial.",
"errorType": "AmazingNiaraException",
"errorData": {}
}
{
"errorCode": 400,
"errorMessage": "loyaltyProgramId não é um programa de fidelidade cadastrado.",
"errorType": "AmazingNiaraException",
"errorData": {}
}
No person with this ID in the tenant.
- application/json
- Schema
- Example (from schema)
- Example
Schema
What went wrong, in Portuguese.
Always empty in this API.
{
"errorCode": 404,
"errorMessage": "string",
"errorType": "AmazingNiaraException",
"errorData": {}
}
{
"errorCode": 404,
"errorMessage": "Pessoa com ID 8ddbe6e8-108f-49a0-b4ed-4f5ad3e9051a não encontrada",
"errorType": "AmazingNiaraException",
"errorData": {}
}