Interface UsersAPI

interface UsersAPI {
    clearCache: () => void;
    countUsers: (
        query: { tenantId?: string },
        options?: ApiCallOptions,
    ) => Promise<CountUsersHttpResponse>;
    createUser: (
        body: UserPostSchema,
        options?: ApiCallOptions,
    ) => Promise<CreateUserHttpResponse>;
    deleteUser: (
        userId: string,
        options?: ApiCallOptions,
    ) => Promise<DeleteUserHttpResponse>;
    filterUsers: (
        query: {
            fields?: string;
            limit?: number;
            next?: string;
            prev?: string;
            sort?: "name" | "-name" | "+name";
        },
        body: Filter,
        options?: ApiCallOptions,
    ) => Promise<FilterUsersHttpResponse>;
    getMyUser: (options?: ApiCallOptions) => Promise<GetMyUserHttpResponse>;
    getUser: (
        userId: string,
        query: { fields?: string },
        options?: ApiCallOptions,
    ) => Promise<GetUserHttpResponse>;
    getUsers: (
        query: {
            email?: string;
            endingBefore?: string;
            fields?: string;
            filter?: string;
            limit?: number;
            next?: string;
            prev?: string;
            role?: string;
            sort?:
                | "subject"
                | "clientId"
                | "status"
                | "id"
                | "name"
                | "+status"
                | "-status"
                | "email"
                | "-name"
                | "+name"
                | "+createdAt"
                | "-createdAt"
                | "createdAt"
                | "+id"
                | "-id"
                | "_id"
                | "+_id"
                | "-_id"
                | "tenantId"
                | "+tenantId"
                | "-tenantId"
                | "+clientId"
                | "-clientId"
                | "+subject"
                | "-subject"
                | "+email"
                | "-email"
                | "inviteExpiry"
                | "+inviteExpiry"
                | "-inviteExpiry";
            sortBy?: "name";
            sortOrder?: "asc"
            | "desc";
            startingAfter?: string;
            status?: "active" | "disabled" | "deleted" | "invited" | "provisioned";
            subject?: string;
            tenantId?: string;
            totalResults?: boolean;
        },
        options?: ApiCallOptions,
    ) => Promise<GetUsersHttpResponse>;
    inviteUsers: (
        body: InviteRequestData,
        options?: ApiCallOptions,
    ) => Promise<InviteUsersHttpResponse>;
    patchUser: (
        userId: string,
        body: JSONPatchArray,
        options?: ApiCallOptions,
    ) => Promise<PatchUserHttpResponse>;
}
Index

Properties

clearCache: () => void

Clears the cache for users api requests.

Type declaration

    • (): void
    • Clears the cache for users api requests.

      Returns void

countUsers: (
    query: { tenantId?: string },
    options?: ApiCallOptions,
) => Promise<CountUsersHttpResponse>

Returns the number of users in a given tenant

Type declaration

    • (
          query: { tenantId?: string },
          options?: ApiCallOptions,
      ): Promise<CountUsersHttpResponse>
    • Returns the number of users in a given tenant

      Parameters

      • query: { tenantId?: string }

        an object with query parameters

        • OptionaltenantId?: string

          The tenant ID to filter by.

      • Optionaloptions: ApiCallOptions

      Returns Promise<CountUsersHttpResponse>

      CountUsersHttpError

an object with query parameters

CountUsersHttpError

createUser: (
    body: UserPostSchema,
    options?: ApiCallOptions,
) => Promise<CreateUserHttpResponse>

Creates an invited user.

Type declaration

an object with the body content

CreateUserHttpError

deleteUser: (
    userId: string,
    options?: ApiCallOptions,
) => Promise<DeleteUserHttpResponse>

Deletes the requested user.

Type declaration

The ID of the user to delete.

DeleteUserHttpError

filterUsers: (
    query: {
        fields?: string;
        limit?: number;
        next?: string;
        prev?: string;
        sort?: "name" | "-name" | "+name";
    },
    body: Filter,
    options?: ApiCallOptions,
) => Promise<FilterUsersHttpResponse>

Retrieves a list of users matching the filter using an advanced query string.

Type declaration

    • (
          query: {
              fields?: string;
              limit?: number;
              next?: string;
              prev?: string;
              sort?: "name" | "-name" | "+name";
          },
          body: Filter,
          options?: ApiCallOptions,
      ): Promise<FilterUsersHttpResponse>
    • Retrieves a list of users matching the filter using an advanced query string.

      Parameters

      • query: {
            fields?: string;
            limit?: number;
            next?: string;
            prev?: string;
            sort?: "name" | "-name" | "+name";
        }

        an object with query parameters

        • Optionalfields?: string

          A comma-delimited string of the requested fields per entity. If the 'links' value is omitted, then the entity HATEOAS link will also be omitted.

        • Optionallimit?: number

          The number of user entries to retrieve.

        • Optionalnext?: string

          Get users with IDs that are higher than the target user ID. Cannot be used in conjunction with prev.

        • Optionalprev?: string

          Get users with IDs that are lower than the target user ID. Cannot be used in conjunction with next.

        • Optionalsort?: "name" | "-name" | "+name"

          The field to sort by, with +/- prefix indicating sort order

      • body: Filter

        an object with the body content

      • Optionaloptions: ApiCallOptions

      Returns Promise<FilterUsersHttpResponse>

      FilterUsersHttpError

an object with query parameters

an object with the body content

FilterUsersHttpError

getMyUser: (options?: ApiCallOptions) => Promise<GetMyUserHttpResponse>

Redirects to retrieve the user resource associated with the JWT claims.

Type declaration

GetMyUserHttpError

getUser: (
    userId: string,
    query: { fields?: string },
    options?: ApiCallOptions,
) => Promise<GetUserHttpResponse>

Returns the requested user.

Type declaration

    • (
          userId: string,
          query: { fields?: string },
          options?: ApiCallOptions,
      ): Promise<GetUserHttpResponse>
    • Returns the requested user.

      Parameters

      • userId: string

        The user's unique identifier

      • query: { fields?: string }

        an object with query parameters

        • Optionalfields?: string

          A comma-delimited string of the requested fields per entity. If the 'links' value is omitted, then the entity HATEOAS link will also be omitted.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetUserHttpResponse>

      GetUserHttpError

The user's unique identifier

an object with query parameters

GetUserHttpError

getUsers: (
    query: {
        email?: string;
        endingBefore?: string;
        fields?: string;
        filter?: string;
        limit?: number;
        next?: string;
        prev?: string;
        role?: string;
        sort?:
            | "subject"
            | "clientId"
            | "status"
            | "id"
            | "name"
            | "+status"
            | "-status"
            | "email"
            | "-name"
            | "+name"
            | "+createdAt"
            | "-createdAt"
            | "createdAt"
            | "+id"
            | "-id"
            | "_id"
            | "+_id"
            | "-_id"
            | "tenantId"
            | "+tenantId"
            | "-tenantId"
            | "+clientId"
            | "-clientId"
            | "+subject"
            | "-subject"
            | "+email"
            | "-email"
            | "inviteExpiry"
            | "+inviteExpiry"
            | "-inviteExpiry";
        sortBy?: "name";
        sortOrder?: "asc"
        | "desc";
        startingAfter?: string;
        status?: "active" | "disabled" | "deleted" | "invited" | "provisioned";
        subject?: string;
        tenantId?: string;
        totalResults?: boolean;
    },
    options?: ApiCallOptions,
) => Promise<GetUsersHttpResponse>

Returns a list of users using cursor-based pagination.

Type declaration

    • (
          query: {
              email?: string;
              endingBefore?: string;
              fields?: string;
              filter?: string;
              limit?: number;
              next?: string;
              prev?: string;
              role?: string;
              sort?:
                  | "subject"
                  | "clientId"
                  | "status"
                  | "id"
                  | "name"
                  | "+status"
                  | "-status"
                  | "email"
                  | "-name"
                  | "+name"
                  | "+createdAt"
                  | "-createdAt"
                  | "createdAt"
                  | "+id"
                  | "-id"
                  | "_id"
                  | "+_id"
                  | "-_id"
                  | "tenantId"
                  | "+tenantId"
                  | "-tenantId"
                  | "+clientId"
                  | "-clientId"
                  | "+subject"
                  | "-subject"
                  | "+email"
                  | "-email"
                  | "inviteExpiry"
                  | "+inviteExpiry"
                  | "-inviteExpiry";
              sortBy?: "name";
              sortOrder?: "asc"
              | "desc";
              startingAfter?: string;
              status?: "active" | "disabled" | "deleted" | "invited" | "provisioned";
              subject?: string;
              tenantId?: string;
              totalResults?: boolean;
          },
          options?: ApiCallOptions,
      ): Promise<GetUsersHttpResponse>
    • Returns a list of users using cursor-based pagination.

      Parameters

      • query: {
            email?: string;
            endingBefore?: string;
            fields?: string;
            filter?: string;
            limit?: number;
            next?: string;
            prev?: string;
            role?: string;
            sort?:
                | "subject"
                | "clientId"
                | "status"
                | "id"
                | "name"
                | "+status"
                | "-status"
                | "email"
                | "-name"
                | "+name"
                | "+createdAt"
                | "-createdAt"
                | "createdAt"
                | "+id"
                | "-id"
                | "_id"
                | "+_id"
                | "-_id"
                | "tenantId"
                | "+tenantId"
                | "-tenantId"
                | "+clientId"
                | "-clientId"
                | "+subject"
                | "-subject"
                | "+email"
                | "-email"
                | "inviteExpiry"
                | "+inviteExpiry"
                | "-inviteExpiry";
            sortBy?: "name";
            sortOrder?: "asc"
            | "desc";
            startingAfter?: string;
            status?: "active" | "disabled" | "deleted" | "invited" | "provisioned";
            subject?: string;
            tenantId?: string;
            totalResults?: boolean;
        }

        an object with query parameters

        • Optionalemail?: string

          The email to filter by. Deprecated. Use the new filter parameter to provide an advanced query filter.

        • OptionalendingBefore?: string

          Get users with IDs that are lower than the target user ID. Cannot be used in conjunction with startingAfter. Deprecated. Use prev instead.

        • Optionalfields?: string

          A comma-delimited string of the requested fields per entity. If the 'links' value is omitted, then the entity HATEOAS link will also be omitted.

        • Optionalfilter?: string

          The advanced filtering to use for the query. Refer to RFC 7644 for the syntax. Cannot be combined with any of the fields marked as deprecated. All conditional statements within this query parameter are case insensitive.

          The following fields support the eq operator: id, subject, name, email, status, clientId, assignedRoles.id assignedRoles.name, assignedGroups.id, assignedGroupsAssignedRoles.name

          Additionally, the following fields support the co operator: name, email, subject

          Queries may be rate limited if they differ greatly from these examples:

          (id eq "62716ab404a7bd8626af9bd6" or id eq "62716ac4c7e500e13ff5fa22") and (status eq "active" or status eq "disabled")
          
          name co "query" or email co "query" or subject co "query" or id eq "query" or assignedRoles.name eq "query"
          

          Any filters for status must be grouped together and applied to the whole query.

          Valid:

          (name eq "Bob" or name eq "Alice") and (status eq "active" or status eq "disabled")
          

          Invalid:

          name eq "Bob" or name eq "Alice" and (status eq "active" or status eq "disabled")
          
        • Optionallimit?: number

          The number of user entries to retrieve.

        • Optionalnext?: string

          Get users that come after this cursor value when sorted. Cannot be used in conjunction with prev.

        • Optionalprev?: string

          Get users that come before this cursor value when sorted. Cannot be used in conjunction with next.

        • Optionalrole?: string

          The role to filter by. Deprecated.

        • Optionalsort?:
              | "subject"
              | "clientId"
              | "status"
              | "id"
              | "name"
              | "+status"
              | "-status"
              | "email"
              | "-name"
              | "+name"
              | "+createdAt"
              | "-createdAt"
              | "createdAt"
              | "+id"
              | "-id"
              | "_id"
              | "+_id"
              | "-_id"
              | "tenantId"
              | "+tenantId"
              | "-tenantId"
              | "+clientId"
              | "-clientId"
              | "+subject"
              | "-subject"
              | "+email"
              | "-email"
              | "inviteExpiry"
              | "+inviteExpiry"
              | "-inviteExpiry"

          The field to sort by, with +/- prefix indicating sort order

        • OptionalsortBy?: "name"

          The user parameter to sort by. Deprecated. Use sort instead.

        • OptionalsortOrder?: "asc" | "desc"

          The sort order, either ascending or descending. Deprecated. Use sort instead.

        • OptionalstartingAfter?: string

          Get users with IDs that are higher than the target user ID. Cannot be used in conjunction with endingBefore. Deprecated. Use next instead.

        • Optionalstatus?: "active" | "disabled" | "deleted" | "invited" | "provisioned"

          The status to filter by. Supports multiple values delimited by commas. Deprecated. Use the new filter parameter to provide an advanced query filter.

        • Optionalsubject?: string

          The subject to filter by. Deprecated. Use the new filter parameter to provide an advanced query filter.

        • OptionaltenantId?: string

          The tenant ID to filter by. Deprecated.

        • OptionaltotalResults?: boolean

          Whether to return a total match count in the result. Defaults to false. It will trigger an extra DB query to count, reducing the efficiency of the endpoint.

      • Optionaloptions: ApiCallOptions

      Returns Promise<GetUsersHttpResponse>

      GetUsersHttpError

an object with query parameters

GetUsersHttpError

inviteUsers: (
    body: InviteRequestData,
    options?: ApiCallOptions,
) => Promise<InviteUsersHttpResponse>

Invite one or more users by email address.

Type declaration

an object with the body content

InviteUsersHttpError

patchUser: (
    userId: string,
    body: JSONPatchArray,
    options?: ApiCallOptions,
) => Promise<PatchUserHttpResponse>

Updates fields for a user resource

Type declaration

The ID of the user to update.

an object with the body content

PatchUserHttpError