> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# People SDK Reference

> SDK reference for the People API, available in Node.js and Python.

## People

### List People

Returns a paginated list of people in the current workspace. Use `starting_after` or `ending_before` to page through large collections.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.people.list()

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.people.list();

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "limit": Optional[int],
        "starting_after": Optional[str],
        "ending_before": Optional[str],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      limit?: number;
      startingAfter?: string;
      endingBefore?: string;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "object": str,
        "data": [{
            "id": str,
            "account_id": str,
            "email": str,
            "display_name": str,
            "avatar_url": Optional[str],
            "roles": List[str],
            "groups": List[str],
            "status": Literal["PERSON_STATUS_UNSPECIFIED", "PERSON_STATUS_PENDING", "PERSON_STATUS_ACTIVE"],
            "last_activity": date,  # optional
            "created_at": date,
            "updated_at": date,
        }],
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: string;
      data: {
        id: string;
        accountId: string;
        email: string;
        displayName: string;
        avatarUrl?: string;
        roles: string[];
        groups: string[];
        status: "PERSON_STATUS_UNSPECIFIED" | "PERSON_STATUS_PENDING" | "PERSON_STATUS_ACTIVE";
        lastActivity?: Date;
        createdAt: Date;
        updatedAt: Date;
      }[];
      hasMore: boolean;
    }
    ```
  </CodeGroup>
</Expandable>

### Create a Person

Invites one or more people to the current workspace. If an email is not already registered, a new account is created and an invitation email is sent. Existing accounts are linked directly to the workspace.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.people.create(emails=[
          "<value 1>",
          "<value 2>",
      ])

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.people.create({
      emails: [
        "<value 1>",
        "<value 2>",
      ],
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "emails": List[str],  # required
        "roles": List[str],  # optional
        "groups": List[str],  # optional
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      emails: string[];  // required
      roles?: string[];
      groups?: string[];
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "people": [{
            "id": str,
            "account_id": str,
            "email": str,
            "display_name": str,
            "avatar_url": Optional[str],
            "roles": List[str],
            "groups": List[str],
            "status": Literal["PERSON_STATUS_UNSPECIFIED", "PERSON_STATUS_PENDING", "PERSON_STATUS_ACTIVE"],
            "last_activity": date,  # optional
            "created_at": date,
            "updated_at": date,
        }],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      people: {
        id: string;
        accountId: string;
        email: string;
        displayName: string;
        avatarUrl?: string;
        roles: string[];
        groups: string[];
        status: "PERSON_STATUS_UNSPECIFIED" | "PERSON_STATUS_PENDING" | "PERSON_STATUS_ACTIVE";
        lastActivity?: Date;
        createdAt: Date;
        updatedAt: Date;
      }[];
    }
    ```
  </CodeGroup>
</Expandable>

### Retrieve a Person

Retrieves the details of an existing workspace member or invited user by their person ID.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.people.get(person_id="<id>")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.people.get({
      personId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "person_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      personId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "person": {
            "id": str,
            "account_id": str,
            "email": str,
            "display_name": str,
            "avatar_url": Optional[str],
            "roles": List[str],
            "groups": List[str],
            "status": Literal["PERSON_STATUS_UNSPECIFIED", "PERSON_STATUS_PENDING", "PERSON_STATUS_ACTIVE"],
            "last_activity": date,  # optional
            "created_at": date,
            "updated_at": date,
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      person: {
        id: string;
        accountId: string;
        email: string;
        displayName: string;
        avatarUrl?: string;
        roles: string[];
        groups: string[];
        status: "PERSON_STATUS_UNSPECIFIED" | "PERSON_STATUS_PENDING" | "PERSON_STATUS_ACTIVE";
        lastActivity?: Date;
        createdAt: Date;
        updatedAt: Date;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Delete a Person

Removes a member or invited user from the workspace. API keys owned by the removed user are cascade revoked. The response body is empty when the delete succeeds.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.people.delete(person_id="<id>")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.people.delete({
      personId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "person_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      personId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

### Update a Person

Updates the roles and group assignments of a workspace member. Omitted fields keep their current values.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.people.update(person_id="<id>")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.people.update({
      personId: "<id>",
      updatePersonRequest: {},
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "person_id": str,  # required
        "roles": List[str],  # optional
        "groups": List[str],  # optional
        "clear_roles": Optional[bool],
        "clear_groups": Optional[bool],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      personId: string;  // required
      updatePersonRequest: {  // required
        roles?: string[];
        groups?: string[];
        clearRoles?: boolean;
        clearGroups?: boolean;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "person": {
            "id": str,
            "account_id": str,
            "email": str,
            "display_name": str,
            "avatar_url": Optional[str],
            "roles": List[str],
            "groups": List[str],
            "status": Literal["PERSON_STATUS_UNSPECIFIED", "PERSON_STATUS_PENDING", "PERSON_STATUS_ACTIVE"],
            "last_activity": date,  # optional
            "created_at": date,
            "updated_at": date,
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      person: {
        id: string;
        accountId: string;
        email: string;
        displayName: string;
        avatarUrl?: string;
        roles: string[];
        groups: string[];
        status: "PERSON_STATUS_UNSPECIFIED" | "PERSON_STATUS_PENDING" | "PERSON_STATUS_ACTIVE";
        lastActivity?: Date;
        createdAt: Date;
        updatedAt: Date;
      };
    }
    ```
  </CodeGroup>
</Expandable>

### Resend Invitation

Resends the invitation email to a pending workspace member. Has no effect if the person has already accepted.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.people.resend_invitation(person_id="<id>", resend_invitation_request={})

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.people.resendInvitation({
      personId: "<id>",
      resendInvitationRequest: {},
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "person_id": str,  # required
        "resend_invitation_request": Dict[str, Any],  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      personId: string;  // required
      resendInvitationRequest: Record<string, unknown>;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "person": {
            "id": str,
            "account_id": str,
            "email": str,
            "display_name": str,
            "avatar_url": Optional[str],
            "roles": List[str],
            "groups": List[str],
            "status": Literal["PERSON_STATUS_UNSPECIFIED", "PERSON_STATUS_PENDING", "PERSON_STATUS_ACTIVE"],
            "last_activity": date,  # optional
            "created_at": date,
            "updated_at": date,
        },
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      person: {
        id: string;
        accountId: string;
        email: string;
        displayName: string;
        avatarUrl?: string;
        roles: string[];
        groups: string[];
        status: "PERSON_STATUS_UNSPECIFIED" | "PERSON_STATUS_PENDING" | "PERSON_STATUS_ACTIVE";
        lastActivity?: Date;
        createdAt: Date;
        updatedAt: Date;
      };
    }
    ```
  </CodeGroup>
</Expandable>
