---
updatedAt: 2026-08-18T18:39:20.000Z
agentTools:
  projectIndex: https://stockpit.readme.io/llms.txt
---

# Queries

User profiles define the role, permissions and configuration of a user.

# Available queries

### `CurrentUserProfile` - Returns the current user profile of the authenticated user

```graphql
query {
  CurrentUserProfile {
    id
    user_id
    company_id
    active
    label
    company {
      id
      label
    }
    user {
      id
      label
      email
    }
  }
}
```

### `UserProfile` - Returns a single user profile based on the `id` provided

```graphql
query {
  UserProfile (id: 100012) {
    id
    user_id
    company_id
    active
    label
    user {
      id
      label
      email
    }
  }
}
```

### `UserProfiles` - Returns a list of user profiles based on the filters defined

```graphql
query {
  UserProfiles {
    data {
      id
      user_id
      company_id
      active
      label
      user {
        id
        label
        email
      }
    }
  }
}
```

### `PartnerCompanyUserProfiles` - Returns a list of user profiles of partner companies based on the filters defined

```graphql
query {
  PartnerCompanyUserProfiles {
    data {
      id
      user_id
      company_id
      active
      label
      user {
        id
        label
        email
      }
    }
  }
}
```

<br />

***

# Available fields

| id <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int)  </span> |
| :------------------------------------------------------------------------------------ |
| Unique identifier of the user profile                                                 |

| user\_id <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int)  </span> |
| :------------------------------------------------------------------------------------------ |
| Id of the user linked to the user profile                                                   |

| company\_id <span style={{ fontWeight: "normal" }}>- [Int](/reference/data-types#int)  </span> |
| :--------------------------------------------------------------------------------------------- |
| Id of the company the user profile belongs to                                                  |

| active <span style={{ fontWeight: "normal" }}>- [Boolean](/reference/data-types#boolean)  </span> |
| :------------------------------------------------------------------------------------------------ |
| If true, the user profile is active                                                               |

| label <span style={{ fontWeight: "normal" }}>- [String](/reference/data-types#string)  </span> |
| :--------------------------------------------------------------------------------------------- |
| Label of the user profile                                                                      |

| company <span style={{ fontWeight: "normal" }}>- [Company](/reference/company-queries)  </span> |
| :---------------------------------------------------------------------------------------------- |
| Company the user profile belongs to                                                             |

| user <span style={{ fontWeight: "normal" }}>- [User](/reference/user-queries)  </span> |
| :------------------------------------------------------------------------------------- |
| User linked to the user profile                                                        |

| impersonating\_user\_profile <span style={{ fontWeight: "normal" }}>- [UserProfile](/reference/user-profile-queries)  </span> |
| :---------------------------------------------------------------------------------------------------------------------------- |
| User profile impersonating this user profile                                                                                  |

| has\_booked\_call <span style={{ fontWeight: "normal" }}>- [Boolean](/reference/data-types#boolean)  </span> |
| :----------------------------------------------------------------------------------------------------------- |
| If true, the user of this profile has booked a call with the support team                                    |

<br />

***

# Filters

## UserProfiles

You can create filters based on following fields

| id                                                             |
| :------------------------------------------------------------- |
| Example: { "column": "ID", "operator": "EQ", "value": 100012 } |

| user\_id                                                            |
| :------------------------------------------------------------------ |
| Example: { "column": "USER_ID", "operator": "EQ", "value": 100012 } |

| active                                                           |
| :--------------------------------------------------------------- |
| Example: { "column": "ACTIVE", "operator": "EQ", "value": true } |

## PartnerCompanyUserProfiles

You can create filters based on following fields

| id                                                             |
| :------------------------------------------------------------- |
| Example: { "column": "ID", "operator": "EQ", "value": 100012 } |

| user\_id                                                            |
| :------------------------------------------------------------------ |
| Example: { "column": "USER_ID", "operator": "EQ", "value": 100012 } |

| company\_id                                                            |
| :--------------------------------------------------------------------- |
| Example: { "column": "COMPANY_ID", "operator": "EQ", "value": 100000 } |

| active                                                           |
| :--------------------------------------------------------------- |
| Example: { "column": "ACTIVE", "operator": "EQ", "value": true } |

***

# Sorting

You can sort data based on following fields : id

```graphql
query UserProfiles(
  $orderBy: [QueryUserProfilesOrderByOrderByClause!],
  $where: QueryUserProfilesWhereWhereConditions,
  $first: Int,
  $page: Int
) {
  UserProfiles(
    orderBy: $orderBy
    where: $where
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
      count
      currentPage
      perPage
    }
    data {
      id
      user_id
      company_id
      active
      label
      company {
        id
        label
      }
      user {
        id
        label
        email
      }
    }
  }
}
```

```json Variables (JSON)
{
  "orderBy": [
    {
      "column": "ID",
      "order": "ASC"
    }
  ],
  "first": 50,
  "page": 1
}
```

## Example of a query

```graphql
query UserProfiles(
  $orderBy: [QueryUserProfilesOrderByOrderByClause!],
  $where: QueryUserProfilesWhereWhereConditions,
  $first: Int,
  $page: Int
) {
  UserProfiles(
    orderBy: $orderBy
    where: $where
    first: $first
    page: $page
  ) {
    paginatorInfo {
      total
    }
    data {
      id
      user_id
      company_id
      active
      label
    }
  }
}
```

```json
{
  "orderBy": [
    {
      "column": "ID",
      "order": "ASC"
    }
  ],
  "first": 50,
  "page": 1,
  "where": {
    "AND": [
      {
        "AND": [
          {
            "column": "ACTIVE",
            "operator": "EQ",
            "value": true
          },
          {
            "column": "USER_ID",
            "operator": "EQ",
            "value": 100012
          }
        ]
      }
    ]
  }
}
```

## Example of data returned

```json
{
  "data": {
    "UserProfiles": {
      "paginatorInfo": {
        "total": 1,
        "count": 1,
        "currentPage": 1,
        "perPage": 50
      },
      "data": [
        {
          "id": 100012,
          "user_id": 100012,
          "company_id": 100000,
          "active": true,
          "label": "John Doe"
        }
      ]
    }
  }
}
```