# Users & Participants

## Institution and course owner

Users exist in a variety of levels in Eduflow. [Institutions](/guides/institutions.md) and [courses](/guides/courses.md) allow direct access to their owner. In GraphQL, these are associated with the `User` object type.

### Institution owner

{% tabs %}
{% tab title="Query" %}

```graphql
{
  institution {
    name
    owner {
      name
      email
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "institution": {
      "name": "Dunder Mifflin",
      "owner": {
        "name": "Michael Scott",
        "email": "michael.scott@dunder-mifflin.com"
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Course owner

{% tabs %}
{% tab title="Query" %}

```graphql
{
  course(id: "00000000-5945-95c7-65fd-a9747b200320") {
    owner {
      name
      email
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "course": {
      "owner": {
        "name": "John Smith",
        "email": "john.smith@example.edu"
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

## Course participants

In [courses](/guides/courses.md), users are queried through a pageable [connection](/graphql/pagination.md): `Course.participants`. Since course users have course-specific context associated them (their participant type and status), their `User` objects are wrapped in `Participant`.&#x20;

Participant types: `Owner` (creator of course),  `Admin`s, `Instructor`s, `Assistant`s and `Student`s.

{% tabs %}
{% tab title="Query" %}

```graphql
{
  course(id: "00000000-5944-95c7-65fc-a9747b200320") {
    participants(first: 5) {
      edges {
        node {
          participantType
          participantStatus
          user {
            name
            email
          }
        }
      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "course": {
      "participants": {
        "edges": [
          {
            "node": {
              "participantType": "Owner",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Michael Scarn",
                "email": "michael.scott@dunder-mifflin"
              }
            }
          },
          {
            "node": {
              "participantType": "Teacher",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "John Doe",
                "email": "john.doe@example.edu"
              }
            }
          },
          {
            "node": {
              "participantType": "Teacher",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Gyro",
                "email": "abba.g@example.eu"
              }
            }
          },
          {
            "node": {
              "participantType": "Assistant",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Dwight Schrute",
                "email": "schrute@dunder-mifflin.com"
              }
            }
          },
          {
            "node": {
              "participantType": "Student",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Jim Halpert",
                "email": "jim@dundner-mifflin.com"
              }
            }
          }
        ]
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Searching by username

{% tabs %}
{% tab title="Query" %}

```graphql
{
  course(id: "00000000-5945-95c7-65fc-a9747b2003210") {
    participants(first: 1, searchTerm: "Angela") {
      edges {
        node {
          participantType
          participantStatus
          user {
            name
            email
          }
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="Result" %}

```javascript
{
  "data": {
    "course": {
      "participants": {
        "edges": [
          {
            "node": {
              "participantType": "Student",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Angela Martin",
                "email": "angela.martin@dunder-mifflin.com"
              }
            }
          }
        ]
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Searching by participant type:

{% tabs %}
{% tab title="Query" %}

```graphql
{
  course(id: "00000000-5945-95c7-65fc-a9747b200120") {
    participants(first: 5, participantTypeFilter: Student) {
      edges {
        node {
          participantType
          participantStatus
          user {
            name
            email
          }
        }
      }
    }
  }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "course": {
      "participants": {
        "edges": [
          {
            "node": {
              "participantType": "Student",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Pam Beesly",
                "email": "pam.beesly@dunder-mifflin.com"
              }
            }
          },
          {
            "node": {
              "participantType": "Student",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Ryan Howard",
                "email": "ryan.howard@dunder-mifflin.com"
              }
            }
          },
          {
            "node": {
              "participantType": "Student",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Kevin Malone",
                "email": "kevin.malone@dunder-mifflin.com"
              }
            }
          },
          {
            "node": {
              "participantType": "Student",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Andy Bernard",
                "email": "andy.bernard@dunder-mifflin.com"
              }
            }
          },
          {
            "node": {
              "participantType": "Student",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Phyllis Smith",
                "email": "phyllis.smith@dunder-mifflin.com"
              }
            }
          }
        ]
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Individual participant lookup

{% tabs %}
{% tab title="Query" %}

```graphql
{
  course(id: "00000000-5943-95c7-65fc-a9747b200320") {
    participants(id: "7a41ad8e-f252-449d-8add-13c8ae27470b") {
      edges {
        node {
          participantType
          participantStatus
          user {
            name
            email
          }
        }
      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "course": {
      "participants": {
        "edges": [
          {
            "node": {
              "participantType": "Student",
              "participantStatus": "ACTIVE",
              "user": {
                "name": "Pam Beesly",
                "email": "pam.beesly@dunder-mifflin.com"
              }
            }
          }
        ]
      }
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Participant invite links

Invitation links and embed (a.k.a magic links) can be accessed through the `Participant` response object:

{% tabs %}
{% tab title="Query" %}

```graphql
{
  course(id: "00000000-5943-95c7-65fc-a9747b200320") {
    owner {
      name
      email
    }
    participants {
      edges {
        node {
          participantStatus
          invitationLink
          embedLoginLink
        }
      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```json
{
  "data": {
    "course": {
      "participants": [
        {
          "id": "5a7fdd2c-47d4-4a7f-8576-a640938e5574",
          "participantType": "Student",
          "participantStatus": "INVITATION_PENDING",
          "user": {
            "name": "Thomas Smith"
          },
          "invitationLink": "https://app.eduflow.com/join-from-email?userId=5a7fdd2c-47d4-4a7f-8576-a640938e5574&courseId=00000000-5945-95c7-65fc-a9747b200320&token=eyJ1c2VyX2lkIjoiNWE3ZmRkMmMtNDdkNC00YTdmLTg1NzYtYTY0MDkzOGU1NTc0In0.Fr75Hg.6VbxV2GGVNeKWc4C0xTn5CYTtm0",
          "embedLoginLink": "https://app.eduflow.com/join-from-email?userId=5a7fdd2c-47d4-4a7f-8576-a640938e5574&courseId=00000000-5945-95c7-65fc-a9747b200320&token=eyJ1c2VyX2lkIjoiNWE3ZmRkMmMtNDdkNC00YTdmLTg1NzYtYTY0MDkzOGU1NTc0In0.Fr75Hg.6VbxV2GGVNeKWc4C0xTn5CYTtm0&skip_signup=1"
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

* `invitationLink`:  Will prompt user to create a password
* `embedLoginLink`:  "Magic link", takes user directly to to course


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eduflow.com/guides/participants.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
