curl --request POST \
--url https://api.heffl.com/api/v2/companies \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"taxNumber": "<string>",
"website": "<string>",
"description": "<string>",
"linkedin": "<string>",
"currency": "<string>",
"openingBalance": 1,
"showJobAmountToWorker": true,
"isClientPortalEnabled": true,
"internalNotes": "<string>",
"stageId": "<string>",
"ownerUserId": "<string>",
"vendorId": "<string>",
"sourceId": "<string>",
"billingAddress": {
"city": "<string>",
"address": "<string>",
"landmark": "<string>",
"state": "<string>",
"country": "<string>",
"postalCode": "<string>"
},
"primaryContact": {}
}
'import requests
url = "https://api.heffl.com/api/v2/companies"
payload = {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"taxNumber": "<string>",
"website": "<string>",
"description": "<string>",
"linkedin": "<string>",
"currency": "<string>",
"openingBalance": 1,
"showJobAmountToWorker": True,
"isClientPortalEnabled": True,
"internalNotes": "<string>",
"stageId": "<string>",
"ownerUserId": "<string>",
"vendorId": "<string>",
"sourceId": "<string>",
"billingAddress": {
"city": "<string>",
"address": "<string>",
"landmark": "<string>",
"state": "<string>",
"country": "<string>",
"postalCode": "<string>"
},
"primaryContact": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: '[email protected]',
phone: '<string>',
taxNumber: '<string>',
website: '<string>',
description: '<string>',
linkedin: '<string>',
currency: '<string>',
openingBalance: 1,
showJobAmountToWorker: true,
isClientPortalEnabled: true,
internalNotes: '<string>',
stageId: '<string>',
ownerUserId: '<string>',
vendorId: '<string>',
sourceId: '<string>',
billingAddress: {
city: '<string>',
address: '<string>',
landmark: '<string>',
state: '<string>',
country: '<string>',
postalCode: '<string>'
},
primaryContact: {}
})
};
fetch('https://api.heffl.com/api/v2/companies', 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.heffl.com/api/v2/companies",
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' => '<string>',
'email' => '[email protected]',
'phone' => '<string>',
'taxNumber' => '<string>',
'website' => '<string>',
'description' => '<string>',
'linkedin' => '<string>',
'currency' => '<string>',
'openingBalance' => 1,
'showJobAmountToWorker' => true,
'isClientPortalEnabled' => true,
'internalNotes' => '<string>',
'stageId' => '<string>',
'ownerUserId' => '<string>',
'vendorId' => '<string>',
'sourceId' => '<string>',
'billingAddress' => [
'city' => '<string>',
'address' => '<string>',
'landmark' => '<string>',
'state' => '<string>',
'country' => '<string>',
'postalCode' => '<string>'
],
'primaryContact' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.heffl.com/api/v2/companies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"taxNumber\": \"<string>\",\n \"website\": \"<string>\",\n \"description\": \"<string>\",\n \"linkedin\": \"<string>\",\n \"currency\": \"<string>\",\n \"openingBalance\": 1,\n \"showJobAmountToWorker\": true,\n \"isClientPortalEnabled\": true,\n \"internalNotes\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"vendorId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"primaryContact\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.heffl.com/api/v2/companies")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"taxNumber\": \"<string>\",\n \"website\": \"<string>\",\n \"description\": \"<string>\",\n \"linkedin\": \"<string>\",\n \"currency\": \"<string>\",\n \"openingBalance\": 1,\n \"showJobAmountToWorker\": true,\n \"isClientPortalEnabled\": true,\n \"internalNotes\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"vendorId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"primaryContact\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v2/companies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"taxNumber\": \"<string>\",\n \"website\": \"<string>\",\n \"description\": \"<string>\",\n \"linkedin\": \"<string>\",\n \"currency\": \"<string>\",\n \"openingBalance\": 1,\n \"showJobAmountToWorker\": true,\n \"isClientPortalEnabled\": true,\n \"internalNotes\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"vendorId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"primaryContact\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"number": "<string>",
"openingBalance": 123,
"showJobAmountToWorker": true,
"isClientPortalEnabled": true,
"email": "<string>",
"phone": "<string>",
"taxNumber": "<string>",
"website": "<string>",
"description": "<string>",
"stageId": "<string>",
"stageName": "<string>",
"ownerUserId": "<string>",
"crmSourceId": "<string>",
"sourceName": "<string>",
"currency": "<string>",
"internalNotes": "<string>",
"linkedin": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Create company
Creates a new company record. The company is assigned to the user associated with your API key. Related entity IDs use prefixed string IDs (for example cs_, usr_). Custom field values use cf_* keys — see the Custom fields guide.
curl --request POST \
--url https://api.heffl.com/api/v2/companies \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"taxNumber": "<string>",
"website": "<string>",
"description": "<string>",
"linkedin": "<string>",
"currency": "<string>",
"openingBalance": 1,
"showJobAmountToWorker": true,
"isClientPortalEnabled": true,
"internalNotes": "<string>",
"stageId": "<string>",
"ownerUserId": "<string>",
"vendorId": "<string>",
"sourceId": "<string>",
"billingAddress": {
"city": "<string>",
"address": "<string>",
"landmark": "<string>",
"state": "<string>",
"country": "<string>",
"postalCode": "<string>"
},
"primaryContact": {}
}
'import requests
url = "https://api.heffl.com/api/v2/companies"
payload = {
"name": "<string>",
"email": "[email protected]",
"phone": "<string>",
"taxNumber": "<string>",
"website": "<string>",
"description": "<string>",
"linkedin": "<string>",
"currency": "<string>",
"openingBalance": 1,
"showJobAmountToWorker": True,
"isClientPortalEnabled": True,
"internalNotes": "<string>",
"stageId": "<string>",
"ownerUserId": "<string>",
"vendorId": "<string>",
"sourceId": "<string>",
"billingAddress": {
"city": "<string>",
"address": "<string>",
"landmark": "<string>",
"state": "<string>",
"country": "<string>",
"postalCode": "<string>"
},
"primaryContact": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: '[email protected]',
phone: '<string>',
taxNumber: '<string>',
website: '<string>',
description: '<string>',
linkedin: '<string>',
currency: '<string>',
openingBalance: 1,
showJobAmountToWorker: true,
isClientPortalEnabled: true,
internalNotes: '<string>',
stageId: '<string>',
ownerUserId: '<string>',
vendorId: '<string>',
sourceId: '<string>',
billingAddress: {
city: '<string>',
address: '<string>',
landmark: '<string>',
state: '<string>',
country: '<string>',
postalCode: '<string>'
},
primaryContact: {}
})
};
fetch('https://api.heffl.com/api/v2/companies', 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.heffl.com/api/v2/companies",
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' => '<string>',
'email' => '[email protected]',
'phone' => '<string>',
'taxNumber' => '<string>',
'website' => '<string>',
'description' => '<string>',
'linkedin' => '<string>',
'currency' => '<string>',
'openingBalance' => 1,
'showJobAmountToWorker' => true,
'isClientPortalEnabled' => true,
'internalNotes' => '<string>',
'stageId' => '<string>',
'ownerUserId' => '<string>',
'vendorId' => '<string>',
'sourceId' => '<string>',
'billingAddress' => [
'city' => '<string>',
'address' => '<string>',
'landmark' => '<string>',
'state' => '<string>',
'country' => '<string>',
'postalCode' => '<string>'
],
'primaryContact' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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.heffl.com/api/v2/companies"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"taxNumber\": \"<string>\",\n \"website\": \"<string>\",\n \"description\": \"<string>\",\n \"linkedin\": \"<string>\",\n \"currency\": \"<string>\",\n \"openingBalance\": 1,\n \"showJobAmountToWorker\": true,\n \"isClientPortalEnabled\": true,\n \"internalNotes\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"vendorId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"primaryContact\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.heffl.com/api/v2/companies")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"taxNumber\": \"<string>\",\n \"website\": \"<string>\",\n \"description\": \"<string>\",\n \"linkedin\": \"<string>\",\n \"currency\": \"<string>\",\n \"openingBalance\": 1,\n \"showJobAmountToWorker\": true,\n \"isClientPortalEnabled\": true,\n \"internalNotes\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"vendorId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"primaryContact\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.heffl.com/api/v2/companies")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"email\": \"[email protected]\",\n \"phone\": \"<string>\",\n \"taxNumber\": \"<string>\",\n \"website\": \"<string>\",\n \"description\": \"<string>\",\n \"linkedin\": \"<string>\",\n \"currency\": \"<string>\",\n \"openingBalance\": 1,\n \"showJobAmountToWorker\": true,\n \"isClientPortalEnabled\": true,\n \"internalNotes\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerUserId\": \"<string>\",\n \"vendorId\": \"<string>\",\n \"sourceId\": \"<string>\",\n \"billingAddress\": {\n \"city\": \"<string>\",\n \"address\": \"<string>\",\n \"landmark\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalCode\": \"<string>\"\n },\n \"primaryContact\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"number": "<string>",
"openingBalance": 123,
"showJobAmountToWorker": true,
"isClientPortalEnabled": true,
"email": "<string>",
"phone": "<string>",
"taxNumber": "<string>",
"website": "<string>",
"description": "<string>",
"stageId": "<string>",
"stageName": "<string>",
"ownerUserId": "<string>",
"crmSourceId": "<string>",
"sourceName": "<string>",
"currency": "<string>",
"internalNotes": "<string>",
"linkedin": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
API key for authentication. Get yours at app.heffl.com/settings/developers
Body
Company name
Email address
Phone number with country code
Tax number
Website URL
Description
LinkedIn URL
3-letter ISO currency code
Opening balance
x >= 0Whether job amounts are visible to field workers
Whether the client portal is enabled
Internal notes
Client stage ID
Owner user ID
Vendor ID
CRM source ID
Show child attributes
Show child attributes
Optional primary contact to create with the company
Custom field values using cf_* keys (for example cf_industry). Only documented fields and cf_* keys are accepted.
Response
OK
Company ID
Company name
Auto-generated company number
Opening balance
Whether job amounts are visible to field workers
Whether the client portal is enabled
Record type (always company for this endpoint)
contact, company Email address
Phone number
Tax number
Website URL
Description
Client stage ID
Client stage label
Owner user ID
CRM source ID
CRM source name
Currency code
Internal notes
LinkedIn URL
When the company was created
When the company was last updated
Custom field values as top-level cf_* keys (for example cf_industry). There is no customFields wrapper.