Kuali GraphQL Documentation

Guides

Lookup a user

Get the Kuali User ID for a user.


Overview

Often you will need the internal Kuali ID for a user. You can use the GraphQL API to lookup that ID using other information like person's email address or school id.

Lookup user by school id

You can use a userConnection query to lookup a user by their school id. Pass their school id as a variable q to the GraphQL query.

Query

query ($query: String) {
  usersConnection(args: { query: $query }) {
    edges {
      node {
        id
        displayName
        email
        username
        firstName
        lastName
        schoolId
      }
    }
  }
}

Variables

{
  "query": "4873973"
}

Results

Note the id attribute in the node object. That's the ID you can use to reference the user directly.

{
  "data": {
    "usersConnection": {
      "edges": [
        {
          "node": {
            "id": "63d8932766c11a157c1d1ed1",
            "displayName": "Pat Smith",
            "email": "pat.smith@kies.edu",
            "username": "patsmith",
            "firstName": "Pat",
            "lastName": "Smith",
            "schoolId": "4873973"
          }
        }
      ]
    }
  }
}