Create a Coach

In order to create a coach we require to use a combination of two mutations createUser and makeCoach.

createUser will create the new user inside the console while makeCoach will grant access to the coaching portal.

Both should be run on our "console API", so you will need to generate the "Authorization Token" which is required as an authorization header (example below).

Generate Token

Argument Name

Is required?

Type

Description

email

Yes

string

Console Admin email

password

Yes

string

Object that contains the password fields.

Create User

Field Name

Type

Description

email

String

Coach user email

name

String

Coach name

password

String

Coach password

roles

Array

Viewer

active

Boolean

True if the coach will be active. Otherwise, False

Make Coach

Field Name

Type

Description

email

String

Coach user email

name

String

Coach name

isCoachAdmin

Boolean

Set to True to make coach

Available Fields

The following fields will be displayed in the response:

Field Name

Type

Description

success

Boolean

True if the coach information has been created successfully. Otherwise, False

message

String

Description of the result

Examples

Generate access token

mutation {
  login(email: "admin@gmail.com" password: "pp455word") {
    success accessToken
  }
}

Create coach

mutation {
    createUser(
        email: "user@gmail.com"
        name: "Scott Pilgrim"
        password: "pp455w0rd"
        roles: ["VIEWER"]
        active: true
    ) {
        success message
    }
    makeCoach(
        email: "user@gmail.com"
        name: "Scott Pilgrim"
        isCoachAdmin: true
    ) {
        success message
    }
}

Last updated