> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.vitablehealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.vitablehealth.com/_mcp/server.

# Create

POST https://api.vitablehealth.com/v1/employers
Content-Type: application/json

Creates a new employer for the authenticated organization. Requires employer name, legal name, EIN, email, and address information. Returns the created employer with its assigned ID.

Reference: https://developer.vitablehealth.com/api/employers/create

## Authentication

- `Authorization` header (bearer token, required) — API Key or Access Token authentication using Bearer token in Authorization header. API keys use the vit_apk_ prefix, access tokens use the vit_at_ prefix.

## Servers

- `https://api.vitablehealth.com` (Production, default)
- `https://api.uat.vitablehealth.com` (UAT)

## Request

### Headers

- `X-Vitable-Organization` (string, optional) — Organization to act as for this request (e.g. `org_SGVsbG8gV29ybGQ`). Optional when your credentials reach a single organization. Required when they reach several — omitting it then returns 400 `organization_required`. A malformed value returns 400 `invalid_organization_header`, and naming an organization you do not have access to returns 403 `organization_access_denied`.

### Body (application/json)

This endpoint expects a CreateEmployerRequest.

- `name` (string, required) — Employer display name
- `legal_name` (string, required) — Legal business name
- `ein` (string, required) — Employer Identification Number (format: XX-XXXXXXX)
- `email` (string, required) — Email address for billing and communications
- `address` (EmployerAddressInput, required) — Employer address
- `phone_number` (string, optional, nullable) — Employer phone number (10-digit US format, e.g. 5551234567)
- `reference_id` (string, optional, nullable) — External reference ID for this employer

## Response

### 201

- `data` (Employer, required) — The employer record.

## Errors

### 400 Bad Request Error

Bad Request - Invalid input or validation error

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 401 Unauthorized Error

Unauthorized - Invalid or missing API key

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 403 Forbidden Error

Forbidden - Insufficient permissions for this resource

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 404 Not Found Error

Not Found - The requested resource does not exist

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 409 Conflict Error

A unique field collides with an existing employer. The `error.code` is one of: `EIN_ALREADY_EXISTS`, `NAME_ALREADY_EXISTS`, `LEGAL_NAME_ALREADY_EXISTS`, `EMAIL_ALREADY_EXISTS`, `PHONE_ALREADY_EXISTS`.

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 422 Unprocessable Entity Error

PO Box address submitted

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 429 Too Many Requests Error

Too Many Requests - Rate limit exceeded

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 500 Internal Server Error

Internal Server Error - An unexpected error occurred

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

### 502 Bad Gateway Error

Bad Gateway - External service error

- `timestamp` (datetime, required) — ISO 8601 timestamp when the error occurred
- `message` (string, required) — Human-readable error message
- `error` (string, required) — Error message (same as message, for backwards compatibility)
- `trace_id` (string, required) — Unique trace ID for debugging and support requests
- `app_error_code` (string, optional, nullable) — Application-specific error code for programmatic handling

## Types

### EmployerAddressInput

- `address_line_1` (string, required) — Primary street address
- `city` (string, required) — City name
- `state` (string, required) — Two-letter state code
- `zipcode` (string, required) — ZIP code
- `address_line_2` (string, optional, nullable) — Secondary street address

### Employer

Serializer for Employer entity in public API responses.

- `id` (string, required) — Unique employer identifier with 'empr_' prefix
- `organization_id` (string, required, nullable) — ID of the parent organization (org_*)
- `name` (string, required) — Display name of the employer
- `legal_name` (string, required) — Legal business name for compliance and tax purposes
- `ein` (string, required, nullable) — Employer Identification Number (format: XX-XXXXXXX)
- `active` (boolean, required) — Whether the employer is currently active in the system
- `address` (EmployerAddress, required) — Employer's primary address
- `contact` (EmployerContact, required, nullable) — Primary company-admin contact, or null
- `created_at` (datetime, required) — Timestamp when the employer was created
- `updated_at` (datetime, required) — Timestamp when the employer was last updated
- `reference_id` (string, optional, nullable) — Partner-assigned reference ID for the employer
- `email` (string, optional, nullable) — Email address for billing and communications
- `phone_number` (string, optional, nullable) — Employer phone number (E.164 format recommended)

### EmployerAddress

Nested address within EmployerSerializer.

- `address_line_1` (string, required) — Primary street address
- `city` (string, required) — City name
- `state` (string, required) — Two-letter state code (e.g., CA, NY)
- `zipcode` (string, required) — ZIP code (5 or 9 digit)
- `address_line_2` (string, optional, nullable) — Secondary street address (apt, suite, etc.)

### EmployerContact

Primary company-admin contact (email + phone; company admins have no person name).

- `email` (string, required, nullable) — Primary contact email
- `phone` (string, required, nullable) — Primary contact phone, or null

## Examples

### Created Employer Response

**Response**

```json
{
  "data": {
    "id": "empr_new123abc",
    "organization_id": "org_xyz789",
    "name": "NewCo Industries",
    "legal_name": "NewCo Industries LLC",
    "ein": "12-3456789",
    "active": true,
    "address": {
      "address_line_1": "789 Business Blvd",
      "city": "Seattle",
      "state": "WA",
      "zipcode": "98101",
      "address_line_2": "Floor 5"
    },
    "contact": {
      "email": "string",
      "phone": "string"
    },
    "created_at": "2024-11-26T10:00:00Z",
    "updated_at": "2024-11-26T10:00:00Z",
    "reference_id": null,
    "email": "hr@newco.com",
    "phone_number": "2065550100"
  }
}
```

**SDK Code**

```python Created Employer Response
import requests

url = "https://api.vitablehealth.com/v1/employers"

headers = {"Authorization": "Bearer <apiKey>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Created Employer Response
const url = 'https://api.vitablehealth.com/v1/employers';
const options = {method: 'POST', headers: {Authorization: 'Bearer <apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Created Employer Response
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.vitablehealth.com/v1/employers"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Created Employer Response
require 'uri'
require 'net/http'

url = URI("https://api.vitablehealth.com/v1/employers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'

response = http.request(request)
puts response.read_body
```

```java Created Employer Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.vitablehealth.com/v1/employers")
  .header("Authorization", "Bearer <apiKey>")
  .asString();
```

```php Created Employer Response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vitablehealth.com/v1/employers', [
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Created Employer Response
using RestSharp;

var client = new RestClient("https://api.vitablehealth.com/v1/employers");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Created Employer Response
import Foundation

let headers = ["Authorization": "Bearer <apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vitablehealth.com/v1/employers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create Employer Request

**Request**

```json
{
  "name": "NewCo Industries",
  "legal_name": "NewCo Industries LLC",
  "ein": "12-3456789",
  "email": "hr@newco.com",
  "address": {
    "address_line_1": "789 Business Blvd",
    "city": "Seattle",
    "state": "WA",
    "zipcode": "98101",
    "address_line_2": "Floor 5"
  },
  "phone_number": "2065550100",
  "reference_id": "partner-emp-001"
}
```

**Response**

```json
{
  "data": {
    "id": "empr_new123abc",
    "organization_id": "org_xyz789",
    "name": "NewCo Industries",
    "legal_name": "NewCo Industries LLC",
    "ein": "12-3456789",
    "active": true,
    "address": {
      "address_line_1": "789 Business Blvd",
      "city": "Seattle",
      "state": "WA",
      "zipcode": "98101",
      "address_line_2": "Floor 5"
    },
    "contact": {
      "email": "string",
      "phone": "string"
    },
    "created_at": "2024-11-26T10:00:00Z",
    "updated_at": "2024-11-26T10:00:00Z",
    "reference_id": null,
    "email": "hr@newco.com",
    "phone_number": "2065550100"
  }
}
```

**SDK Code**

```python Create Employer Request
import requests

url = "https://api.vitablehealth.com/v1/employers"

payload = {
    "name": "NewCo Industries",
    "legal_name": "NewCo Industries LLC",
    "ein": "12-3456789",
    "email": "hr@newco.com",
    "address": {
        "address_line_1": "789 Business Blvd",
        "city": "Seattle",
        "state": "WA",
        "zipcode": "98101",
        "address_line_2": "Floor 5"
    },
    "phone_number": "2065550100",
    "reference_id": "partner-emp-001"
}
headers = {
    "Authorization": "Bearer <apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Create Employer Request
const url = 'https://api.vitablehealth.com/v1/employers';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"NewCo Industries","legal_name":"NewCo Industries LLC","ein":"12-3456789","email":"hr@newco.com","address":{"address_line_1":"789 Business Blvd","city":"Seattle","state":"WA","zipcode":"98101","address_line_2":"Floor 5"},"phone_number":"2065550100","reference_id":"partner-emp-001"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create Employer Request
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.vitablehealth.com/v1/employers"

	payload := strings.NewReader("{\n  \"name\": \"NewCo Industries\",\n  \"legal_name\": \"NewCo Industries LLC\",\n  \"ein\": \"12-3456789\",\n  \"email\": \"hr@newco.com\",\n  \"address\": {\n    \"address_line_1\": \"789 Business Blvd\",\n    \"city\": \"Seattle\",\n    \"state\": \"WA\",\n    \"zipcode\": \"98101\",\n    \"address_line_2\": \"Floor 5\"\n  },\n  \"phone_number\": \"2065550100\",\n  \"reference_id\": \"partner-emp-001\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create Employer Request
require 'uri'
require 'net/http'

url = URI("https://api.vitablehealth.com/v1/employers")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"NewCo Industries\",\n  \"legal_name\": \"NewCo Industries LLC\",\n  \"ein\": \"12-3456789\",\n  \"email\": \"hr@newco.com\",\n  \"address\": {\n    \"address_line_1\": \"789 Business Blvd\",\n    \"city\": \"Seattle\",\n    \"state\": \"WA\",\n    \"zipcode\": \"98101\",\n    \"address_line_2\": \"Floor 5\"\n  },\n  \"phone_number\": \"2065550100\",\n  \"reference_id\": \"partner-emp-001\"\n}"

response = http.request(request)
puts response.read_body
```

```java Create Employer Request
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.vitablehealth.com/v1/employers")
  .header("Authorization", "Bearer <apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"NewCo Industries\",\n  \"legal_name\": \"NewCo Industries LLC\",\n  \"ein\": \"12-3456789\",\n  \"email\": \"hr@newco.com\",\n  \"address\": {\n    \"address_line_1\": \"789 Business Blvd\",\n    \"city\": \"Seattle\",\n    \"state\": \"WA\",\n    \"zipcode\": \"98101\",\n    \"address_line_2\": \"Floor 5\"\n  },\n  \"phone_number\": \"2065550100\",\n  \"reference_id\": \"partner-emp-001\"\n}")
  .asString();
```

```php Create Employer Request
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vitablehealth.com/v1/employers', [
  'body' => '{
  "name": "NewCo Industries",
  "legal_name": "NewCo Industries LLC",
  "ein": "12-3456789",
  "email": "hr@newco.com",
  "address": {
    "address_line_1": "789 Business Blvd",
    "city": "Seattle",
    "state": "WA",
    "zipcode": "98101",
    "address_line_2": "Floor 5"
  },
  "phone_number": "2065550100",
  "reference_id": "partner-emp-001"
}',
  'headers' => [
    'Authorization' => 'Bearer <apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Create Employer Request
using RestSharp;

var client = new RestClient("https://api.vitablehealth.com/v1/employers");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"NewCo Industries\",\n  \"legal_name\": \"NewCo Industries LLC\",\n  \"ein\": \"12-3456789\",\n  \"email\": \"hr@newco.com\",\n  \"address\": {\n    \"address_line_1\": \"789 Business Blvd\",\n    \"city\": \"Seattle\",\n    \"state\": \"WA\",\n    \"zipcode\": \"98101\",\n    \"address_line_2\": \"Floor 5\"\n  },\n  \"phone_number\": \"2065550100\",\n  \"reference_id\": \"partner-emp-001\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create Employer Request
import Foundation

let headers = [
  "Authorization": "Bearer <apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "NewCo Industries",
  "legal_name": "NewCo Industries LLC",
  "ein": "12-3456789",
  "email": "hr@newco.com",
  "address": [
    "address_line_1": "789 Business Blvd",
    "city": "Seattle",
    "state": "WA",
    "zipcode": "98101",
    "address_line_2": "Floor 5"
  ],
  "phone_number": "2065550100",
  "reference_id": "partner-emp-001"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vitablehealth.com/v1/employers")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```