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

# Sign Up

Create a DealMachine account and receive an API key. No authentication is required.

This endpoint is intended for API onboarding flows. The new account starts with subscription status `none`, so data endpoints return `403 subscription_required` until checkout is completed.

Calling this endpoint confirms acceptance of the DealMachine [Terms of Service](https://www.dealmachine.com/terms-of-service) and [Privacy Policy](https://www.dealmachine.com/privacy-policy) for the account being created.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.v2.dealmachine.com/v1/signup \
    -H "Content-Type: application/json" \
    -d '{
      "email": "developer@example.com",
      "first_name": "Ada",
      "last_name": "Lovelace",
      "phone_number": "+15551234567"
    }'
  ```

  ```typescript Node.js theme={null}
  const response = await fetch('https://api.v2.dealmachine.com/v1/signup', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      email: 'developer@example.com',
      first_name: 'Ada',
      last_name: 'Lovelace',
      phone_number: '+15551234567',
    }),
  });

  const signup = await response.json();
  console.log(signup.api_key);
  ```

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

  response = requests.post(
      'https://api.v2.dealmachine.com/v1/signup',
      json={
          'email': 'developer@example.com',
          'first_name': 'Ada',
          'last_name': 'Lovelace',
          'phone_number': '+15551234567'
      }
  )

  signup = response.json()
  print(signup['api_key'])
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "api_key": "dm_sk_live_xxxxxxxxxxxxxxxxxxxxxxxx",
    "key_id": "key_abc123def456",
    "organization": {
      "id": 42,
      "name": "Ada Lovelace's Team",
      "slug": "team-user-123"
    },
    "message": "Account created. Store this API key securely."
  }
  ```

  ```json 409 Email Already Exists theme={null}
  {
    "error": {
      "code": "email_already_exists",
      "message": "An account with this email already exists",
      "request_id": "req_abc123"
    }
  }
  ```
</ResponseExample>

## Request Body

| Field          | Type   | Required | Description                                                                                           |
| -------------- | ------ | -------- | ----------------------------------------------------------------------------------------------------- |
| `email`        | string | Yes      | Account email address                                                                                 |
| `first_name`   | string | No       | First name                                                                                            |
| `last_name`    | string | No       | Last name                                                                                             |
| `phone_number` | string | No       | Phone number in E.164 format. Required only when the configured Clerk instance requires phone numbers |

## Rate Limits

`POST /v1/signup` is rate limited per IP address:

| Window | Limit |
| ------ | ----- |
| Hour   | 5     |
| Day    | 20    |

When the limit is exceeded, the API returns `429 signup_rate_limited` with a `Retry-After` header.

## Response Fields

| Field               | Type   | Description                                              |
| ------------------- | ------ | -------------------------------------------------------- |
| `api_key`           | string | The API key. Store it securely because it is shown once. |
| `key_id`            | string | API key identifier                                       |
| `organization.id`   | number | Organization ID                                          |
| `organization.name` | string | Organization name                                        |
| `organization.slug` | string | Organization slug                                        |

<Tip>
  Use the returned key with `dm login --key dm_sk_live_xxx` if you want the CLI to store it locally.
</Tip>
