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

# Identities

> SDK reference for the Identities resource (TypeScript & Python)

## Create Identity

`POST /v1/identities` — createIdentity

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Identities } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Identities.createIdentity({
    body: {
      source: 'https://example.com'
    }
  });
  console.log(result);
  ```

  ```python Python theme={null}
  from anchorbrowser import Anchorbrowser

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.identities.create_identity(
      source="https://example.com",
  )
  print(result)
  ```
</CodeGroup>

## Get Identity

`GET /v1/identities/{identityId}` — getIdentity

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Identities } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Identities.getIdentity({
    path: {
      identityId: 'your-identityId'
    }
  });
  console.log(result);
  ```

  ```python Python theme={null}
  from anchorbrowser import Anchorbrowser

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.identities.get_identity(
      "your-identity-id",
  )
  print(result)
  ```
</CodeGroup>

## Update Identity

`PUT /v1/identities/{identityId}` — updateIdentity

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Identities } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Identities.updateIdentity({
    path: {
      identityId: 'your-identityId'
    },
    body: {}
  });
  console.log(result);
  ```

  ```python Python theme={null}
  from anchorbrowser import Anchorbrowser

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.identities.update_identity(
      "your-identity-id",
  )
  print(result)
  ```
</CodeGroup>

## Delete Identity

`DELETE /v1/identities/{identityId}` — deleteIdentity

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Identities } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Identities.deleteIdentity({
    path: {
      identityId: 'your-identityId'
    }
  });
  console.log(result);
  ```

  ```python Python theme={null}
  from anchorbrowser import Anchorbrowser

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.identities.delete_identity(
      "your-identity-id",
  )
  print(result)
  ```
</CodeGroup>

## Reauthenticate Identity

`POST /v1/identities/{identityId}/reauthenticate` — reauthenticateIdentity

<CodeGroup>
  ```typescript TypeScript theme={null}
  import { client, Identities } from 'anchorbrowser';

  // ANCHORBROWSER_API_KEY is read from the environment by default;
  // set it explicitly like this:
  client.setConfig({ auth: () => 'your-api-key' });

  const result = await Identities.reauthenticateIdentity({
    path: {
      identityId: 'your-identityId'
    }
  });
  console.log(result);
  ```

  ```python Python theme={null}
  from anchorbrowser import Anchorbrowser

  # ANCHORBROWSER_API_KEY is read from the environment by default;
  # set it explicitly with Anchorbrowser(api_key="your-api-key")
  client = Anchorbrowser()

  result = client.identities.reauthenticate_identity(
      "your-identity-id",
  )
  print(result)
  ```
</CodeGroup>
