> ## 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 Users User ID Get

> Get an internal Affinity user by ID: name, emails, status and role. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Get an internal Affinity user by ID: name, emails, status and role.

> [!NOTE]
>
> Tool ID: `affinity_v2_users_user_id_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_users_user_id_get',
  {
    "userId": 123
  },
);

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

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute affinity_v2_users_user_id_get --input '{
  "userId": 123
}' --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": {
    "id": 123,
    "firstName": "Jane",
    "lastName": "Doe",
    "primaryEmailAddress": "jane.doe@example.com",
    "photoUrl": "https://example.com",
    "status": "active"
  }
}
```

Use `deepline describe affinity_v2_users_user_id_get --json` for the latest machine-readable contract.

## Input reference

\| ⚠️ This endpoint is currently in BETA | |--| Returns information about a single internal User, including name, primary email address, all email addresses, photo URL, account status, and account role. The `userId` path parameter is the same identifier as the User's corresponding Person ID — every internal User has a matching Person record, and they share the same numeric ID. You can use a Person ID returned from any Persons endpoint here, and vice versa. The `emailAddresses` and `role` properties are only returned to callers with the "Manage Users" [permission](https://deepline.com/docs/pages/external-api-v2/permissions).

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.userId` | `integer` | Yes | — | User ID Format: `int32`. Minimum: 1. Maximum: 2147483647. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "| ⚠️ This endpoint is currently in BETA | |--| Returns information about a single internal User, including name, primary email address, all email addresses, photo URL, account status, and account role. The `userId` path parameter is the same identifier as the User's corresponding Person ID — every internal User has a matching Person record, and they share the same numeric ID. You can use a Person ID returned from any Persons endpoint here, and vice versa. The `emailAddresses` and `role` properties are only returned to callers with the \"Manage Users\" [permission](/pages/external-api-v2/permissions).",
    "properties": {
      "userId": {
        "type": "integer",
        "description": "User ID",
        "minimum": 1,
        "maximum": 2147483647,
        "format": "int32"
      }
    },
    "required": [
      "userId"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | — |
| `result.data.id` | `integer` | Yes | — | Format: `int32`. Minimum: 1. Maximum: 2147483647. |
| `result.data.firstName` | `string` | Yes | — | — |
| `result.data.lastName` | `string \| null` | Yes | — | — |
| `result.data.primaryEmailAddress` | `string \| null` | Yes | — | Format: `email`. |
| `result.data.emailAddresses` | `array` | No | — | Maximum items: 100. |
| `result.data.photoUrl` | `string \| null` | Yes | — | Format: `uri`. |
| `result.data.status` | `"active" \| "invited" \| "deactivated"` | Yes | — | Allowed: `active`, `invited`, `deactivated`. |
| `result.data.role` | `string` | No | — | — |
| `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": {
          "id": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647,
            "format": "int32"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": [
              "string",
              "null"
            ]
          },
          "primaryEmailAddress": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "emailAddresses": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "format": "email"
            }
          },
          "photoUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "invited",
              "deactivated"
            ]
          },
          "role": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "firstName",
          "lastName",
          "primaryEmailAddress",
          "photoUrl",
          "status"
        ],
        "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.