Skip to content
Navigation

Invite a person to the agency's staff

POST
https://api.nicer.travel/identity/invite

Invites a person to the staff of the agency the request acts for, as an advisor or an admin (role), by email, phoneNumber, givenName and familyName, and sends them the invitation unless sendMessage is false. A person who already has a staff account joins the agency at once instead, with the role sent, and the answer is that membership with alreadyMember true; otherwise the answer is the pending invitation. Travelers are invited from the CRM (POST /crm/travelers/{travelerId}/invitation), and a contact that belongs to a traveler's account is refused with 409 ERROR_USER_IS_TRAVELER unless that account was opened from a staff invitation. A body that fails the schema, such as one with another role or with no phone, email or name, is refused with 400 ERROR_BODY_VALIDATION. Agency admins only; only Nicer staff name another agency with companyName.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Request body JSON required

  • role
    advisor
    or
    admin
    required
  • companyName
    optional
    string
    minLength: 1
  • email
    optional
    string
    format: email · pattern: ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
  • familyName
    optional
    string
  • givenName
    optional
    string
  • metadata
    optional
    map of
    string
  • phoneNumber
    optional
    string
  • sendMessage
    optional
    boolean
    default: true

Returns

200

OK

JSON

Any of the following:

  • Invite
    • companyName
      string
      required

      The agency the invitation is to.

    • createdBy
      string
      required

      The user id of whoever sent it, or SYSTEM for a paid Join.

    • invitedBy
      string
      required

      The user id of whoever sent it, or SYSTEM for a paid Join.

    • lastModifiedBy
      string
      required

      The user id of whoever last changed it, or SYSTEM.

    • role
      advisor
      or
      traveler
      or
      admin
      or
      superadmin
      required

      The role the invitee gets on accepting.

    • inviteId
      string
      required

      The invitation's id.

    • userId
      string
      required

      The user id of whoever sent it; JOIN#<registrationId> for a paid Join.

    • createdAt
      string
      required

      When it was sent.

    • type
      string
      required
    • updatedAt
      string
      required

      When it last changed.

    • advisorId
      optional

      The advisor some older invitations name.

      Any of the following:

      • string
      • null
    • deleted
      optional
      boolean

      True once it was cancelled.

    • email
      optional
      string

      The email it was sent to.

    • expiresAt
      optional
      string

      When it can no longer be accepted; one without it expires seven days after createdAt.

    • familyName
      optional
      string

      The invitee's last name.

    • fullName
      optional
      string

      The invitee's first and last name, joined.

    • givenName
      optional
      string

      The invitee's first name.

    • metadata
      optional
      map of
      string

      Details stored with it, such as joinRegistrationId.

    • phoneNumber
      optional
      string

      The phone it was sent to.

    • resendCount
      optional
      number

      How many times it was sent again; four at most.

    • sendMessage
      optional
      boolean

      Whether the request asked to send it, kept on invitations of a person whose traveler account was opened from a staff invitation.

  • object
    • alreadyMember
      boolean
      required
    • companyName
      string
      required

      The agency they joined.

    • joinedAt
      string
      required

      When they joined it.

    • role
      advisor
      or
      admin
      required

      Their role there, as the request sent it.

    • userId
      string
      required

      The person's id.

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