User Invites
API

User Invites API

Introduction

The user invite API is used directly by the UI components (e.g. The <UserInvitesTable/>). However, you can also use it programmatically.

Mutations

sendUserInvites()

The sendUserInvites API is used to invite users.

You can find the full API doc of this mutation here (opens in a new tab).

mutation {
  sendUserInvites(
    userInvites: {
      userInvites: [
        {
          email: "abc123"
          firstName: "xyz789"
          lastName: "xyz789"
          locale: "xyz789"
          data: JsonObject
          createdByUserId: 4
          tenantId: "4"
          roles: ["abc123"]
        }
      ]
      tenantId: "xyz"
    }
  ) {
    success {
      status
    }
    errors {
      error
    }
  }
}
ParameterTypeDescription
emailstringEmail of the invitee
firstNamestringFirst name of the invitee
lastNamestringLast name of the invitee
localestringLanguage of the invitee (used for the email)
dataarrayAdditional custom data
createdByUserIduuidID of the inviting user
tenantIduuidID of the tenant (organization)
rolesarrayArray of IDs of roles for the invitee

Queries

You can fetch invites using the userInvite and userInvites queries:

query {
  userInvites {
    data {
      email
      status
    }
  }
}