---
title: "POST /api/v2/identities/search"
method: POST
path: "/api/v2/identities/search"
tags: ["Identities"]
---

# POST /api/v2/identities/search

`POST /api/v2/identities/search`

Search machine identities across organization and/or project scopes. Returns identities the caller has access to, each annotated with all roles assigned to that membership.

## Request body

- object
  - `scope` string[] — Array of scopes to search across. Accepts 'organization' to include organization-level identities and/or 'project' to include identities from projects the caller has access to. Defaults to ['organization'].
  - `orderBy` 'name' | 'role' | 'lastLogin' — The column to order identities by.
  - `orderDirection` 'asc' | 'desc' — The direction to order identities in.
  - `limit` integer — The number of identities to return.
  - `offset` integer — The offset to start from. If you enter 10, it will start from the 10th identity.
  - `search` object — The filters to apply to the search.
    - `name` union — The name of the identity to filter by.
      - string
      - object
        - `$eq` string
        - `$contains` string
        - `$in` string[]
    - `role` union — The role to filter by. Matches against the role name or slug for custom roles and the role type for predefined roles.
      - string
      - object
        - `$eq` string
        - `$contains` string
        - `$in` string[]
    - `$or` object[]
      - `name` union — The name of the identity to filter by.
        - string
        - object
          - `$eq` string
          - `$contains` string
          - `$in` string[]
      - `role` union — The role to filter by. Matches against the role name or slug for custom roles and the role type for predefined roles.
        - string
        - object
          - `$eq` string
          - `$contains` string
          - `$in` string[]

## Response `200`

Default Response

- object
  - `identities` object[], required
    - `id` string, required
    - `identityId` string, required
    - `scope` 'organization' | 'project', required
    - `orgId` string, required
    - `projectId` string, nullable
    - `project` object, nullable
      - `id` string, required
      - `name` string, required
      - `slug` string, required
      - `type` string, required
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time, required
    - `lastLoginAuthMethod` string, nullable
    - `lastLoginTime` string, date-time, nullable
    - `roles` object[], required
      - `id` string, required
      - `role` string, required
      - `customRoleId` string, nullable
      - `customRoleName` string, nullable
      - `customRoleSlug` string, nullable
      - `customRoleDescription` string, nullable
      - `isTemporary` boolean, required
      - `temporaryMode` string, nullable
      - `temporaryRange` string, nullable
      - `temporaryAccessStartTime` string, date-time, nullable
      - `temporaryAccessEndTime` string, date-time, nullable
    - `identity` object, required
      - `name` string, required
      - `id` string, uuid, required
      - `hasDeleteProtection` boolean
      - `orgId` string, uuid, required
      - `authMethods` string[], required
      - `activeLockoutAuthMethods` string[], required
  - `totalCount` number, required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response
- `404` — Default Response
- `422` — Default Response
- `500` — Default Response

---

[API](https://skmtc.net/infisical/apis/infisical-api.md) · [All operations](https://skmtc.net/infisical/apis/infisical-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/infisical/infisical-api/versions/885aef3e6c11/schema)
