PermuteDocs
Go to Permute

Facts · factsCreate

Create a fact

Requires an organization-scoped request and fact write permission. The key is derived from the name; type is derived from the populated fields. Baselines require a scalar or ordered range, unit, dates, and scope.

POST/v1/facts
betaapiKeyorganization

When to use

Define a shared business rule.

For agents

Use an organization-scoped key with fact write permission. Names produce unique keys; type is derived from the fields.

Example

typescript
import { PermuteClient } from '@permute/sdk';

const orgClient = new PermuteClient({
  apiKey: process.env.PERMUTE_API_KEY!,
});

const result = await orgClient.facts.create({
  "name": "Net revenue",
  "definition": "Revenue after returns",
  "formula": "revenue - returns",
  "formulaType": "math"
});

Request body

json
{
  "name": "Net revenue",
  "definition": "Revenue after returns",
  "formula": "revenue - returns",
  "formulaType": "math"
}

Response

json
{
  "data": {
    "id": "fact_revenue123",
    "organizationId": "org_acme123",
    "ownerId": "user_admin123",
    "key": "net_revenue",
    "name": "Net revenue",
    "type": "formula",
    "definition": "Revenue after returns",
    "formula": "revenue - returns",
    "formulaType": "math",
    "aliases": null,
    "usualValue": null,
    "usualValueMin": null,
    "usualValueMax": null,
    "unit": null,
    "startDate": null,
    "endDate": null,
    "scope": null,
    "metadata": null,
    "createdAt": "2026-09-10T12:00:00.000Z",
    "updatedAt": "2026-09-10T12:00:00.000Z"
  }
}