Developer Platform · v1 · 2026-09-28
Objectives, intelligence entities, capabilities, executions, events, memory, simulations, evaluations, governance and integrations — 75 operations with scoped keys, cursor pagination, idempotency, request ids, rate limits, one error shape and signed webhooks. Every action still passes the same governance a person’s would.
Create a key at /console/developers (you choose its scopes and see it once), then call the API from your server.
curl https://<your-nexefiy>/api/platform/v1/objectives \
-H "Authorization: Bearer $NEXEFIY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"title":"More qualified leads","genome":{"intent":"Reach 60 qualified leads a month within 90 days"}}'import { createNexefiy } from '@nexefiy/sdk';
const nexefiy = createNexefiy({ apiKey: process.env.NEXEFIY_API_KEY!, baseUrl: 'https://<your-nexefiy>/api/platform/v1' });
const objective = await nexefiy.objectives.create({ title: 'More qualified leads', genome: { intent: 'Reach 60 a month' } });
for await (const event of nexefiy.paginate(nexefiy.events.list, { types: 'objective.*' })) console.log(event.type);A key acts for the person who created it, in one organization. Each request needs the operation’s scope AND the creator’s current role — demote the person and the key loses the power; remove them and it stops working.
| Scope | Allows | Least role |
|---|---|---|
objectives:read | Read objectives, their genomes and graphs | any member |
objectives:write | Declare objectives and move them through their lifecycle | operator |
entities:read | Read intelligence entities and their genome history | any member |
entities:write | Create entities and evolve their genomes | operator |
capabilities:read | Read capabilities, versions and authority grants | any member |
capabilities:write | Create and evolve capabilities; check authority | operator |
executions:read | Read execution runs, tasks, approvals and traces | any member |
executions:write | Start runs, add tasks, request approvals, pause, resume and cancel | operator |
events:read | Read the ordered domain event stream | any member |
memory:read | Read and search organizational memory | any member |
memory:write | Record memories | operator |
simulations:read | Read simulation scenarios and outcomes | any member |
simulations:write | Create and run simulations; record actual results | operator |
evaluations:read | Read evaluations and scorecards | any member |
evaluations:write | Record evaluations | operator |
governance:read | Read the Constitution, policies, decisions and escalations | any member |
governance:write | Ask governance for a decision, raise escalations, engage kill switches | operator |
integrations:read | Read Reality Bridge connections and actions | any member |
integrations:write | Request governed external actions | operator |
webhooks:read | Read webhook endpoints and deliveries | any member |
webhooks:write | Create, change, test and delete webhook endpoints | admin |
nxk_… (52 characters). Only a SHA-256 is stored; the key is shown once. Lists show the first 12 characters.The API can ask and it can stop — it cannot decide. These stay with people, and the database refuses them for any request made with a key:
A key may request an approval, ask governance for a decision, raise an escalation, request a governed external action (which comes back awaiting_approval or denied when governance says so) and engage a kill switch. Releasing it is a person’s call.
| Topic | How it works |
|---|---|
| Versioning | The major version is in the path (/api/platform/v1). Within it, changes are additive only; responses carry Nexefiy-Api-Version and Nexefiy-Api-Revision. A retiring version announces itself with Deprecation and Sunset headers. |
| Resources | Every response is a domain object with an `object` tag (objective, entity, execution, event …) — never a table row. Internal fields (tenant ids, worker leases, embeddings, credential references) are never returned. |
| Pagination | Lists return { object: "list", data, hasMore, nextCursor }. Pass nextCursor back as cursor. limit is 1–100 (default 25). Lists are newest first; the event stream is oldest first so you can resume from a stored cursor. |
| Request ids | Every response — success or error — has X-Request-Id, and every error body repeats it as error.requestId. Quote it when asking for help. |
| Idempotency | Send Idempotency-Key on a POST: a retry with the same key and body within 24 hours returns the first response (Idempotent-Replayed: true); the same key with a different body is refused. The SDK does this for you. |
| Rate limits | Per key: 600 reads, 120 writes and 30 expensive operations (runs, actions, searches, simulations) a minute. Responses carry RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset; a 429 carries Retry-After. |
| Kill switches | An operator or the organization can switch a feature off; affected requests answer 503 unavailable with Retry-After. Webhook deliveries wait, they are not lost. |
One shape everywhere: { error: { type, code, message, param?, details?, requestId, docUrl } }. Branch on code; show message to people.
| Code | Status | Type | Meaning |
|---|---|---|---|
unauthenticated | 401 | authentication_error | No credential was presented. Send `Authorization: Bearer nxk_…`. |
invalid_api_key | 401 | authentication_error | The API key is unknown, revoked or expired, or its creator has left the organization. |
forbidden | 403 | permission_error | The caller may not do this. |
insufficient_scope | 403 | permission_error | The API key does not hold the scope this operation needs. |
insufficient_role | 403 | permission_error | The key creator's role no longer allows this operation. |
session_required | 403 | permission_error | Only a signed-in person can do this — never an API key (e.g. managing API keys). |
human_decision_required | 403 | permission_error | A human decision (approvals, the Constitution, kill-switch release …) cannot be made with an API key. |
not_found | 404 | invalid_request_error | No such resource in this organization. |
route_not_found | 404 | invalid_request_error | No such endpoint in this API version. |
method_not_allowed | 405 | invalid_request_error | The endpoint exists but not with this method; see the `Allow` header. |
invalid_json | 400 | invalid_request_error | The request body is not valid JSON. |
validation_failed | 422 | invalid_request_error | A parameter is missing or invalid; `param` and `details.issues` say which. |
conflict | 409 | invalid_request_error | The resource is not in a state that allows this (e.g. an illegal lifecycle transition). |
body_too_large | 413 | invalid_request_error | The request body is larger than this endpoint accepts. |
idempotency_key_reused | 422 | idempotency_error | This Idempotency-Key was already used with a different request. |
idempotency_in_progress | 409 | idempotency_error | A request with this Idempotency-Key is still being processed; retry shortly. |
rate_limited | 429 | rate_limit_error | Too many requests; wait `Retry-After` seconds. |
budget_exceeded | 429 | rate_limit_error | An execution budget refused the work. |
payment_required | 402 | payment_required_error | The organization's plan does not cover this, or a usage limit was reached. |
unavailable | 503 | api_error | Temporarily unavailable (a kill switch, or a dependency is down); retry later. |
not_configured | 503 | api_error | This deployment is missing configuration the endpoint needs. |
upstream_error | 502 | api_error | An external provider failed. |
internal_error | 500 | api_error | Something went wrong on our side; the request id identifies it. |
Subscribe an https endpoint to any of 188 event types (or a family like objective.*). Each delivery is a signed POST of the event.
Nexefiy-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, "t.rawBody")>. Reject timestamps older than 5 minutes; compare in constant time.import { constructEvent } from '@nexefiy/sdk';
export async function POST(req: Request) {
const raw = await req.text(); // the exact bytes — before JSON.parse
const event = await constructEvent(raw, req.headers.get('nexefiy-signature'), process.env.NEXEFIY_WEBHOOK_SECRET!);
if (await alreadyHandled(event.id)) return new Response(null, { status: 200 });
await handle(event); // e.g. event.type === 'run.completed'
return new Response(null, { status: 200 });
}@nexefiy/sdk is generated from the OpenAPI document (CI fails if it falls behind) around a small hand-written core.
nexefiy.executions.pause(id), nexefiy.governance.decisions.create(…).paginate / collect walk any list; constructEvent verifies webhooks with Web Crypto.All 75 operations. Paths are relative to /api/platform/v1. The OpenAPI document has every schema.
Describe the API — Version, where the OpenAPI document lives, and the scope catalog. No credential needed.
api.retrievepublic/meWho am I — The organization, person, role and scopes this credential acts with.
principal.retrieve/openapi.jsonThe OpenAPI 3.1 document — Generated from the same operation registry the server enforces. Feed it to any OpenAPI tool.
api.openapipublic/api-keysList API keys — Your own keys; an admin sees every key in the organization. Never the key itself.
apiKeys.listperson onlypaginated/api-keysCreate an API key — Give `scopes` or a `preset` (`read_only`, `full_access`). You cannot grant a scope your role cannot use. The key acts as you, in this organization, and stops working if you leave it. It is returned once.
apiKeys.createperson only/api-keys/{keyId}Retrieve an API key
apiKeys.retrieveperson only/api-keys/{keyId}Revoke an API key — Immediately and permanently. The key keeps its record (for the audit trail) with `status: revoked`.
apiKeys.revokeperson only/objectivesList objectives — Newest first. Filter by lifecycle status.
objectives.listobjectives:readpaginated/objectivesDeclare an objective — A new objective starts as a `draft` with its Objective Genome. Activate it with `objectives.update` once a person has reviewed it.
objectives.createobjectives:write/objectives/{objectiveId}Retrieve an objective
objectives.retrieveobjectives:read/objectives/{objectiveId}Move an objective through its lifecycle — draft → active → paused / achieved / abandoned. Illegal transitions return `conflict`.
objectives.updateobjectives:write/objectives/{objectiveId}/graphRetrieve an objective's graph — The decomposition of an objective into nodes (sub-goals, tasks, milestones) and the dependencies between them.
objectives.graphobjectives:read/entitiesList intelligence entities — Agents, humans, systems and services that pursue objectives.
entities.listentities:readpaginated/entitiesCreate an entity with its first genome
entities.createentities:write/entities/{entityId}Retrieve an entity and its live genome
entities.retrieveentities:read/entities/{entityId}/versionsList an entity's genome versions — The immutable lineage, oldest first. History is never rewritten.
entities.versions.listentities:read/entities/{entityId}/versionsEvolve an entity's genome — Give a full `genome`, or a `patch` merged over the live genome. Creates the next immutable version and makes it live.
entities.versions.createentities:write/capabilitiesList capabilities
capabilities.listcapabilities:readpaginated/capabilitiesRegister a capability and its first contract
capabilities.createcapabilities:write/capabilities/{capabilityId}Retrieve a capability with its live contract
capabilities.retrievecapabilities:read/capabilities/{capabilityId}/versionsEvolve a capability's contract
capabilities.versions.createcapabilities:write/executionsList executions — Newest first. Filter by status or by the objective served.
executions.listexecutions:readpaginated/executionsStart an execution — A durable run. At most once per `idempotencyKey` (the Idempotency-Key header is used when the body has none). Tasks are then admitted one by one through tenant, state, approval, authority and budget checks.
executions.createexecutions:write/executions/{executionId}Retrieve an execution
executions.retrieveexecutions:read/executions/{executionId}/tasksList an execution's tasks
executions.tasks.listexecutions:read/executions/{executionId}/tasksAdd a task to an execution — Set `requiresApproval` to park the task until a person approves it in Nexefiy.
executions.tasks.createexecutions:write/executions/{executionId}/pausePause an execution — No new task is admitted until it is resumed.
executions.pauseexecutions:write/executions/{executionId}/resumeResume a paused execution — Admission continues where it stopped.
executions.resumeexecutions:write/executions/{executionId}/cancelCancel an execution — Settles the run and cancels its unfinished tasks.
executions.cancelexecutions:write/executions/{executionId}/approvalsList an execution's approval gates
executions.approvals.listexecutions:read/executions/{executionId}/approvalsRequest a human approval — Opens an approval gate (optionally on one task). Only a person decides it, in Nexefiy — never an API key.
executions.approvals.createexecutions:write/executions/{executionId}/traceRetrieve an execution's trace — Every span — tasks, authority and policy checks, budget, approvals, retries — in order.
executions.traceexecutions:read/eventsRead the event stream — Oldest first, from `cursor` (a previous `nextCursor`) or `fromSequence`. Store the last `nextCursor` to resume exactly where you stopped. Filter with `types` (comma-separated types or families such as `objective.*`).
events.listevents:readpaginated/events/typesList event types — Every event type Nexefiy emits — the vocabulary for event filters and webhook subscriptions.
events.types/events/{eventId}Retrieve an event
events.retrieveevents:read/memoriesList memories — Active memories, newest first. `type=negative` lists negative knowledge — what was tried and failed.
memories.listmemory:readpaginated/memoriesRecord a memory
memories.creatememory:write/memories/{memoryId}Retrieve a memory
memories.retrievememory:read/memories/searchSearch memory — Ranked by relevance (pgvector, when `queryEmbedding` is given), recency, confidence, scope and importance — within a privacy ceiling.
memories.searchmemory:read/simulationsList simulation scenarios
simulations.listsimulations:readpaginated/simulationsCreate a scenario — A "what if": a world snapshot, assumptions, variables and the actions under test. Mark one `baseline` (do nothing) to compare against.
simulations.createsimulations:write/simulations/{simulationId}Retrieve a scenario with its runs and outcomes
simulations.retrievesimulations:read/simulations/{simulationId}/runsRecord a simulation run — Stores the model, inputs, uncertainty and every predicted outcome. Predictions are always marked as simulated, never as fact.
simulations.runsimulations:write/simulations/{simulationId}/actualsRecord what actually happened — Sets the actual value beside a predicted outcome, so the accuracy of every simulation is measured.
simulations.actuals.createsimulations:write/evaluationsList evaluations
evaluations.listevaluations:readpaginated/evaluationsRecord an evaluation — Expected against actual, with measured metrics. The verdict feeds trust, memory and evolution.
evaluations.createevaluations:write/evaluations/{evaluationId}Retrieve an evaluation with its metrics
evaluations.retrieveevaluations:read/evaluations/scorecardPerformance by subject — Evaluations rolled up per subject (entity, model, capability, strategy …).
evaluations.scorecardevaluations:read/governance/constitutionRetrieve the Constitution in force — The ratified charter every action is judged against. It changes only by a person ratifying an amendment.
governance.constitutiongovernance:read/governance/policiesList policies
governance.policies.listgovernance:readpaginated/governance/policies/{policyId}Retrieve a policy
governance.policies.retrievegovernance:read/governance/decisionsAsk governance for a decision — Judges a proposed action against the Constitution, every active policy, approval rules and kill switches, and records the decision: `allow`, `require_approval`, `escalate` or `deny`. Nothing is executed. An API key cannot claim a human approval.
governance.decisions.creategovernance:write/governance/decisionsList governance decisions
governance.decisions.listgovernance:readpaginated/governance/decisions/{decisionId}Retrieve a governance decision
governance.decisions.retrievegovernance:read/governance/escalationsList escalations
governance.escalations.listgovernance:readpaginated/governance/escalationsRaise an escalation to a person
governance.escalations.creategovernance:write/governance/kill-switchesList kill switches
governance.killSwitches.listgovernance:read/governance/kill-switchesEngage a kill switch — Stops execution in scope immediately (global, an environment, an entity or a capability). Releasing it is a human decision.
governance.killSwitches.engagegovernance:write/integrations/connectionsList Reality Bridge connections
integrations.connections.listintegrations:readpaginated/integrations/connections/{connectionId}Retrieve a connection — Credentials are never returned; `credentialConfigured` says whether one is in place.
integrations.connections.retrieveintegrations:read/integrations/catalogList the operations the Reality Bridge supports
integrations.catalogintegrations:read/integrations/actionsList external actions
integrations.actions.listintegrations:readpaginated/integrations/actionsRequest a governed external action — Runs the full Reality Bridge pipeline: the connection allow-list, authority grant, Constitution and policies, budget, egress guard, then execution and verification. High-risk actions come back `awaiting_approval` until a person approves them in Nexefiy; forbidden ones come back `denied` with the stage that refused them.
integrations.actions.createintegrations:write/integrations/actions/{actionId}Retrieve an external action
integrations.actions.retrieveintegrations:read/webhook-endpointsList webhook endpoints
webhookEndpoints.listwebhooks:readpaginated/webhook-endpointsCreate a webhook endpoint — Subscribe an https URL to event types (`*`, `objective.created`, or a family such as `run.*`). The response carries the signing secret — the only time it is shown.
webhookEndpoints.createwebhooks:write/webhook-endpoints/{endpointId}Retrieve a webhook endpoint
webhookEndpoints.retrievewebhooks:read/webhook-endpoints/{endpointId}Change a webhook endpoint — Change its URL, description or event types, or disable and re-enable it. Deliveries for a disabled endpoint wait until it is enabled again.
webhookEndpoints.updatewebhooks:write/webhook-endpoints/{endpointId}Delete a webhook endpoint — Stops all deliveries to it, including pending retries.
webhookEndpoints.deletewebhooks:write/webhook-endpoints/{endpointId}/rotate-secretRotate an endpoint's signing secret — Issues a new secret. For 24 hours deliveries are signed with both, so receivers can switch without dropping any.
webhookEndpoints.rotateSecretwebhooks:write/webhook-endpoints/{endpointId}/testSend a test delivery — POSTs a signed `webhook.ping` to the endpoint now and reports how it answered.
webhookEndpoints.testwebhooks:write/webhook-deliveriesList webhook deliveries — Every attempt to deliver an event, with its status, attempts and the last response.
webhookDeliveries.listwebhooks:readpaginated/webhook-deliveries/{deliveryId}Retrieve a webhook delivery
webhookDeliveries.retrievewebhooks:read/webhook-deliveries/{deliveryId}/redeliverDeliver again — Queues a failed, dead or already delivered event for one more attempt, now.
webhookDeliveries.redeliverwebhooks:write