Skip to content
Navigation

Change a member's settings or role in an agency

PUT
https://api.nicer.travel/identity/admin/user/{id}

Changes a person's membership in the agency the request acts for (x-nicer-company): the settings noLeads, bookingAccessEnabled, hasAdvisorPortalAccess and isTestUser, and the role, between advisor and admin. It never changes the person's account, their contact details or their memberships in other agencies. Only the agency's admins and Nicer staff may call it, and staff must name the agency. The legacy company-level superadmin membership is Nicer staff's: only staff change its settings, and its role stays. The agency always keeps at least one admin; an admin may change themself under the same rule. A change of role publishes identity.company-member-role-changed.v1, a change of a setting identity.company-member-settings-changed.v1, and turning an advisor's portal access off app.CompanyMember.removed; the person's next token reflects the membership as it now stands. A request that changes nothing writes nothing. Answers the membership as it now stands. Errors: 400 ERROR_MALFORMED_BODY (not JSON), 400 ERROR_BODY_VALIDATION (an unknown field, a value of the wrong type, or nothing to change), 404 ERROR_ITEM_NOT_FOUND (the person is not an active member of this agency's staff), 403 ERROR_DO_NOT_HAVE_PERMISSION (the caller is neither an admin of the agency nor Nicer staff, or an agency admin changing the legacy superadmin membership), 409 ERROR_IDENTITY_INVALID_ROLE (a role change on the legacy superadmin membership), 409 ERROR_LAST_ADMIN (the agency would be left without an admin), 409 ERROR_CONDITIONAL_CHECK_FAILED (the membership kept changing while this change was made: read it again).

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Path parameters

  • id
    string
    required

Header parameters

  • x-nicer-company
    string
    required

    Company context. Authentication and tenant membership are validated by the API.

Request body JSON required

  • bookingAccessEnabled
    optional
    boolean

    Whether the portal shows the member the agency's flight booking link.

  • hasAdvisorPortalAccess
    optional
    boolean

    Whether an advisor may use the agency's portal. Turned off, the advisor's next token no longer carries the agency, and the CRM leaves the travelers they served for an admin to reassign. An admin keeps the agency either way.

  • isTestUser
    optional
    boolean

    Whether this membership is a test account.

  • noLeads
    optional
    boolean

    Whether the member is left out when the agency assigns new leads automatically.

  • role
    optional
    advisor
    or
    admin

    The member's role in the agency. A role moves between advisor and admin only.

Returns

200

OK

JSON
  • companyName
    string
    required

    The agency the membership belongs to: the one the request acts for.

    minLength: 1
  • role
    advisor
    or
    admin
    or
    superadmin
    required

    The member's role in the agency. superadmin is the legacy company-level membership of Nicer staff, which counts as an admin of the agency.

  • status
    string
    required

    The membership's status: only an active membership changes.

  • updatedAt
    string
    required

    When the membership last changed.

    format: date-time · pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
  • userId
    string
    required

    The member.

    minLength: 1
  • bookingAccessEnabled
    optional
    boolean

    As stored; absent when never set.

  • hasAdvisorPortalAccess
    optional
    boolean

    As stored; absent when never set, which lets an advisor in.

  • isTestUser
    optional
    boolean

    As stored; absent when never set.

  • noLeads
    optional
    boolean

    As stored; absent when never set.

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close