Skip to main content

Read user details

The APIs described in this topic help you retrieve information about users in a marketplace.

Read users (REST)

Use the following requests to retrieve specific users or a list of all users in your marketplace.

GET https://{marketplaceUrl}/api/account/v2/users

To retrieve information about specific users, you must provide the user ID in the request.

GET https://{marketplaceUrl}/api/account/v2/users/{userUuid}

Refer to the List all users and Read a user API references for details on authorization rules and the full list of supported request body and query parameters.

Read users (GraphQL)

Use the following queries to retrieve user details:

  • users — retrieves a list of users in the marketplace
  • user - retrieves information about a specific user based on an ID
  • userByExternalId - retrieves information about a specific user based on an external identifier
  • me - retrieves information about the user running the queries

See the descriptions in the GraphQL API reference for details on authorization rules and the full list of supported query parameters.

List all users (GraphQL)

The users query retrieves a complete list of all users in the marketplace. As this list can be extensive, you can use pagination arguments to specify how the results are to be returned. For more information, see Pagination.

You can also specify other attribute values to filter results:

  • email - returns only the user with a specific email address
  • lastModified - returns users whose data was last modified on the specified date.
  • name - returns users whose first or last name matches a string you can specify

Query

query users(first: $first, after: $after, last: $last, before: $before, filter: $filter, orderBy: $orderBy) {
nodes {
firstName
lastName
email
id
}
}

Variables

{
"email": $email,
"lastModified": $modificationDate,
"name": $String
}

Response

{
"data": {
"users": {
"nodes": [
{
"firstName": "John",
"lastName": "Smith",
"email": "john.smith@mycompany.com",
"id": "98765a4b-c3d2-10e9-8f7g-65432h10i987"
},
{
"firstName": "Frederick",
"lastName": "Jones",
"email": "fred.jones@mycompany.com",
"id": "a22d9a85-22a6-48c9-adc7-1c17d3a14542"
} ]
}}

Read a user (GraphQL)

The following example shows how you can use the user query to retrieve details of a specific user. Query

query {
user(id: $id) {
firstName
lastName
email
externalId
id
locale
username
memberships {
account {
name
id
status
}
isLastUsed
roles
status
}
}
}

Variables

id: "98765a4b-c3d2-10e9-8f7g-65432h10i987"

Response

{
"data": {
"user": {
"firstName": "John",
"lastName": "Smith",
"email": "john.smith@mycompany.com",
"externalId": "a123456",
"id": "98765a4b-c3d2-10e9-8f7g-65432h10i987",
"locale": "en-US",
"username": "jsmith",
"memberships": [
{
"account": {
"name": "My Company Inc.",
"id": "017eb76e-957f-409e-8be3-fc6fed394137",
"status": "ENABLED"
}
"isLastUsed": true,
"roles": [
"ACCOUNT_BILLING_ADMIN",
"ACCOUNT_ADMIN"
],
"status": "ENABLED"
}
]
}
}

Read the current user (GraphQL)

The following example shows how you can use the 'me' query to retrieve details of the active user running the query. This query requires no arguments.

Query

query {
me {
firstName
lastName
email
externalId
id
locale
username
memberships {
account {
name
id
status
}
isLastUsed
roles
status
}
}
}

Response

{
"data": {
"user": {
"firstName": "Martin",
"lastName": "manager",
"email": "martin.manager@mycompany.com",
"externalId": "a111111",
"id": "11111a1a-a1a1-11a1-1a1a-11111a11a111",
"locale": "en-US",
"username": "mmanager",
"memberships": [
{
"account": {
"name": "My Company Inc.",
"id": "017eb76e-957f-409e-8be3-fc6fed394137",
"status": "ENABLED"
}
"isLastUsed": true,
"roles": [
"ACCOUNT_BILLING_ADMIN",
"CHANNEL_SUPPORT",
"DEVELOPER",
"CHANNEL_ADMIN",
"CHANNEL_PRODUCT_SUPPORT",
"CHANNEL_SALES_SUPPORT",
"ACCOUNT_ADMIN"
],
"status": "ENABLED"
}
]
}
}
}

Was this page helpful?