TeleWellness Portal
  • Introduction
  • HELPFUL RESOURCES
    • Getting Started
    • FAQ
      • Appointments
      • Meal Plan
  • User Management
    • Roles and Permissions
    • Manage Coaches
      • Coach tab
        • Register a new coach
          • Assign Members
        • Edit an existing coach
      • Calendar tab
        • Appointment Types
        • Appointment Alerts
      • Note Templates tab
    • Manage Members
      • Create a new member
      • Edit member's information
      • Filter members
  • Using the TeleWellness Portal
    • Login and logout to the Portal
    • Navigating the TeleWellness Portal
      • Home
      • Dashboard
      • Admin Dashboard
      • Coach Dashboard
        • Progress Tab
          • Filtering the information
          • Checking the user’s streak progress
          • Checking the user's activities progress
          • Showing the food log history
          • Checking the user's recap questions
          • Checking the user's weight log history
          • Showing user’s program journey
          • Checking user’s water intake history
        • Meal Plan tab
        • Notes tab
        • Appointments tab
        • Lab Tests tab
        • Wellness Plans tab
      • Messages
      • Meal Plans
        • Manage Meal Plans
          • From Scratch
          • Smart Meal Plan
      • Scheduling
      • Wellness Plan
        • Manage Protocols
        • Manage Wellness Plan Templates
    • Note Templates
  • API Reference
    • Generate Authorization Token
    • Appointments
      • Appointment Types
      • Add Appointment Credits
    • Coaches
      • Coach List
      • Update a Coach
      • Create a Coach
      • Invite Coach
    • Members
      • Member List
      • Members List
      • Program List
      • Update member's program
      • Assign Coach to Member
    • Lab Test Reports
      • Lab Test Report List
      • Create a Lab Test Report
      • Update Lab Test Report
      • Delete a Lab Test Report
    • Wellness Plans
      • Create a Supplement Plan for Member
      • Update Member Supplement
      • List Member Supplement Plans
      • Delete Member Supplement Plan
Powered by GitBook
On this page
  • Generate Token
  • Create User
  • Make Coach
  • Available Fields
  • Examples
  1. API Reference
  2. Coaches

Create a Coach

PreviousUpdate a CoachNextInvite Coach

Last updated 2 years ago

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 "", 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
  }
}
{
  "data": {
    "login": {
      "success": true,
      "accessToken": "eyJ0eXAiOiJKV1QiJCJhbGciOiJIUzI1NiJ9.EyJleHAiUjE2NjA4NDMwMzMsImlzcyI6InNnOnBvcnRhbCIsImlhdCI6MTY1ODI1MTAzMywidWlkIjoiMTA2NCIsImVtYWlsIjoicmV2ZXJzZWhlYWx0aEBzdWdnZXN0aWMuY29tIiwidGhpcmRwYXJ0eSI6IjIxNjAiLCJyb2xlcyI6WyJBRE1JTiIsIkNPQUNIX0FETUlOIiwiQ09BQ0hfQUxMX01FTUJFUlMiLCJDT0FDSCJdLCJzZXNzaW9uIjoiZko3bDVldTIzYUhnIn0.T9MtDLrw-l1086R4qNcD3S3HxRZV5HamlVzX_BPMT3s"
    }
  }
}

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
    }
}
{
Authorization: "JWT eyJ0eXAiOiJKV1QiJCJhbGciOiJIUzI1NiJ9.EyJleHAiUjE2NjA4NDMwMzMsImlzcyI6InNnOnBvcnRhbCIsImlhdCI6MTY1ODI1MTAzMywidWlkIjoiMTA2NCIsImVtYWlsIjoicmV2ZXJzZWhlYWx0aEBzdWdnZXN0aWMuY29tIiwidGhpcmRwYXJ0eSI6IjIxNjAiLCJyb2xlcyI6WyJBRE1JTiIsIkNPQUNIX0FETUlOIiwiQ09BQ0hfQUxMX01FTUJFUlMiLCJDT0FDSCJdLCJzZXNzaW9uIjoiZko3bDVldTIzYUhnIn0.T9MtDLrw-l1086R4qNcD3S3HxRZV5HamlVzX_BPMT3s"
}
{
  "data": {
    "createCoach": {
      "success": true
    }
    "makeCoach":{
      "success": true
    }
  }
}

console API