Skip to main content

Search Users

POST 

/v2/users

Search for users. By default, we will return users of your organization. Make sure to include a limit and sorting for pagination..

Request​

Body

required

    query

    object

    Object unspecific list filters like offset, limit and asc/desc.

    offset uint64
    limit int64

    Maximum amount of events returned. The default is set to 1000 in https://github.com/zitadel/zitadel/blob/new-eventstore/cmd/zitadel/startup.yaml. If the limit exceeds the maximum configured ZITADEL will throw an error. If no limit is present the default is taken.

    asc boolean

    default is descending

    sortingColumn the field the result is sorted (string)

    Possible values: [USER_FIELD_NAME_UNSPECIFIED, USER_FIELD_NAME_USER_NAME, USER_FIELD_NAME_FIRST_NAME, USER_FIELD_NAME_LAST_NAME, USER_FIELD_NAME_NICK_NAME, USER_FIELD_NAME_DISPLAY_NAME, USER_FIELD_NAME_EMAIL, USER_FIELD_NAME_STATE, USER_FIELD_NAME_TYPE, USER_FIELD_NAME_CREATION_DATE]

    Default value: USER_FIELD_NAME_UNSPECIFIED

    queries

    object[]

  • Array [

  • userNameQuery

    object

    Query for users with a specific user name.

    userName stringrequired

    Possible values: non-empty and <= 200 characters

    method string

    Possible values: [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE]

    Default value: TEXT_QUERY_METHOD_EQUALS

    defines which text equality method is used

    firstNameQuery

    object

    Query for users with a specific first name.

    firstName stringrequired

    Possible values: non-empty and <= 200 characters

    method string

    Possible values: [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE]

    Default value: TEXT_QUERY_METHOD_EQUALS

    defines which text equality method is used

    lastNameQuery

    object

    Query for users with a specific last name.

    lastName stringrequired

    Possible values: non-empty and <= 200 characters

    method string

    Possible values: [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE]

    Default value: TEXT_QUERY_METHOD_EQUALS

    defines which text equality method is used

    nickNameQuery

    object

    Query for users with a specific nickname.

    nickName stringrequired

    Possible values: non-empty and <= 200 characters

    method string

    Possible values: [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE]

    Default value: TEXT_QUERY_METHOD_EQUALS

    defines which text equality method is used

    displayNameQuery

    object

    Query for users with a specific display name.

    displayName stringrequired

    Possible values: non-empty and <= 200 characters

    method string

    Possible values: [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE]

    Default value: TEXT_QUERY_METHOD_EQUALS

    defines which text equality method is used

    emailQuery

    object

    Query for users with a specific email.

    emailAddress stringrequired

    Possible values: <= 200 characters

    email address of the user

    method string

    Possible values: [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE]

    Default value: TEXT_QUERY_METHOD_EQUALS

    defines which text equality method is used

    stateQuery

    object

    Query for users with a specific state.

    state stringrequired

    Possible values: [USER_STATE_UNSPECIFIED, USER_STATE_ACTIVE, USER_STATE_INACTIVE, USER_STATE_DELETED, USER_STATE_LOCKED, USER_STATE_INITIAL]

    Default value: USER_STATE_UNSPECIFIED

    current state of the user

    typeQuery

    object

    Query for users with a specific type.

    type stringrequired

    Possible values: [TYPE_UNSPECIFIED, TYPE_HUMAN, TYPE_MACHINE]

    Default value: TYPE_UNSPECIFIED

    the type of the user

    loginNameQuery

    object

    Query for users with a specific state.

    loginName stringrequired

    Possible values: non-empty and <= 200 characters

    method string

    Possible values: [TEXT_QUERY_METHOD_EQUALS, TEXT_QUERY_METHOD_EQUALS_IGNORE_CASE, TEXT_QUERY_METHOD_STARTS_WITH, TEXT_QUERY_METHOD_STARTS_WITH_IGNORE_CASE, TEXT_QUERY_METHOD_CONTAINS, TEXT_QUERY_METHOD_CONTAINS_IGNORE_CASE, TEXT_QUERY_METHOD_ENDS_WITH, TEXT_QUERY_METHOD_ENDS_WITH_IGNORE_CASE]

    Default value: TEXT_QUERY_METHOD_EQUALS

    defines which text equality method is used

    inUserIdsQuery

    object

    Query for users with ID in list of IDs.

    userIds string[]

    the ids of the users to include

    orQuery

    object

    Connect multiple sub-condition with and OR operator.

    queries

    object[]

    the sub queries to 'OR'

  • Array [

  • 0
    1
    2
    3
    4
    5
    6
    7
    8
    9
  • ]

  • andQuery

    object

    Connect multiple sub-condition with and AND operator.

    queries

    object[]

    the sub queries to 'AND'

  • Array [

  • 0
    1
    2
    3
    4
    5
    6
    7
    8
    9
  • ]

  • notQuery

    object

    Negate the sub-condition.

    query

    object

    the sub query to negate (NOT)

    0
    1
    2
    3
    4
    5
    6
    7
    8
    9

    inUserEmailsQuery

    object

    Query for users with email in list of emails.

    userEmails string[]

    the emails of the users to include

    organizationIdQuery

    object

    Query for users under a specific organization as resource owner.

    organizationId stringrequired

    Possible values: non-empty and <= 200 characters

  • ]

Responses​

A list of all users matching the query

Schema

    details

    object

    totalResult uint64
    processedSequence uint64
    timestamp date-time

    the last time the projection got updated

    sortingColumn string

    Possible values: [USER_FIELD_NAME_UNSPECIFIED, USER_FIELD_NAME_USER_NAME, USER_FIELD_NAME_FIRST_NAME, USER_FIELD_NAME_LAST_NAME, USER_FIELD_NAME_NICK_NAME, USER_FIELD_NAME_DISPLAY_NAME, USER_FIELD_NAME_EMAIL, USER_FIELD_NAME_STATE, USER_FIELD_NAME_TYPE, USER_FIELD_NAME_CREATION_DATE]

    Default value: USER_FIELD_NAME_UNSPECIFIED

    result

    object[]

  • Array [

  • userId string

    details

    object

    sequence uint64

    on read: the sequence of the last event reduced by the projection

    on manipulation: the timestamp of the event(s) added by the manipulation

    changeDate date-time

    on read: the timestamp of the last event reduced by the projection

    on manipulation: the timestamp of the event(s) added by the manipulation

    resourceOwner resource_owner is the organization or instance_id an object belongs to (string)
    state string

    Possible values: [USER_STATE_UNSPECIFIED, USER_STATE_ACTIVE, USER_STATE_INACTIVE, USER_STATE_DELETED, USER_STATE_LOCKED, USER_STATE_INITIAL]

    Default value: USER_STATE_UNSPECIFIED

    current state of the user

    username string
    loginNames string[]
    preferredLoginName string

    human

    object

    one of type use human or machine

    userId string

    Unique identifier of the user.

    state string

    Possible values: [USER_STATE_UNSPECIFIED, USER_STATE_ACTIVE, USER_STATE_INACTIVE, USER_STATE_DELETED, USER_STATE_LOCKED, USER_STATE_INITIAL]

    Default value: USER_STATE_UNSPECIFIED

    current state of the user

    username string

    Username of the user, which can be globally unique or unique on organization level.

    loginNames string[]

    Possible usable login names for the user.

    preferredLoginName string

    Preferred login name of the user.

    profile

    object

    Profile information of the user.

    givenName string

    Possible values: non-empty and <= 200 characters

    familyName string

    Possible values: non-empty and <= 200 characters

    nickName string

    Possible values: <= 200 characters

    displayName string

    Possible values: <= 200 characters

    preferredLanguage string

    Possible values: <= 10 characters

    gender string

    Possible values: [GENDER_UNSPECIFIED, GENDER_FEMALE, GENDER_MALE, GENDER_DIVERSE]

    Default value: GENDER_UNSPECIFIED

    avatarUrl string

    avatar URL of the user

    email

    object

    Email of the user, if defined.

    email string

    Possible values: non-empty and <= 200 characters

    isVerified boolean

    phone

    object

    Phone of the user, if defined.

    phone string

    Possible values: <= 200 characters

    isVerified boolean
    passwordChangeRequired boolean

    User is required to change the used password on the next login.

    passwordChanged date-time

    The time the user last changed their password.

    machine

    object

    one of type use human or machine

    name string
    description string
    hasSecret boolean
    accessTokenType string

    Possible values: [ACCESS_TOKEN_TYPE_BEARER, ACCESS_TOKEN_TYPE_JWT]

    Default value: ACCESS_TOKEN_TYPE_BEARER

    Type of access token to receive

  • ]

Loading...