Migrating from REST to GraphQL APIs

  • Updated
  • Pluralsight's APIs provide the most efficient way to unlock data and extend the platform into your internal systems and workflows. Our APIs are powered by GraphQL, a technology that gives you exactly what you need intuitively and efficiently.

    While Pluralsight's previous REST APIs offered a limited dataset focused on courses, usage, and user management, GraphQL APIs expand the datasets to channels, roles, skills, and more. GraphQL also allows you to replace multiple REST queries with a single query which includes explicit data requirements. This article contains sample code and developer resources that will help you migrate from REST to GraphQL.

    Important: To enhance security, privacy, and performance, Pluralsight is retiring multiple fields across GraphQL queries and several REST APIs. Many of these changes involve replacing all variants of the userId field with the new equivalents (e.g., userId > psUserId, ownerId > ownerPsUserId). See the deprecation guide (opens in a new tab) for a complete list of updated field names. Since these new fields differ from the previous userIds and variants, you’ll need to update your scripts by November 10, 2025, to ensure accurate reporting. The tables below provide REST-to-GraphQL mappings for reference; however, you still need to replace the userId fields as outlined in the deprecation guide.


    How GraphQL differs from REST

    A single GraphQL query can fetch the complete array of data per the relationships defined in the schema, instead of multiple requests with REST.

    GraphQL also allows for mutations, allowing you to perform, create, update, and delete operations, thereby replacing CRUD functionality in REST APIs.

    GraphQL has a greater number of API fields available, and queries are simpler and more precise. See the complete Skills GraphQL Schema within the Developer Portal (opens in new tab) for fields and definitions.


    Migrating from REST to GraphQL

    As a plan admin, you have the ability to use GraphQL APIs, create API keys, and submit queries. You also have access to the Developer Portal (opens in new tab), the primary developer resource for working with our APIs. If you’re unsure whether you have plan admin permissions, visit Manage Keys (opens in new tab) to see if you can create a new GraphQL API key.

    Tip: If you’re a developer or analyst, you can still obtain data through APIs by having your plan admin generate and share their API key with you.

    If you want to start fresh with GraphQL, use the Developer Portal to complete these steps:

    1. Generate an API key (opens in new tab).
    2. Learn how to build your First GraphQL API Query (opens in new tab).
    3. Copy one of the sample code snippets from the tables below to begin testing your Queries in the built-in GraphQL Playground (opens in new tab). Consult the API documentation in the Developer Portal to add or remove fields as required.

    If you'd rather modify your existing REST queries, see examples of how to modify your queries below.

    Course Daily Usage API

    For applicable filters for the GraphQL Content Usage API, please see courseDailyUsage (opens in new tab).

    See Content usage (opens in new tab) if you're looking to migrate from the REST Content Usage API.

    REST API GraphQL API Sample query
    userId user { id } {
        courseDailyUsage {
            nodes {
                user {
                    id
                    firstName
                    lastName
                    email
                    team {
                        name
                    }
                    note
                    isOnAccount
                }
                course {
                    id
                    slug
                    title
                }
                rollupDate
                clipViewSeconds
            }
        }
    }
    firstName user { firstName }
    lastName user { lastName }
    email user { email }
    teamName user { team {name} }
    note user { note }
    isOnAccount user { isOnAccount }
    contentType Not available
    contentId course { id }
    contentSlug course { slug }
    contentName course { title }
    viewDate rollupDate
    usageInSeconds clipViewSeconds
    REST API Filter example GraphQL API filter example Example description
    &startDate=2023-12-21
    &endDate=2023-12-31
    filter: {
        startDate: “2023-12-21”
        endDate: “2023-12-31”
    }
    Use this filter to pull delta reports (example daily, weekly or biweekly reports). GraphQL API is based on the field lastActivityOn.

    Note: There could be a 24-hour data lag, so to get data from the 24th, for example, pull data on the 26th.

    User API

    Use this if you're looking to migrate from the REST Users API (opens in new tab).

    For applicable filters for the GraphQL Users API, please see Users (opens in new tab).

    REST API GraphQL API  Sample query
    userId id {
        users {
            nodes {
                id
                firstName
                lastName
                email
                startedOn
                note
              teams {
              edges {
             isDirect
               node {
             name

                }
            }
        }
    email email
    firstName firstName
    lastName lastName
    startDate startedOn
    note note
    teamName teams
    –or–
    teamNames
    Not available isOnAccount
    Not available removedOn
    Not available currentSsoIdentifier
    Not available ssoEnabled
    Not available planId
    Not available createdOn
    Not available additionalEmails

    Note: By default, the Users API includes all current as well as historical licensed users on the plan. Use isCurrent userFilter (opens in new tab) to extract current users only.


    Content completion APIs

    If you're looking to migrate from the Content Completion REST API, there are two options available:

    1. CourseProgress API (opens in new tab) only provides data from Video courses (opens in new tab).
    2. ContentProgress API (opens in new tab) provides data from content types like videos, guides, paths, interactive courses and projects. This API is currently in Beta.

    Course Progress API

    The GraphQL Course Progress API (opens in new tab) includes courses that are in progress.

    REST API  GraphQL API  Sample query
    userId user { id } {
        courseProgress {
            nodes {
                user {
                    id
                    firstName
                    lastName
                    email
                  teams {
                  edges {
                isDirect
                   node {
                name
              }
           }
       }

                    note
                    isOnAccount
                }
                course {
                    id
                    title
                    slug
                }
                firstViewedClipOn
                percentComplete
                isCourseCompleted
                completedOn
            }
        }
    }
    firstName user { firstName }
    lastName user { lastName }
    email user { email }
    teamName user { teams {name} }
    note user { note }
    isOnAccount user { isOnAccount }
    contentType Not available
    contentId course { id }
    contentSlug course { slug }
    contentName course { title }
    firstActivityDate firstViewedClipOn
    percentComplete percentComplete
    completionStatus isCourseCompleted
    completionDate completedOn

    For applicable filters for the Course Progress API, please see Course progress filter (opens in new tab).

    Content Progress API

    For applicable filters for the Content Progress API (opens in new tab), please see Content progress filter (opens in new tab).

    REST API  GraphQL API  Sample query
    userId user { id } {
    contentProgress {
    nodes {
    user {
    id
    firstName
    lastName
    email
    teams {
    edges {
    isDirect
    node {
    name
    }
    }
    }

    note
    isOnAccount
    }
    firstActivityOn
    percentComplete
    isComplete
    completedOn
    }
    }
    }
    firstName user { firstName }
    lastName user { lastName }
    email user { email }
    teamName user { team {name} }
    note user { note }
    isOnAccount user { isOnAccount }
    contentType contentType
    contentId contentId
    contentSlug contentSlug
    contentName contentTitle
    firstActivityDate firstActivityOn
    percentComplete percentComplete
    completionStatus isComplete
    completionDate completedOn

    Course Daily Usage API

    Use the Course Daily Usage API (opens in new tab) if you're looking to migrate from the REST course usage API (opens in new tab).

    For applicable filters for the GraphQL Course Daily Usage API, please see Course daily usage filter (opens in new tab).

    REST API GraphQL API  Sample query
    userId user { id } {
        courseDailyUsage {
            nodes {
                user {
                    id
                    firstName
                    lastName
                    email
                  teams {
                  edges {
                isDirect
                  node {
                name
            }
         }
     }

                    note
                    isOnAccount
                }
                course {
                    id
                    slug
                    title
                }
                rollupDate
                clipViewSeconds
            }
        }
    }
    firstName user { firstName }
    lastName user { lastName }
    email user { email }
    teamName user { teams {name} }
    note user { note }
    isOnAccount user { isOnAccount }
    contentType Not applicable
    contentId course { id }
    contentSlug course { slug }
    contentName course { title }
    viewDate rollupDate
    usageInSeconds clipViewSeconds

    License management APIs

    Member Invite API

    Use the Member Invite API (opens in new tab) if you’re looking to migrate from the REST Get All Invites API (opens in new tab).

    Note: The REST API returns a note field by default. If you need the same field in GraphQL, call Users API and input the redeemedByPsUserId value in the filter as shown in the sample code.

    REST API GraphQL API  Sample query
    Fields {
      memberInvites {
        nodes {
          planUserId
          planId
          sentToEmail
          sentOn
          expiresOn
          redeemedByPsUserId
          status
        }
      }
    }

    {
      users(filter: {ids: “<Input redeemedByUserId value here>”}) {
        nodes {
          id
          note
        }
      }
    }
    id planUserId
    Not available planId
    email sentToEmail
    note redeemedByUser
    sendDate sentOn
    expiresOn expiresOn
    note Not available
    email sentToEmail
    teamId Not available

    Invite Member API—Mutation or Write API

    Use the Invite Member API—Mutation or Write API (opens in new tab) if you're looking to migrate from the REST Invite new user API (opens in new tab).

    REST API  GraphQL API  Sample query
    email email mutation {
      inviteMember(input: {
        email: “<insert email here>”,
        teamIds: <Insert teamId here>,
        note: “<Insert note here>”}) {
        planUserId
        email
        teamIds
        note
      }
    }
    teamId teamIds
    note note

    Cancel Invite—Mutation or Write API

    Use the Cancel invite API (opens in new tab) if you’re looking to migrate from the REST Cancel invite API (opens in new tab).

    REST API  GraphQL API  Sample query
    id planUserId mutation {
      cancelInvite(input: {
         planUserId: “<Insert planUserID here>”}) {
           planUserId
       }
    }

    Users API

    Use the Users API (opens in new tab) if you’re looking to migrate from the REST Get all Users API (opens in new tab).

    REST API GraphQL API Sample query  
    Fields {
      users {
        nodes {
          id
          email
          additionalEmails
          firstName
          lastName
          startedOn
          createdOn
          note
          teams {
            edges {
              node {
                id
              }
            }
          }
          isOnAccount
          removedOn
          currentSsoIdentifier
        }
      }
    }
     
    id id  
    Not available additionalEmails  
    Not available createdOn  
    teamId teams { id }  
    firstName firstName  
    lastName lastName  
    email email  
    note note  
    Not available startedOn  
    Not available isOnAccount  
    Not available removedOn  
    Not available currentSsoIdentifier  
    Filters  
    firstName Not available  
    lastName Not available  
    email emails  
    note notes  
    teamId Not available  
    Not available ssoIdentifiers  
    Not available isCurrent  
    Not available ids  

    Get user by ID API

    Use the Get user by ID API (opens in new tab) if you’re looking to migrate from the REST Get user by ID API (opens in new tab).

    REST API  GraphQL API Sample query
    id id {
      users (filter: {ids:”<Insert user ID here>”})  {
        nodes {
          id
          email
          additionalEmails
          firstName
          lastName
          startedOn
          createdOn
          note
          teams {
            edges {
              node {
                id
              }
            }
          }
          isOnAccount
          removedOn
          currentSsoIdentifier
        }
      }
    }
    Not available additionalEmails
    Not available createdOn
    teamId teams { id }
    firstName firstName
    lastName lastName
    email email
    note note
    Not available startedOn
    Not available isOnAccount
    Not available removedOn
    Not available currentSsoIdentifier

    Edit user API—Mutation or Write API

    Use the Edit user API—Mutation or Write API (opens in new tab) if you’re looking to migrate from the REST update user API (opens in new tab).

    REST API GraphQL API Sample query
    teamId moveMemberToTeam mutation {
      editUser (input: {
       userId: “<insert user ID>”,
       firstName: “<Insert first name here>”,            
       lastName: “<insert last name>”,
       email: “<“Insert email Id here>”,
        remoteUserId: “<“Insert remote user ID here>”}) {
        userId
        firstName
        lastName
        email
        remoteUserId
      }
    }
    note note
    email email
    Not available userId
    Not available firstName
    Not available lastName
    Not available remoteUserId

    Remove user API—Mutation or Write API

    Use the Remove user API—Mutation or Write API (opens in new tab) if you’re looking to migrate from the REST Remove user API (opens in new tab).

    REST API  GraphQL  Sample query
    id userId mutation {
      removeUser(input:{userId:”<Insert user id here>“}){
        userId
      }
    }

    Teams API

    Use the Teams API (opens in new tab) if you’re looking to migrate from the REST Get all teams API (opens in new tab).

    REST API  GraphQL API  Sample query
    Fields {
     teams {
      nodes{
        id
        name
        planId
        groupId
        description
      }
    }
    id id
    name name
    Not available planId
    Not available description
    Filters
    name name
    Not available description

    Was this article helpful?