Method: projects.tenants.accounts.query

Looks up user accounts within a project or a tenant based on conditions in the request.

HTTP request

POST https://identitytoolkit.googleapis.com/v1/projects/{targetProjectId}/tenants/{tenantId}/accounts:query

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
targetProjectId

string

The ID of the project to which the result is scoped.

Authorization requires the following IAM permission on the specified resource targetProjectId:

  • firebaseauth.users.get
tenantId

string

The ID of the tenant to which the result is scoped.

Request body

The request body contains data with the following structure:

JSON representation
{
  "returnUserInfo": boolean,
  "limit": string,
  "offset": string,
  "sortBy": enum (SortByField),
  "order": enum (Order),
  "expression": [
    {
      object (SqlExpression)
    }
  ]
}
Fields
returnUserInfo

boolean

If true, this request will return the accounts matching the query. If false, only the count of accounts matching the query will be returned. Defaults to true.

limit

string (int64 format)

The maximum number of accounts to return with an upper limit of 500. Defaults to 500. Only valid when returnUserInfo is set to true.

offset

string (int64 format)

The number of accounts to skip from the beginning of matching records. Only valid when returnUserInfo is set to true.

sortBy

enum (SortByField)

The field to use for sorting user accounts. Defaults to USER_ID. Note: when phoneNumber is specified in expression, the result ignores the sorting. Only valid when returnUserInfo is set to true.

order

enum (Order)

The order for sorting query result. Defaults to ascending order. Only valid when returnUserInfo is set to true.

expression[]

object (SqlExpression)

Query conditions used to filter results. If more than one is passed, only the first SqlExpression is evaluated.

Response body

If successful, the response body contains an instance of QueryUserInfoResponse.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/identitytoolkit
  • https://www.googleapis.com/auth/firebase
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.