> ## 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

> Check which Affinity user, organization and API permissions the connected key belongs to. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Check which Affinity user, organization and API permissions the connected key belongs to.

> [!NOTE]
>
> Tool ID: `affinity_v2_auth_whoami_get`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
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={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute affinity_v2_auth_whoami_get --input '{}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "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 describe 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 requires no input fields.

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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](https://deepline.com/docs/providers/affinity/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.