Programmatic access to your org chart, SOPs, and team data.
Base URL
https://sopflow.io/api/v1
All endpoints use HTTPS. Requests over HTTP are rejected.
Versioning
The API is URL-versioned. The current version is v1. When breaking changes are required, a new version path (/api/v2) will be introduced with advance notice. v1 will continue to be supported for at least 12 months after a new version launches.
Authentication
Every request must include an API key in the Authorization header:
Create a read-scoped service key in an eligible workspace and keep it on your server. Read the organization first, confirm it is the intended workspace, then request one page of SOPs. Follow nextCursor when you need the complete collection.
The example below does not create or change content. Handle a rejected request before attempting another resource; do not treat an access error as an empty workspace.
// Server-side JavaScript. Store the real key in your secret manager.
const key = process.env.SOPFLOW_API_KEY;
const expectedWorkspaceId = process.env.SOPFLOW_WORKSPACE_ID;
if (!key || !expectedWorkspaceId) throw new Error("Configure SOPFLOW_API_KEY and SOPFLOW_WORKSPACE_ID");
async function read(path) {
const response = await fetch("https://sopflow.io/api/v1" + path, {
headers: { Authorization: "Bearer " + key },
});
if (!response.ok) throw new Error("Request failed: " + response.status);
return response.json();
}
const workspace = await read("/organization");
if (workspace.data.id !== expectedWorkspaceId) throw new Error("Unexpected workspace");
const page = await read("/sops");
const first = page.data[0];
if (first) {
const procedure = await read("/sops/" + encodeURIComponent(first.id));
console.log({ hasActiveVersion: !!procedure.data.activeVersion });
}
// Use page.nextCursor with the documented cursor parameter for more pages.