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

# Get Account

Get your organization info and authentication details. Works with both API keys and OAuth tokens.

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.v2.dealmachine.com/v1/account \
    -H "Authorization: Bearer dm_sk_live_xxx"
  ```

  ```typescript Node.js theme={null}
  const response = await fetch('https://api.v2.dealmachine.com/v1/account', {
    headers: {
      Authorization: `Bearer ${apiKey}`,
    },
  });

  const { data } = await response.json();
  console.log(data.organization.name);
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.v2.dealmachine.com/v1/account',
      headers={'Authorization': f'Bearer {api_key}'}
  )

  data = response.json()['data']
  print(data['organization']['name'])
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "data": {
      "organization": {
        "id": 1,
        "name": "My Company",
        "createdAt": "2024-01-01T00:00:00.000Z"
      },
      "user": {
        "id": null,
        "authType": "api_key"
      },
      "plan": {
        "name": "Basic",
        "enrichment_credit_cap": 30000,
        "total_enrichment_credit_cap": 30000,
        "total_enrichment_credit_available": 29998,
        "monthly_enrichment_credit_cap": 30000,
        "additional_enrichment_credit_balance": 0,
        "is_paid": true,
        "billing_cycle_start": "2024-01-01T00:00:00.000Z",
        "billing_cycle_end": "2024-02-01T00:00:00.000Z"
      }
    }
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "error": {
      "code": "invalid_api_key",
      "message": "Invalid API key",
      "request_id": "req_abc123"
    }
  }
  ```
</ResponseExample>

## Response Fields

| Field                                            | Type           | Description                                                 |
| ------------------------------------------------ | -------------- | ----------------------------------------------------------- |
| `data.organization.id`                           | number         | Organization ID                                             |
| `data.organization.name`                         | string         | Organization name                                           |
| `data.organization.createdAt`                    | string         | ISO 8601 creation timestamp                                 |
| `data.user.id`                                   | number \| null | User ID (null for API key auth)                             |
| `data.user.authType`                             | string         | `api_key` or `oauth`                                        |
| `data.plan.name`                                 | string         | Plan name                                                   |
| `data.plan.enrichment_credit_cap`                | number         | Monthly data credit cap                                     |
| `data.plan.total_enrichment_credit_cap`          | number         | Total current-cycle capacity, including additional credits  |
| `data.plan.total_enrichment_credit_available`    | number         | Total spendable data credits remaining in the current cycle |
| `data.plan.monthly_enrichment_credit_cap`        | number         | Monthly data credit cap                                     |
| `data.plan.additional_enrichment_credit_balance` | number         | Additional credits available after monthly credits are used |
| `data.plan.is_paid`                              | boolean        | Whether the plan is paid                                    |
| `data.plan.billing_cycle_start`                  | string         | ISO 8601 billing cycle start                                |
| `data.plan.billing_cycle_end`                    | string         | ISO 8601 billing cycle end                                  |

<Note>
  `total_enrichment_credit_available` is the live remaining balance, not the plan cap. It reconciles
  current reservations with recorded credit usage, using the same balance calculation as the Usage
  endpoint and DealMachine app.
</Note>

<Note>
  When authenticated with an API key, `user.id` is `null` because API keys are organization-level,
  not user-level. OAuth tokens include the user ID of the person who authorized the token.
</Note>
