# Account users / members

### GraphQL Endpoint

## GraphQL endpoint to perform user operations

<mark style="color:green;">`POST`</mark> `https://{custom_subdomain}.everreal.co/api/reporting/graphql`

Body of the request should follow GraphQL mutation structure like

`mutation {`\
&#x20;  `mutationName(input: {MutationNameInput!})`\
&#x20;  `{ MutationNamePayload }`\
`}`

### Account user Query

To query an user from Everreal use user query

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

```
GET http://{custom_subdomain}.everreal.co/api/reporting/graphql
--header 'Authorization: Bearer eyJhbGci...'
{"query":"..."}
```

{% endtab %}

{% tab title="Schema" %}

```graphql
type User {
  id: String
  email: String
  firstName: String
  lastName: String
  profilePicture: IFile
  companyUser: companyUser
}

type companyUser {
  companyId: String
}

type Query {
  users(input: UserFilterListPaging): [User]
}

input UserFilterListPaging {
  filter: UserFilter
  paging: GraphPaging
  sort: GraphSorting
}

input UserFilter {
  id: String
  email: String
}

```

{% endtab %}
{% endtabs %}

Below we are providing a full example how to get a user by email

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

```graphql
query {
  users(input: { paging: { take: 10, skip: 0 }, filter: { email: "email@domain.co" } }) {
    id
    email
  }
}
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl --location --request POST 'http://{subdomain}.everreal.co/api/reporting/graphql' \
--header 'Authorization: Bearer ....' \
--header 'Content-Type: application/json' \
--header 'Cookie: accept-language=de-DE' \
--data-raw '{"query":"query {\r\n  users(input: { paging: { take: 10, skip: 0 }, filter: { email: \"email@domain.co\" } }) {\r\n    id\r\n    email\r\n  }\r\n}","variables":{}}'
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("Authorization", "Bearer ...");
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Cookie", "accept-language=de-DE");

var graphql = JSON.stringify({
  query: "query {\r\n  users(input: { paging: { take: 10, skip: 0 }, filter: { email: \"email@domain.co\" } }) {\r\n    id\r\n    email\r\n  }\r\n}",
  variables: {}
})
var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: graphql,
  redirect: 'follow'
};

fetch("http://{subdomain}.everreal.co/api/reporting/graphql", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}
{% endtabs %}
