← Back to your workspace

Connect your systems

A developer's guide to a product's External API (version 1) and its webhooks: how your website's backend, your CRM or your ERP reads and changes the product's entries, and keeps its own copy up to date.

1. Your data, in one sentence

The business owns its data. The product stores and processes the working copy of it, decides its current state, and gives the business API, webhook and export access to all of it. Your systems keep their own copy from the product's events and change the product through the API — never the other way round.

2. Credentials

3. Requests

The address is shown, ready to copy, beside the credentials on the product's page: https://<your FoloForge address>/api/v1/installations/<installation>. Every request carries the credential:

Authorization: Bearer ffk_<64 hexadecimal characters>

A success is { "data": … }; a list adds "next_cursor" and "has_more". A failure is { "error": { "code", "message", "request_id", … } } (§11). Bodies are application/json, at most 128 KB and 16 levels deep, arriving within 15 seconds. The one exception is a PDF put into an entry's file field: its body is the PDF itself (§9).

4. Operations

Paths are relative to /api/v1.

MethodPathWhat it does
GET/meThe credential making the request and the installation it reaches.
GET/installations/{installation}The installation, the released version the credential works against, and what the credential may do.
GET/installations/{installation}/collectionsThe kinds of entry this credential may use, each with its fields, references and actions.
GET/installations/{installation}/collections/{collection}One kind of entry's schema.
GET/installations/{installation}/records/{collection}A page of entries, filtered and sorted by the product's own bounded grammar.
POST/installations/{installation}/records/{collection}Create an entry. Send an Idempotency-Key.
GET/installations/{installation}/records/{collection}/{id}One entry, with its revision (ETag).
PATCH/installations/{installation}/records/{collection}/{id}Change some fields, guarded by the revision you read (If-Match).
POST/installations/{installation}/records/{collection}/{id}/actions/{action}Perform one of the product's declared actions, guarded by If-Match.
GET/installations/{installation}/records/{collection}/{id}/documentsThe documents an entry was made from.
GET/installations/{installation}/records/{collection}/{id}/documents/{digest}Download one of them — the exact file, checked against its digest.
GET/installations/{installation}/records/{collection}/{id}/files/{field}Download the file an entry holds in one of its file fields: the exact bytes, checked against the digest the entry carries.
PUT/installations/{installation}/records/{collection}/{id}/files/{field}Put one PDF into a file field of an entry, replacing the file it held: the PDF's own bytes as the body, with an Idempotency-Key. The answer says whether it holds text (text). Only with Put a PDF (§9).
DELETE/installations/{installation}/records/{collection}/{id}/files/{field}Remove the file an entry holds in a file field that takes PDF, such as a CV sent by mistake, with an Idempotency-Key. Only with Put a PDF (§9).
GET/installations/{installation}/records/{collection}/{id}/assessmentAn entry's timed assessment, where the product declares one: where it stands, its result and its integrity summary. With ?detail=1 and Assessment detail, every question with the answer and each criterion's score.
GET/installations/{installation}/records/{collection}/{id}/linksThe private links this credential shared for an entry.
POST/installations/{installation}/records/{collection}/{id}/linksShare an entry through a private link. The token is returned once.
PATCH/installations/{installation}/links/{link}Move the deadline of a live link this credential shared: expiresAt or expiresInDays.
DELETE/installations/{installation}/links/{link}Withdraw a link this credential shared.

5. Reading and paging

curl -s "$FOLOFORGE/installations/$INST/records/positions?filter[status]=open&sort=title&limit=50" \
  -H "Authorization: Bearer $FOLOFORGE_TOKEN"

6. Writing safely

curl -s -X POST "$FOLOFORGE/installations/$INST/records/candidates" \
  -H "Authorization: Bearer $FOLOFORGE_TOKEN" -H "Content-Type: application/json" \
  -H "Idempotency-Key: careers:6f1c2a0e" \
  -d '{"data":{"position":"rec-…","fullName":"Dana Lee","email":"dana@example.com"}}'

7. Actions

The product's own actions, with exactly the rules its application enforces. A transition moves a state along a declared path ("input": {"to": "…"}); a set changes its declared fields; an AI action proposes the declared fields and uses the organization's AI allowance, like a person pressing it. A move the current state does not allow is 409 action_refused, and nothing changes.

An upload action takes a file, so it is not performed here: the answer is 422 request_refused. A credential holds an upload in order to give it to a private link it shares (§8).

9. Documents and files

When the product's AI reads an uploaded file to make an entry, the entry pins it. With Documents on that kind of entry, GET …/documents/{digest} returns the exact bytes, typed by the format the product verified. Uploading happens on the product's own page, through a private link — not through the API.

A product that runs a timed assessment through a private link (one shared with "run": true) writes its result into the entry the link was made for, as an ordinary change: your record.updated webhook sees it. GET …/records/{collection}/{id}/assessment, with Read on that kind of entry, says more: status (not_started, in_progress, finishing while scores are being made, reported), the result the platform computed (the score out of 100, the level, the product's recommendation and why, each competency's percentage), and the integrity summary: a band (low, medium, high, or review when a strong signal is present) and each signal's sentence. A signal is something worth a person's look, never a verdict. The candidate's answers and the criterion scores come only with ?detail=1, and only to a credential the owner granted Assessment detail (detail) on that kind of entry. Asked without it, the answer is the plain one, nothing refused, with "detail": "not_granted".

A planned assessment. Where the product plans an assessment in modules (one for each domain the candidate is assessed in, and a behavioral module every plan carries), the sitting also has plan, from the moment the plan is made and while the candidate works through it: each module's kind, category, status, why it is there, its estimate, when it started and completed, how many questions it asked, its supplemental rounds and what the platform decided after each reflection, and, for a completed module only, its latest snapshot (each skill's and domain's figures, provisional). A module that is not completed shows no figure. plan.complete says the required modules done of all required, the behavioral module's state and whether the plan is whole; plan.finished says how it ended. Its optional incomplete array copies the stored completion markers, such as ["behavioral"]; it is absent when no array of strings was stored. Its undone array lists module ids still unfinished, such as ["m3"], including a behavioral module that ended short. behavioral says what the workplace stories showed, in words (strong, some, mixed, not_observed) and counts of stories, never a score or a label of the person, and how the candidate said they prefer to work. A sitting that continues an earlier one says which (continuation.from). The candidate's own words (the quote a module was planned from, a reflection, the stories' quotes) come only with ?detail=1 and Assessment detail; what they said would help them is never given. Every other sitting answers exactly as before.

"plan": { "revision": 3, "active": null, "finished": null,
  "complete": { "required": [1, 1], "behavioral": "pending", "full": false },
  "modules": [ { "id": "m1", "kind": "professional", "label": "Backend Development", "category": "required",
    "status": "completed", "why": { "code": "applied" }, "asked": 11, "rounds": [ { "n": 1, "asked": 3 } ],
    "reflections": [ { "n": 1, "outcome": "supplemental" } ], "snapshot": { "why": "round", "skills": [ … ] } } ] },
"behavioral": { "dimensions": null, "aspects": null,
  "preferences": { "arrangement": "hybrid", "availability": "From December", "overlap": "Four hours",
    "remote": "some", "onsite": "extensive", "tools": "Slack, Jira" } }

A product can also keep a file on an entry itself, in a field whose type is file: a proof, a signed form, a photo. Reading the entry returns that field as what the file is, and never its bytes:

"artwork": { "filename": "cards.pdf", "format": "pdf", "bytes": 48213,
  "sha256": "<64 hexadecimal characters>", "uploadedAt": "…", "uploadedBy": "link:…" }

A PDF your own system received — such as the CV an applicant sent with their application on your website — goes into a file field of the entry, so that nobody uploads it twice. The owner grants it on purpose: Put a PDF (files) on that kind of entry, which needs Read on it too and is never part of any other scope.

curl -s -X PUT "$FOLOFORGE/installations/$INST/records/candidates/$ID/files/cv" \
  -H "Authorization: Bearer $FOLOFORGE_TOKEN" -H "Content-Type: application/pdf" \
  -H "Idempotency-Key: careers:cv:6f1c2a0e" \
  --data-binary @cv.pdf
{ "data": { "field": "cv", "size": 48213, "sha256": "<64 hexadecimal characters>", "replaced": false, "text": true } }

Removing it — a CV sent by mistake — is the same route with DELETE, the same scope and a required Idempotency-Key, and no body:

curl -s -X DELETE "$FOLOFORGE/installations/$INST/records/candidates/$ID/files/cv" \
  -H "Authorization: Bearer $FOLOFORGE_TOKEN" -H "Idempotency-Key: careers:cv-remove:6f1c2a0e"
{ "data": { "field": "cv", "removed": true, "size": 48213, "sha256": "<64 hexadecimal characters>" } }

A CV your website hands to an assessment: create the entry, put the CV, then share the link, in that order. The CV is read once, when the applicant's conversation is first read (after their introduction), if the entry holds it then. Give Put a PDF to a second credential that holds Read and Put a PDF only, and keep the first for entries and links. Before an applicant sends a CV you pass on, tell them it goes to the assessment, where its text, without their contact details, is read by an AI model, and that they can remove it at the start: that is your organization's duty.

10. Webhooks — keeping your copy in step

The owner adds your address under Connect your systems and copies its signing secret, shown once. Each change to an entry is sent, signed, at least once:

{ "id": "dl-4b1e…", "event": { "id": "ev-…", "type": "record.updated", "at": "…",
  "resource": { "collection": "opportunities", "id": "rec-…" },
  "changes": { "stage": { "from": "sent", "to": "approved" } } } }

A planned assessment (§9) has two events of its own, sent only to an address registered with them named in its list of events (ask the platform's operator: the form under Connect your systems adds an address for entry changes only). An address registered without naming them keeps receiving entry changes only. assessment.module_completed when a module of the candidate's plan completes, and assessment.plan_finished when the plan ends. They carry ids, the module's kind and category, and the plan's completeness: never a score, a quote, a reflection or a preference. Read the assessment through the API for the rest.

{ "id": "dl-9c2e…", "event": { "id": "ev-1f0e…", "type": "assessment.module_completed", "at": "…",
  "namespace": "inst-…", "record": { "collection": "candidates", "id": "rec-…" }, "sitting": "4387…",
  "module": { "id": "m1", "kind": "professional", "category": "required" } } }
{ "id": "dl-77a1…", "event": { "id": "ev-0b3d…", "type": "assessment.plan_finished", "at": "…",
  "namespace": "inst-…", "record": { "collection": "candidates", "id": "rec-…" }, "sitting": "4387…",
  "complete": { "required": [1, 1], "behavioral": "completed", "full": true } } }
import { createHmac, timingSafeEqual } from "node:crypto";
export function verify(secret, rawBody, header) {
  const m = String(header || "").match(/^t=(\d+),v1=([a-f0-9]{64})$/);
  if (!m || Math.abs(Date.now() / 1000 - Number(m[1])) > 300) return false;
  const want = Buffer.from(`t=${m[1]},v1=${createHmac("sha256", secret).update(`${m[1]}.${rawBody}`).digest("hex")}`);
  const got = Buffer.from(String(header));
  return want.length === got.length && timingSafeEqual(want, got);
}

11. Errors

HTTPcodeMeaning
400invalid_requestA key the operation does not take, a body that is not an object, or an If-Match that is not a revision.
400invalid_jsonThe body is not valid JSON.
400invalid_queryA list parameter outside the bounded grammar.
400invalid_cursorA cursor that was forged, or minted for a different query.
400invalid_idempotency_keyNot 1–255 visible ASCII characters.
400idempotency_key_requiredA PDF put, or a file removal, without an Idempotency-Key (§9).
400credential_in_urlA credential in the URL.
400pin_needs_runA PIN asked for on a link that does not start the product's session (§8).
401unauthorizedNo valid credential — missing, unknown, revoked, expired or rotated (never said which).
403scope_exceededA link stronger than the credential that would make it.
403scope_missingA PDF put or a file removal by a credential without Put a PDF on that kind of entry (§9).
404not_foundAbsent, another installation's, or outside your scopes — the same answer for all three.
405method_not_allowedSee Allow.
408request_timeoutThe body did not arrive within 15 seconds (a PDF: within 120 seconds, and never 30 seconds without a byte).
409action_refusedThe action is not possible from the entry's current state.
409not_availableThe product is switched off, so a link would not open.
409not_shareableThe product has no screen that could show this entry through a link.
409link_token_not_replayableA retried link (§8).
409link_not_activeA deadline asked of a link that was withdrawn: it never opens again. Share a new one (§8).
409link_expiredA deadline asked of a link whose deadline has passed. Share a new one to give the person more time (§8).
409idempotency_conflictThe key already put other bytes into this field; a new file takes a new key (§9).
410goneA document no longer kept, or an entry's file whose kept bytes are missing or are not what was uploaded.
412revision_conflictThe entry changed since your If-Match; see current_revision.
413payload_too_largeOver 128 KB, an entry over 64 KB, or a PDF over 5 MB or over what its field takes.
415unsupported_media_typeNot application/json (a PDF put: not application/pdf).
422validation_failedDoes not fit the schema; fields lists each problem.
422idempotency_key_reusedThe key was used for a different request.
422not_a_pdfA PDF put whose body is not a whole PDF that can be read; nothing was stored (§9).
422request_refusedRefused for the reason the message gives.
428precondition_requiredA change or an action without If-Match.
429rate_limitedWait for Retry-After seconds.
500internal_errorThe product's failure; quote request_id.
502ai_failedThe AI did not produce usable values for this entry; nothing changed.
503unavailableTry again shortly; nothing changed.
503ai_unavailableThe AI cannot be reached right now; nothing changed.

12. Limits

Per credential: 600 reads and 120 writes a minute, 30 link shares, 60 document downloads and 60 downloads of entries' files, and 20 PDFs put into or removed from entries (two arriving at once). Per product, every credential together: 3,000 requests a minute. Requests without a valid credential, per address: 30 every ten minutes. A 429 says when to try again.

13. What version 1 does not do

14. Security checklist