Loading...
Loading...
Build integrations with the Factorial HR API using the official TypeScript (@factorialco/api-client) and Python (factorial-api-client) SDKs. Use when authenticating, calling endpoints, paginating list results, subscribing to webhooks, or typing webhook handler payloads against the Factorial API.
npx skill4agent add factorialco/factorial-api-sdks factorial-api-sdksreference/@factorialco/api-clientfactorial-api-clientfactorial_apinpm install @factorialco/api-client # TypeScript
pip install factorial-api-client # Python
gem install factorial_api # Ruby| Option | Header sent |
|---|---|
| |
| |
The Factorial API key is JWT-formatted but is sent as, not as a bearer token.x-api-key
FACTORIAL_API_KEYFACTORIAL_TOKENFACTORIAL_BASE_URLimport { FactorialClient } from "@factorialco/api-client";
const client = new FactorialClient({ apiKey: process.env.FACTORIAL_API_KEY });from factorial_api_client import FactorialClient
client = FactorialClient(api_key="YOUR_KEY") # or token="...", or from envrequire "factorial_api"
api = F::Api.new(api_key: ENV["FACTORIAL_API_KEY"]) # or token:, or from envclient.<namespace>.<resource>.<method>/api/<version>/resources/<namespace>/<resource>| HTTP / shape | SDK method |
|---|---|
| |
| |
| |
| |
| |
Custom action (e.g. | camelCased action, e.g. |
const { data } = await client.employees.employees.list();
const created = await client.apiPublic.webhookSubscriptions.create({ /* body */ });employees = client.employees.employee.list()
sub = client.api_public.webhook_subscription.create(body={...})api.employees_employeequery_params:employees = api.employees_employee.employees_employees_get(true, false).datareference/sdk-methods.md{ data: T[], meta: { end_cursor?, has_next_page, ... } }list()paginate()all()collect_all()F::Api.paginate { |page| ... }for await (const emp of client.employees.employees.paginate()) { /* ... */ }
const everyone = await client.employees.employees.all({ maxItems: 500 });for emp in client.employees.employee.paginate(max_items=50): ...
everyone = client.employees.employee.all()limitend_cursorall()attendance/worked_timesidsemployee_idsupdated_atmax_itemsmaxItems2026-04-01target_urlsubscription_typeats/application/createtarget_urlcompany_idPOSTtarget_url{ type, data }challengex-factorial-wh-challengex-factorial-author-idx-factorial-author-typeemployeecompanyPUT { enabled: true }await client.apiPublic.webhookSubscriptions.create({
subscription_type: "ats/application/create",
target_url: "https://example.com/webhooks/factorial",
challenge: "a-secret-you-choose",
company_id: 55,
});client.api_public.webhook_subscription.create(body={
"subscription_type": "ats/application/create",
"target_url": "https://example.com/webhooks/factorial",
"challenge": "a-secret-you-choose",
"company_id": 55,
})import type { AtsApplicationCreateWebhook, WebhookPayloadMap, WebhookSubscriptionType }
from "@factorialco/api-client";
// Direct alias
function onApplicationCreated(payload: AtsApplicationCreateWebhook) { /* ... */ }
// Typed dispatch keyed on the runtime subscription_type
function handle<T extends WebhookSubscriptionType>(type: T, payload: WebhookPayloadMap[T]) { /* ... */ }from factorial_api_client import AtsApplicationCreateWebhook, WEBHOOK_PAYLOAD_TYPES
def on_application_created(payload: AtsApplicationCreateWebhook) -> None: ...
# Runtime lookup of the model class for a subscription_type
model_cls = WEBHOOK_PAYLOAD_TYPES["ats/application/create"]subscription_typereference/webhooks.mdreference/webhooks.mdsubscription_typereference/sdk-methods.md