Person Creation
POST/v1/api/people/create
Creates a person.
The tenant's people rule decides which fields are unique keys (CPF, email and/or phone). Those fields are required, and a request without them returns 400.
If an enabled person of the same client, or of a related client (parent or sibling), already has the same unique keys, the API does not create another one and returns 409 with the existing person's ID. It still updates that person. Fields that are empty in the existing person get the values you sent, fields that already have a value keep it, and the loyalty level and program opt-in are applied.
To set the person's loyalty level, send loyaltyTier with loyaltyCredentialId. To opt the person into a loyalty program, send loyaltyProgramId. The API checks the level and the program before creating the person, so an invalid one returns 400 and creates nothing.
Request
- application/json
Body
First name.
Last name.
Email. Required when email is a unique key in the people rule.
Phone. Required when phone is a unique key in the people rule.
CPF. Required 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. Without it, the opt-in date is the time of the call. When the person already exists (409) and already opted into the program, the stored date stays.
Legacy flag with no effect on loyalty programs. To opt the person into a program, send loyaltyProgramId.
Responses
- 200
- 400
- 409
Person created.
- 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.
Person 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
}
Missing unique key, or invalid loyalty level or loyalty program. No person was created.
- application/json
- Schema
- Example (from schema)
- missingUniqueKeys
- tierNotInCredential
Schema
What went wrong, in Portuguese.
Always empty in this API.
{
"errorCode": 404,
"errorMessage": "string",
"errorType": "AmazingNiaraException",
"errorData": {}
}
{
"errorCode": 400,
"errorMessage": "Campos obrigatórios ausentes: cpf, email",
"errorType": "AmazingNiaraException",
"errorData": {}
}
{
"errorCode": 400,
"errorMessage": "Nível Diamante não cadastrado na credencial.",
"errorType": "AmazingNiaraException",
"errorData": {}
}
A person with the same unique keys already exists. The message carries that person's ID after Pessoa já existente: and lists the empty fields the API filled in it, if any.
- 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": 409,
"errorMessage": "Pessoa já cadastrada. Pessoa já existente: 8ddbe6e8-108f-49a0-b4ed-4f5ad3e9051a. Campos atualizados: dob, addressCity.",
"errorType": "AmazingNiaraException",
"errorData": {}
}