Create an employer
curl --request POST \
--url https://api.usehammock.co/employers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Robotics",
"external_id": "company_8f2k1",
"primary_contact": {
"first_name": "Dana",
"last_name": "Whitfield",
"email": "dana@acmerobotics.example"
}
}
'import requests
url = "https://api.usehammock.co/employers"
payload = {
"name": "Acme Robotics",
"external_id": "company_8f2k1",
"primary_contact": {
"first_name": "Dana",
"last_name": "Whitfield",
"email": "dana@acmerobotics.example"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Robotics',
external_id: 'company_8f2k1',
primary_contact: {first_name: 'Dana', last_name: 'Whitfield', email: 'dana@acmerobotics.example'}
})
};
fetch('https://api.usehammock.co/employers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usehammock.co/employers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Robotics',
'external_id' => 'company_8f2k1',
'primary_contact' => [
'first_name' => 'Dana',
'last_name' => 'Whitfield',
'email' => 'dana@acmerobotics.example'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usehammock.co/employers"
payload := strings.NewReader("{\n \"name\": \"Acme Robotics\",\n \"external_id\": \"company_8f2k1\",\n \"primary_contact\": {\n \"first_name\": \"Dana\",\n \"last_name\": \"Whitfield\",\n \"email\": \"dana@acmerobotics.example\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usehammock.co/employers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Robotics\",\n \"external_id\": \"company_8f2k1\",\n \"primary_contact\": {\n \"first_name\": \"Dana\",\n \"last_name\": \"Whitfield\",\n \"email\": \"dana@acmerobotics.example\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehammock.co/employers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Robotics\",\n \"external_id\": \"company_8f2k1\",\n \"primary_contact\": {\n \"first_name\": \"Dana\",\n \"last_name\": \"Whitfield\",\n \"email\": \"dana@acmerobotics.example\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "empr_1Qx8Zt2eZvKYlo2C",
"object": "employer",
"name": "Acme Robotics",
"status": "onboarding",
"requirements": {
"currently_due": [
"agreements",
"bank_account"
],
"pending_verification": [
"business_verification"
],
"disabled_reason": "requirements.currently_due"
},
"metadata": {
"plan": "growth"
},
"livemode": true,
"created": "2027-02-01T15:00:00Z",
"legal_name": "Acme Robotics, Inc.",
"external_id": "company_8f2k1",
"ein_last4": "6789",
"address": {
"line1": "500 Howard St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US",
"line2": "<string>"
},
"primary_contact": {
"first_name": "Dana",
"last_name": "Whitfield",
"email": "dana@acmerobotics.example"
}
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "Missing required parameter: employer.",
"param": "employer",
"doc_url": "https://docs.usehammock.co/api/errors#parameter_missing",
"request_id": "req_9Kd2Lm5nPq8R"
}
}Employers
Create an employer
Creates an employer in onboarding status. Create an employer link next and send the
employer’s admin to it to finish setup.
POST
/
employers
Create an employer
curl --request POST \
--url https://api.usehammock.co/employers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Robotics",
"external_id": "company_8f2k1",
"primary_contact": {
"first_name": "Dana",
"last_name": "Whitfield",
"email": "dana@acmerobotics.example"
}
}
'import requests
url = "https://api.usehammock.co/employers"
payload = {
"name": "Acme Robotics",
"external_id": "company_8f2k1",
"primary_contact": {
"first_name": "Dana",
"last_name": "Whitfield",
"email": "dana@acmerobotics.example"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Robotics',
external_id: 'company_8f2k1',
primary_contact: {first_name: 'Dana', last_name: 'Whitfield', email: 'dana@acmerobotics.example'}
})
};
fetch('https://api.usehammock.co/employers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.usehammock.co/employers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Acme Robotics',
'external_id' => 'company_8f2k1',
'primary_contact' => [
'first_name' => 'Dana',
'last_name' => 'Whitfield',
'email' => 'dana@acmerobotics.example'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.usehammock.co/employers"
payload := strings.NewReader("{\n \"name\": \"Acme Robotics\",\n \"external_id\": \"company_8f2k1\",\n \"primary_contact\": {\n \"first_name\": \"Dana\",\n \"last_name\": \"Whitfield\",\n \"email\": \"dana@acmerobotics.example\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.usehammock.co/employers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Robotics\",\n \"external_id\": \"company_8f2k1\",\n \"primary_contact\": {\n \"first_name\": \"Dana\",\n \"last_name\": \"Whitfield\",\n \"email\": \"dana@acmerobotics.example\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.usehammock.co/employers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Robotics\",\n \"external_id\": \"company_8f2k1\",\n \"primary_contact\": {\n \"first_name\": \"Dana\",\n \"last_name\": \"Whitfield\",\n \"email\": \"dana@acmerobotics.example\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "empr_1Qx8Zt2eZvKYlo2C",
"object": "employer",
"name": "Acme Robotics",
"status": "onboarding",
"requirements": {
"currently_due": [
"agreements",
"bank_account"
],
"pending_verification": [
"business_verification"
],
"disabled_reason": "requirements.currently_due"
},
"metadata": {
"plan": "growth"
},
"livemode": true,
"created": "2027-02-01T15:00:00Z",
"legal_name": "Acme Robotics, Inc.",
"external_id": "company_8f2k1",
"ein_last4": "6789",
"address": {
"line1": "500 Howard St",
"city": "San Francisco",
"state": "CA",
"postal_code": "94105",
"country": "US",
"line2": "<string>"
},
"primary_contact": {
"first_name": "Dana",
"last_name": "Whitfield",
"email": "dana@acmerobotics.example"
}
}{
"error": {
"type": "invalid_request_error",
"code": "parameter_missing",
"message": "Missing required parameter: employer.",
"param": "employer",
"doc_url": "https://docs.usehammock.co/api/errors#parameter_missing",
"request_id": "req_9Kd2Lm5nPq8R"
}
}Authorizations
Headers
Body
application/json
Response
The created employer.
onboarding: hosted setup isn't finished. pending_review: setup is submitted and Hammock
is reviewing it. active: employees can enroll and payrolls can be reported. closed: the
employer no longer offers Hammock benefits.
Available options:
onboarding, pending_review, active, closed