Queries

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

Available queries

CurrentUserProfile - Returns the current user profile of the authenticated user

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

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

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

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


Available fields

id
Unique identifier of the user profile
user_id
Id of the user linked to the user profile
company_id
Id of the company the user profile belongs to
active
If true, the user profile is active
label
Label of the user profile
company
Company the user profile belongs to
user
User linked to the user profile
impersonating_user_profile
User profile impersonating this user profile
has_booked_call
If true, the user of this profile has booked a call with the support team


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

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
      }
    }
  }
}
{
  "orderBy": [
    {
      "column": "ID",
      "order": "ASC"
    }
  ],
  "first": 50,
  "page": 1
}

Example of a query

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
    }
  }
}
{
  "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

{
  "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"
        }
      ]
    }
  }
}