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

# Affinity: V2 Auth Whoami Get

> Get current user. Affinity V2 Auth Whoami Get reference includes SDK V2 and CLI requests, input constraints, response fields, and Deepline cost.

Get current user.

<Info>
  Tool ID: `affinity_v2_auth_whoami_get`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'affinity_v2_auth_whoami_get',
  {},
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute affinity_v2_auth_whoami_get --input '{}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "tenant": {
      "id": 123,
      "name": "Example",
      "subdomain": "example.com"
    },
    "user": {
      "id": 123,
      "firstName": "Jane",
      "lastName": "Doe",
      "emailAddress": "jane.doe@example.com"
    },
    "grant": {
      "type": "api-key",
      "scopes": [
        "example"
      ],
      "createdAt": "2026-01-15T12:00:00Z"
    }
  }
}
```

Use `deepline tools get affinity_v2_auth_whoami_get --json` for the latest machine-readable contract.

## Input reference

Returns information about the authenticated user, their current organization, and API key permissions. Use this endpoint to verify your authentication and understand your available API access levels.

This action does not require input fields.

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Returns information about the authenticated user, their current organization, and API key permissions. Use this endpoint to verify your authentication and understand your available API access levels.",
    "properties": {},
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name                            | Type                          | Required | Default | Details                                                 |
| ------------------------------- | ----------------------------- | -------- | ------- | ------------------------------------------------------- |
| `result.data`                   | `object`                      | Yes      | —       | —                                                       |
| `result.data.tenant`            | `object`                      | Yes      | —       | —                                                       |
| `result.data.tenant.id`         | `integer`                     | Yes      | —       | Format: `int64`. Minimum: 1. Maximum: 9007199254740991. |
| `result.data.tenant.name`       | `string`                      | Yes      | —       | —                                                       |
| `result.data.tenant.subdomain`  | `string`                      | Yes      | —       | Format: `hostname`.                                     |
| `result.data.user`              | `object`                      | Yes      | —       | —                                                       |
| `result.data.user.id`           | `integer`                     | Yes      | —       | Format: `int64`. Minimum: 1. Maximum: 9007199254740991. |
| `result.data.user.firstName`    | `string`                      | Yes      | —       | —                                                       |
| `result.data.user.lastName`     | `string \| null`              | Yes      | —       | —                                                       |
| `result.data.user.emailAddress` | `string`                      | Yes      | —       | Format: `email`.                                        |
| `result.data.grant`             | `object`                      | Yes      | —       | —                                                       |
| `result.data.grant.type`        | `"api-key" \| "access-token"` | Yes      | —       | Allowed: `api-key`, `access-token`.                     |
| `result.data.grant.scopes`      | `array`                       | Yes      | —       | —                                                       |
| `result.data.grant.createdAt`   | `string`                      | Yes      | —       | Format: `date-time`.                                    |
| `result.meta`                   | `object`                      | No       | —       | —                                                       |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "properties": {
      "data": {
        "type": "object",
        "properties": {
          "tenant": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "name": {
                "type": "string"
              },
              "subdomain": {
                "type": "string",
                "format": "hostname"
              }
            },
            "required": [
              "id",
              "name",
              "subdomain"
            ],
            "additionalProperties": false
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "format": "int64"
              },
              "firstName": {
                "type": "string"
              },
              "lastName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "emailAddress": {
                "type": "string",
                "format": "email"
              }
            },
            "required": [
              "emailAddress",
              "firstName",
              "id",
              "lastName"
            ],
            "additionalProperties": false
          },
          "grant": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "api-key",
                  "access-token"
                ]
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "createdAt",
              "scopes",
              "type"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "grant",
          "tenant",
          "user"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Affinity provider guide](/docs/providers/affinity/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
