Skip to content
Navigation

Remove a member from an agency

DELETE
https://api.nicer.travel/identity/company/{companyName}/member/{userId}

Removes a person from an agency's staff. The membership is kept with status removed, so the person's next token, when it is issued or refreshed, no longer carries the agency, and app.CompanyMember.removed is published, which tells the CRM to leave the travelers they served for an admin to reassign. The person's account, and their memberships in other agencies, are untouched. Only an admin of the agency, or Nicer staff, may call it; staff must name the agency, and companyName in the path must be the agency the request acts for (x-nicer-company). The legacy company-level superadmin membership is Nicer staff's, and only staff remove it. An admin may remove themself unless they are the agency's last admin. Errors: 404 ERROR_ITEM_NOT_FOUND (the person is not an active member of this agency's staff, or the path names another agency), 403 ERROR_DO_NOT_HAVE_PERMISSION (the caller is neither an admin of the agency nor Nicer staff, or an agency admin removing 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 it was removed: read it again).

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Path parameters

  • companyName
    string
    required
  • userId
    string
    required

Header parameters

  • x-nicer-company
    string
    required

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

Returns

200

OK

JSON
  • companyName
    string
    required

    The agency the person no longer belongs to.

    minLength: 1
  • removedAt
    string
    required

    When the membership was removed.

    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))$
  • removedBy
    string
    required

    The user id of the admin or staff member who removed it.

    minLength: 1
  • status
    string
    required

    The membership's status, which is kept rather than deleted.

  • userId
    string
    required

    The person who was removed.

    minLength: 1

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