Skip to main content

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

    id stringrequired

Body

    firstName stringnullable

    First name.

    lastName stringnullable

    Last name.

    email stringnullable

    Email. Ignored when email is a unique key in the people rule.

    phone stringnullable

    Phone. Ignored when phone is a unique key in the people rule.

    cpf stringnullable

    CPF. Ignored when CPF is a unique key in the people rule.

    passport stringnullable

    Passport.

    dob stringnullable

    Date of birth.

    country stringnullable

    Country of origin.

    registrationSource stringnullable

    Registration source.

    addressStreetName stringnullable

    Street.

    addressNumber stringnullable

    Address number.

    addressZipCode stringnullable

    Zip code.

    addressAdditionalInformation stringnullable

    Address complement.

    addressDistrict stringnullable

    Neighborhood.

    addressCity stringnullable

    City.

    addressState stringnullable

    State.

    ageGroup nullable

    Possible values: [ADULT, CHILD, null]

    Classification of the age group (Adult or Child).

    loyaltyTier stringnullable

    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.

    loyaltyTierExpireAt stringnullable

    When the loyalty level expires, ISO 8601 (e.g. 2027-10-01T00:00:00Z). Optional, only used with loyaltyTier.

    loyaltyCredentialId stringnullable

    ID of the manual loyalty credential (type "Fidelidade Manual") that holds the level. Required with loyaltyTier.

    loyaltyProgramId stringnullable

    ID of a loyalty program registered in Niara ("Programa de Fidelidade"). Opts the person into that program.

    loyaltyProgramOptInDate stringnullable

    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.

    loyaltyOptIn booleannullabledeprecated

    Legacy flag with no effect on loyalty programs. To opt the person into a program, send loyaltyProgramId.

    id string

    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.

    enabled booleannullable

    Default value: true

    Whether the person is enabled or not. Set to true when left out.

Responses​

The person after the update.

Schema
    firstName stringnullable

    First name.

    lastName stringnullable

    Last name.

    email stringnullable

    Email.

    phone stringnullable

    Phone.

    cpf stringnullable

    CPF.

    passport stringnullable

    Passport.

    dob stringnullable

    Date of birth.

    country stringnullable

    Country of origin.

    registrationSource stringnullable

    Registration source.

    addressStreetName stringnullable

    Street.

    addressNumber stringnullable

    Address number.

    addressZipCode stringnullable

    Zip code.

    addressAdditionalInformation stringnullable

    Address complement.

    addressDistrict stringnullable

    Neighborhood.

    addressCity stringnullable

    City.

    addressState stringnullable

    State.

    ageGroup nullable

    Possible values: [ADULT, CHILD, null]

    Classification of the age group (Adult or Child).

    loyaltyTier stringnullabledeprecated

    Legacy field, no longer updated. Read the person's levels from loyaltyData[].tier in the GET endpoints.

    loyaltyOptIn booleannullabledeprecated

    Legacy flag. It does not tell whether the person opted into a loyalty program.

    id stringnullable

    Id.

    creationDate stringnullable

    Creation date.

    enabled booleannullable

    Default value: true

    Whether the person is enabled or not.

Loading...