> For the complete documentation index, see [llms.txt](https://docs.parameter1.com/identity-x-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.parameter1.com/identity-x-api/querying-data.md).

# Querying Data

When accessing data via the IdentityX GraphQL API, all requests (except those to retrieve user and organization authorization) must include an organization identifier or application identifier header with the request, in order to identify which segment of data should be accessed.

{% hint style="info" %}
Only a few high-level actions are documented here. To see the details of all available queries, mutations, and inputs, use a GraphQL client with a schema browser, such as [Insomnia](https://insomnia.rest) or [GraphQL playground](https://github.com/graphql/graphql-playground).
{% endhint %}

### Active User

Once [authenticated](/identity-x-api/authentication.md), the `activeUser` mutation can be used to verify authentication status and see details of the authenticated `OrgUser`.

```http
POST /graphql HTTP/1.1
Content-Type: application/json
Host: identity-x.parameter1.com
Authorization: Bearer OrgUser <org-user-api-token>

{"query":"query { activeUser { id email } }"}
```

### User Organizations

To list the available organizations for the currently authenticated user, use the `userOrganizations` query:

```http
POST /graphql HTTP/1.1
Content-Type: application/json
Host: identity-x.parameter1.com
Authorization: Bearer OrgUser <org-user-api-token>

{"query":"query { userOrganizations { id role organization { id name } } }"}
```

### Organization Applications

To list the available applications for the current organization, use the `organizationApplications` query:

{% hint style="info" %}
Make sure to send the `x-org-id: <organization-id>` header with this request!
{% endhint %}

```graphql
query {
  organizationApplications {
    id
    name
    description
  }
}
```

### Application Users

To list users for the current application, use the `appUsers` query.

{% hint style="info" %}
Make sure to send the `x-app-id: <application-id>` header with this request!
{% endhint %}

{% hint style="warning" %}
This API requires the use of cursor pagination. While `limit` and `skip` are supported pagination inputs, the maximum allowed value for `limit` is `200.` For queries iterating over large results, use cursor pagination for improved performance.
{% endhint %}

```graphql
query ListAppUsers($input: AppUsersQueryInput!) {
  appUsers(input: $input) {
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      node {
        id
        email
        # ...other user fields
      }
    }
  }
}
```

When using cursor pagination, send the supplied `endCursor`  value as the `pagination.after` parameter. While `hasNextPage` is true, the `endCursor` will indicate where the next page of results should start:

```graphql
query ListAppUsers($input: AppUsersQueryInput!) {
  appUsers(input: {
    pagination: {
      after: "<previous-end-cursor-value">
    }
  }) {
    totalCount
    pageInfo {
      hasNextPage
      endCursor
    }
    edges {
      node {
        id
        email
        # ...other user fields
      }
    }
  }
}
```
