List all custom fields for a company
curl --request GET \
--url https://api.salescaptain.com/v1/list-custom-fields/{company_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.salescaptain.com/v1/list-custom-fields/{company_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.salescaptain.com/v1/list-custom-fields/{company_id}', 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.salescaptain.com/v1/list-custom-fields/{company_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.salescaptain.com/v1/list-custom-fields/{company_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.salescaptain.com/v1/list-custom-fields/{company_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salescaptain.com/v1/list-custom-fields/{company_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Custom fields fetched successfully!",
"custom_fields": {
"data": [
{
"cf_id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
"cf_name": "industry",
"cf_label": "Industry",
"cf_datatype": "text",
"cf_description": "Customer's industry sector",
"created_at": "2024-01-10T09:00:00.000Z",
"updated_at": "2024-01-15T11:30:00.000Z"
},
{
"cf_id": "e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b",
"cf_name": "budget",
"cf_label": "Budget",
"cf_datatype": "number",
"cf_description": "Customer's budget range",
"created_at": "2024-01-12T14:00:00.000Z",
"updated_at": null
},
{
"cf_id": "f6a7b8c9-d0e1-2f3a-4b5c-6d7e8f9a0b1c",
"cf_name": "company_size",
"cf_label": "Company Size",
"cf_datatype": "dropdown",
"cf_description": "Number of employees",
"created_at": "2024-01-20T10:15:00.000Z",
"updated_at": "2024-02-01T08:45:00.000Z"
}
]
}
}{
"status": "failure",
"error": "Required parameters missing: company_id"
}{
"error": "Unauthorized access",
"code": "UNAUTHORIZED",
"timestamp": "2023-12-01T10:30:00Z",
"path": "/v1/fetch-companies"
}{
"error": "Forbidden access",
"code": "FORBIDDEN",
"timestamp": "2023-12-01T10:30:00Z",
"path": "/v1/fetch-companies"
}{
"error": "Too many requests, please try again later",
"code": "RATE_LIMIT_EXCEEDED",
"timestamp": "2023-12-01T10:30:00Z",
"path": "/v1/fetch-companies"
}{
"error": "Problem encountered while fetching companies!",
"code": "INTERNAL_ERROR",
"timestamp": "2023-12-01T10:30:00Z",
"path": "/v1/fetch-companies"
}Custom Fileds
List custom fields by company ID
Retrieves all custom field definitions associated with a specific company. Custom fields allow companies to store additional contact information.
GET
/
v1
/
list-custom-fields
/
{company_id}
List all custom fields for a company
curl --request GET \
--url https://api.salescaptain.com/v1/list-custom-fields/{company_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.salescaptain.com/v1/list-custom-fields/{company_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.salescaptain.com/v1/list-custom-fields/{company_id}', 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.salescaptain.com/v1/list-custom-fields/{company_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.salescaptain.com/v1/list-custom-fields/{company_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.salescaptain.com/v1/list-custom-fields/{company_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salescaptain.com/v1/list-custom-fields/{company_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "Custom fields fetched successfully!",
"custom_fields": {
"data": [
{
"cf_id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f9a",
"cf_name": "industry",
"cf_label": "Industry",
"cf_datatype": "text",
"cf_description": "Customer's industry sector",
"created_at": "2024-01-10T09:00:00.000Z",
"updated_at": "2024-01-15T11:30:00.000Z"
},
{
"cf_id": "e5f6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b",
"cf_name": "budget",
"cf_label": "Budget",
"cf_datatype": "number",
"cf_description": "Customer's budget range",
"created_at": "2024-01-12T14:00:00.000Z",
"updated_at": null
},
{
"cf_id": "f6a7b8c9-d0e1-2f3a-4b5c-6d7e8f9a0b1c",
"cf_name": "company_size",
"cf_label": "Company Size",
"cf_datatype": "dropdown",
"cf_description": "Number of employees",
"created_at": "2024-01-20T10:15:00.000Z",
"updated_at": "2024-02-01T08:45:00.000Z"
}
]
}
}{
"status": "failure",
"error": "Required parameters missing: company_id"
}{
"error": "Unauthorized access",
"code": "UNAUTHORIZED",
"timestamp": "2023-12-01T10:30:00Z",
"path": "/v1/fetch-companies"
}{
"error": "Forbidden access",
"code": "FORBIDDEN",
"timestamp": "2023-12-01T10:30:00Z",
"path": "/v1/fetch-companies"
}{
"error": "Too many requests, please try again later",
"code": "RATE_LIMIT_EXCEEDED",
"timestamp": "2023-12-01T10:30:00Z",
"path": "/v1/fetch-companies"
}{
"error": "Problem encountered while fetching companies!",
"code": "INTERNAL_ERROR",
"timestamp": "2023-12-01T10:30:00Z",
"path": "/v1/fetch-companies"
}Authorizations
Authentication token required for accessing protected endpoints. The token should be obtained from the main SalesCaptain authentication service.
Path Parameters
Unique identifier for the company
Example:
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
⌘I

