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

# Register Company

> Create a new company/employer account

## Endpoint

```
POST /api/v1/auth/register/company
```

**Base URL**: `http://localhost:3000/api/v1`

<Note>This endpoint is **public** and does not require authentication.</Note>

## Request Body

<ParamField body="email" type="string" required>
  Company's email address. Must be unique and valid format.
</ParamField>

<ParamField body="password" type="string" required>
  Company account password. Minimum 6 characters.
</ParamField>

<ParamField body="name" type="string" required>
  Company name.
</ParamField>

<ParamField body="industry" type="string" required>
  Industry sector (e.g., "Technology", "Healthcare", "Finance").
</ParamField>

<ParamField body="size" type="string" required>
  Company size. Must be one of: - `SIZE_1_50` - 1-50 employees - `SIZE_51_200` - 51-200 employees -
  `SIZE_201_1000` - 201-1,000 employees - `SIZE_1000_PLUS` - 1,000+ employees
</ParamField>

<ParamField body="type" type="string" required>
  Company type. Must be one of: - `STARTUP` - `SCALE_UP` - `ENTERPRISE` - `NON_PROFIT` -
  `GOVERNMENT`
</ParamField>

## Request Shape

```typescript theme={null}
interface RegisterCompanyDto {
  email: string;
  password: string;
  name: string;
  industry: string;
  size: CompanySize;
  type: CompanyType;
}
```

## Response

### Success Response (201 Created)

```typescript theme={null}
interface RegisterCompanyResponse {
  success: boolean;
  data: {
    email: string;
    role: 'company';
  };
  message: string;
  meta: {
    timestamp: string;
    path: string;
    method: string;
  };
}
```

```json theme={null}
{
  "success": true,
  "data": {
    "email": "hr@techcorp.com",
    "role": "company"
  },
  "message": "Company registration successful. Please check your email to verify your account.",
  "meta": {
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/auth/register/company",
    "method": "POST"
  }
}
```

<ResponseField name="success" type="boolean">
  Indicates if the registration was successful.
</ResponseField>

<ResponseField name="data" type="object">
  Contains the registered company's email.

  <Expandable title="properties">
    <ResponseField name="email" type="string">
      The email address of the newly registered company.
    </ResponseField>

    <ResponseField name="role" type="string">
      User role. Always returns "company".
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="message" type="string">
  Success message: "Company registration successful. Please check your email to verify your
  account."
</ResponseField>

<ResponseField name="meta" type="object">
  Request metadata from global response interceptor.

  <Expandable title="properties">
    <ResponseField name="timestamp" type="string">
      ISO timestamp of the response.
    </ResponseField>

    <ResponseField name="path" type="string">
      Request path.
    </ResponseField>

    <ResponseField name="method" type="string">
      HTTP method.
    </ResponseField>
  </Expandable>
</ResponseField>

## What Happens After Registration

<Steps>
  <Step title="Company Account Created">
    Company account is created in database with: - `isVerified: false` - `isActive: true` - All
    optional fields set to `null` (description, logoUrl, etc.)
  </Step>

  <Step title="Password Hashed">Password is securely hashed using bcrypt before storage</Step>

  <Step title="OTP Generated">
    A 6-digit OTP code is generated and stored in Redis (valid for 10 minutes)
  </Step>

  <Step title="Email Queued">
    Verification email with OTP is queued via BullMQ for async delivery
  </Step>

  <Step title="Next Step">
    Company must verify email using the [Verify Email](/api-reference/auth/verify-email) endpoint
  </Step>
</Steps>

## Error Responses

### 400 Bad Request - Validation Error

Returned when request validation fails.

```json theme={null}
{
  "success": false,
  "error": {
    "message": [
      "size must be one of the following values: SIZE_1_50, SIZE_51_200, SIZE_201_1000, SIZE_1000_PLUS",
      "type must be one of the following values: STARTUP, SCALE_UP, ENTERPRISE, NON_PROFIT, GOVERNMENT"
    ],
    "statusCode": 400,
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/auth/register/company",
    "method": "POST",
    "details": "Bad Request"
  }
}
```

**Common validation errors**:

* `email must be an email` - Invalid email format
* `password must be longer than or equal to 6 characters` - Password too short
* `name should not be empty` - Missing company name
* `industry should not be empty` - Missing industry
* `size must be one of the following values: ...` - Invalid company size
* `type must be one of the following values: ...` - Invalid company type

### 409 Conflict - Email Already Exists

Returned when the email is already registered.

```json theme={null}
{
  "success": false,
  "error": {
    "message": "An account with this email already exists",
    "statusCode": 409,
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/auth/register/company",
    "method": "POST",
    "details": "Conflict"
  }
}
```

**Solution**: Use a different email or login with existing account.

### 500 Internal Server Error

Returned when an unexpected error occurs.

```json theme={null}
{
  "success": false,
  "error": {
    "message": "Failed to create company",
    "statusCode": 500,
    "timestamp": "2026-04-23T20:00:00.000Z",
    "path": "/auth/register/company",
    "method": "POST",
    "details": "Internal Server Error"
  }
}
```

<Info>
  Error responses follow the global API envelope: `success: false` and an `error` object containing
  `message`, `statusCode`, `timestamp`, `path`, `method`, and `details`.
</Info>

## Validation Rules

| Field    | Type             | Required | Rules                                                                           |
| -------- | ---------------- | -------- | ------------------------------------------------------------------------------- |
| email    | string           | Yes      | Must be valid email format, must be unique                                      |
| password | string           | Yes      | Minimum 6 characters                                                            |
| name     | string           | Yes      | Must be non-empty string                                                        |
| industry | string           | Yes      | Must be non-empty string                                                        |
| size     | CompanySize enum | Yes      | Must be one of: `SIZE_1_50`, `SIZE_51_200`, `SIZE_201_1000`, `SIZE_1000_PLUS`   |
| type     | CompanyType enum | Yes      | Must be one of: `STARTUP`, `SCALE_UP`, `ENTERPRISE`, `NON_PROFIT`, `GOVERNMENT` |

## Enums Reference

### Company Size

| Value            | Description         |
| ---------------- | ------------------- |
| `SIZE_1_50`      | 1-50 employees      |
| `SIZE_51_200`    | 51-200 employees    |
| `SIZE_201_1000`  | 201-1,000 employees |
| `SIZE_1000_PLUS` | 1,000+ employees    |

### Company Type

| Value        | Description                        |
| ------------ | ---------------------------------- |
| `STARTUP`    | Early-stage startup company        |
| `SCALE_UP`   | Growing company scaling operations |
| `ENTERPRISE` | Large established corporation      |
| `NON_PROFIT` | Non-profit organization            |
| `GOVERNMENT` | Government agency or public sector |

## TypeScript Types

```typescript theme={null}
// Enums
export enum CompanySize {
  SIZE_1_50 = 'SIZE_1_50',
  SIZE_51_200 = 'SIZE_51_200',
  SIZE_201_1000 = 'SIZE_201_1000',
  SIZE_1000_PLUS = 'SIZE_1000_PLUS',
}

export enum CompanyType {
  STARTUP = 'STARTUP',
  SCALE_UP = 'SCALE_UP',
  ENTERPRISE = 'ENTERPRISE',
  NON_PROFIT = 'NON_PROFIT',
  GOVERNMENT = 'GOVERNMENT',
}

// Registration DTO
export interface RegisterCompanyDto {
  email: string;
  password: string;
  name: string;
  industry: string;
  size: CompanySize;
  type: CompanyType;
}

// Response
export interface RegisterCompanyResponse {
  success: boolean;
  data: {
    email: string;
  };
  message: string;
  meta: {
    timestamp: string;
    path: string;
    method: string;
  };
}
```

## Notes

<Warning>
  **Email Verification Required**: Companies cannot login until they verify their email using the
  OTP sent to their inbox.
</Warning>

<Info>
  **OTP Expiration**: The verification OTP expires after 10 minutes. If expired, companies will need
  to request a new OTP.
</Info>

<Tip>
  **Use Company Email**: It's recommended to use an official company email address (e.g.,
  [hr@company.com](mailto:hr@company.com)) rather than personal email addresses.
</Tip>

## Related Endpoints

* [Verify Email](/api-reference/auth/verify-email) - Verify email with OTP after registration
* [Login](/api-reference/auth/login) - Login to existing account
* [Register Job Seeker](/api-reference/auth/register-job-seeker) - Register as a job seeker instead
