Skip to main content

CreateLearner

The results of this mutation can be affected by providing an authToken header to set a user for the operation.

CreateLearner(
email: String!
firstName: String!
lastName: String!
clientId: ID
licenseIds: [ID!]
): User!

Directives

authAccess

This requires the current user to be in MANAGER role.

Arguments

CreateLearner.email ● String! non-null scalar

CreateLearner.firstName ● String! non-null scalar

CreateLearner.lastName ● String! non-null scalar

CreateLearner.clientId ● ID scalar

CreateLearner.licenseIds ● [ID!] list scalar

Type

User object

Examples

Run in Postman

Query:

CreateLearner(
$email: String!,
$firstName: String!,
$lastName: String!,
$clientId: ID,
$licenseIds: [ID!]
) {
CreateLearner(
email: $email,
firstName: $firstName,
lastName: $lastName,
clientId: $clientId,
licenseIds: $licenseIds
) {
id
email
firstName
abbreviatedName
asset
lastName
name
lastActiveAt
bio
twoFactorEnabled
lastInitial
invitedByName
shouldHighlight
purchasedCourses {
...PurchasedCourseFragment
}
purchasedBundles {
...PurchasedBundleFragment
}
activeLicense {
...LicenseFragment
}
allocatedLicenses {
...AllocatedLicenseFragment
}
allocatedLearningPaths {
...AllocatedLearningPathFragment
}
attendedMeetings {
...UserAttendedMeetingFragment
}
waitlistedCourses {
...WaitlistedCourseFragment
}
adminClients {
...ClientFragment
}
roleKey
address1
address2
city
state
zipCode
country
telephone
stripeCustomerId
externalCustomerId
createdAt
updatedAt
sfAccountId
sfContactId
shippingName
client {
...ClientFragment
}
clientId
ref1
ref2
ref3
ref4
ref5
ref6
ref7
ref8
ref9
ref10
lang
customFields
recommendedTags {
...UserRecommendedTagFragment
}
recommendedSlugs {
...UserRecommendedSlugFragment
}
accessedFlows
disabled
learnerUserId
managerUserId
balance
mustVerifyEmail
certificatesCount
collaborationsCount
availableCoursesCount
startedCoursesCount
completedCoursesCount
}
}

Variables:

{
"email": "abc123",
"firstName": "xyz789",
"lastName": "abc123",
"clientId": "a878d8b1-a24b-469b-b52d-02282dccbc0b",
"licenseIds": [
"a878d8b1-a24b-469b-b52d-02282dccbc0b"
]
}

Response:

{
"data": {
"CreateLearner": {
"id": "a878d8b1-a24b-469b-b52d-02282dccbc0b",
"email": "abc123",
"firstName": "abc123",
"abbreviatedName": "xyz789",
"asset": "xyz789",
"lastName": "xyz789",
"name": "xyz789",
"lastActiveAt": "2023-07-27T16:18:44.225Z",
"bio": "abc123",
"twoFactorEnabled": true,
"lastInitial": "xyz789",
"invitedByName": "xyz789",
"shouldHighlight": true,
"purchasedCourses": [
"PurchasedCourse"
],
"purchasedBundles": [
"PurchasedBundle"
],
"activeLicense": "License",
"allocatedLicenses": [
"AllocatedLicense"
],
"allocatedLearningPaths": [
"AllocatedLearningPath"
],
"attendedMeetings": [
"UserAttendedMeeting"
],
"waitlistedCourses": [
"WaitlistedCourse"
],
"adminClients": [
"Client"
],
"roleKey": "xyz789",
"address1": "xyz789",
"address2": "xyz789",
"city": "abc123",
"state": "xyz789",
"zipCode": "xyz789",
"country": "xyz789",
"telephone": "abc123",
"stripeCustomerId": "a878d8b1-a24b-469b-b52d-02282dccbc0b",
"externalCustomerId": "a878d8b1-a24b-469b-b52d-02282dccbc0b",
"createdAt": "2023-07-27T16:18:44.225Z",
"updatedAt": "2023-07-27T16:18:44.225Z",
"sfAccountId": "a878d8b1-a24b-469b-b52d-02282dccbc0b",
"sfContactId": "a878d8b1-a24b-469b-b52d-02282dccbc0b",
"shippingName": "abc123",
"client": "client-1",
"clientId": "client-1",
"ref1": "xyz789",
"ref2": "abc123",
"ref3": "abc123",
"ref4": "xyz789",
"ref5": "abc123",
"ref6": "xyz789",
"ref7": "abc123",
"ref8": "abc123",
"ref9": "xyz789",
"ref10": "abc123",
"lang": "abc123",
"customFields": "{}",
"recommendedTags": [
"UserRecommendedTag"
],
"recommendedSlugs": [
"UserRecommendedSlug"
],
"accessedFlows": [
"abc123"
],
"disabled": true,
"learnerUserId": "a878d8b1-a24b-469b-b52d-02282dccbc0b",
"managerUserId": "a878d8b1-a24b-469b-b52d-02282dccbc0b",
"balance": 793.85,
"mustVerifyEmail": true,
"certificatesCount": 206,
"collaborationsCount": 206,
"availableCoursesCount": 206,
"startedCoursesCount": 206,
"completedCoursesCount": 206
}
}
}