Skip to content

SOPs

Standard operating procedures — each with a version history, phases (columns), and steps (cards).

GET/api/v1/sops

Paginated list of SOPs with their active version summary.

Query parameters

NameTypeRequiredDescription
limitintegeroptionalNumber of results (default 100, max 500).
cursorISO 8601optionalPagination cursor from nextCursor.
nodeIduuidoptionalFilter to SOPs owned by this org node.

Example response

Json
{
  "data": [
    {
      "id": "a3bb189e-8bf9-3888-9912-ace4e6543002",
      "sopNumber": "SOP-001",
      "orgNodeId": "550e8400-e29b-41d4-a716-446655440000",
      "category": "Onboarding",
      "reviewPeriodMonths": 12,
      "createdAt": "2025-03-05T09:00:00.000Z",
      "activeVersionId": "c56a4180-65aa-42ec-a945-5fd21dec0538",
      "activeVersionTitle": "New Employee Onboarding v2",
      "activeVersionStatus": "active",
      "activeVersionMajor": 2,
      "activeVersionMinor": 0,
      "activeVersionEffectiveDate": "2025-04-01"
    }
  ],
  "nextCursor": null
}
GET/api/v1/sops/:id

Full SOP with active version, phases, and steps.

Path parameters

NameTypeRequiredDescription
iduuidrequiredSOP ID.

Example response

Json
{
  "data": {
    "id": "a3bb189e-8bf9-3888-9912-ace4e6543002",
    "sopNumber": "SOP-001",
    "orgNodeId": "550e8400-e29b-41d4-a716-446655440000",
    "category": "Onboarding",
    "reviewPeriodMonths": 12,
    "createdAt": "2025-03-05T09:00:00.000Z",
    "activeVersion": {
      "id": "c56a4180-65aa-42ec-a945-5fd21dec0538",
      "versionMajor": 2,
      "versionMinor": 0,
      "status": "active",
      "title": "New Employee Onboarding v2",
      "purpose": "Ensure every new hire has a consistent first-week experience.",
      "scope": "Applies to all full-time employees.",
      "effectiveDate": "2025-04-01",
      "approvedAt": "2025-03-28T14:00:00.000Z",
      "createdAt": "2025-03-20T10:00:00.000Z",
      "phases": [
        {
          "id": "phase-1-id",
          "title": "Day 1",
          "sortOrder": 0,
          "color": "#6366f1",
          "createdAt": "2025-03-20T10:00:00.000Z",
          "steps": [
            {
              "id": "step-1-id",
              "title": "Set up laptop and accounts",
              "description": "IT hands off laptop with standard image. Employee activates SSO.",
              "stepType": "action",
              "assignedRole": "IT",
              "sortOrder": 0,
              "estimatedDuration": "2 hours",
              "createdAt": "2025-03-20T10:00:00.000Z"
            }
          ]
        }
      ]
    }
  }
}

SOP object

Top-level fields

NameTypeRequiredDescription
iduuidoptionalUnique SOP ID.
sopNumberstringoptionalHuman-readable identifier, e.g. "SOP-001".
orgNodeIduuid | nulloptionalThe org chart node that owns this SOP.
categorystring | nulloptionalOptional category label.
reviewPeriodMonthsintegeroptionalHow often (months) this SOP should be reviewed.
createdAtISO 8601optionalWhen the SOP was created.
activeVersionSopVersion | nulloptionalThe currently active version (detail endpoint only).

SopVersion fields

NameTypeRequiredDescription
iduuidoptionalVersion ID.
versionMajorintegeroptionalMajor version number.
versionMinorintegeroptionalMinor version number.
statusstringoptionaldraft | review | approved | active | retired
titlestringoptionalTitle of this version.
purposestring | nulloptionalPurpose statement.
scopestring | nulloptionalScope statement.
effectiveDatedate | nulloptionalWhen this version became effective.
approvedAtISO 8601 | nulloptionalWhen this version was approved.
phasesPhase[]optionalOrdered list of phases (only on detail endpoint).

Phase fields

NameTypeRequiredDescription
iduuidoptionalPhase ID.
titlestringoptionalPhase title (column label).
sortOrderintegeroptionalPosition among phases.
colorstring | nulloptionalHex color for this phase column.
stepsStep[]optionalOrdered list of steps in this phase.

Step fields

NameTypeRequiredDescription
iduuidoptionalStep ID.
titlestringoptionalStep title.
descriptionstring | nulloptionalMarkdown description.
stepTypestringoptionalaction | decision | approval | subprocess | reference
assignedRolestring | nulloptionalRole responsible for this step.
sortOrderintegeroptionalPosition within the phase.
estimatedDurationstring | nulloptionalHuman-readable duration estimate.

Code samples

# All SOPs in the org
curl "https://sopflow.io/api/v1/sops" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

# SOPs for a specific org node
curl "https://sopflow.io/api/v1/sops?nodeId=NODE_ID" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

# Full SOP detail (with phases + steps)
curl "https://sopflow.io/api/v1/sops/SOP_ID" \
  -H "Authorization: Bearer sk_live_YOUR_KEY"

Mutating SOPs

Mutations require the write scope. Creating an SOP also creates an initial draft version; phases and steps live on a version, so add them after creation.

POST/api/v1/sops

Create an SOP shell plus an initial draft version owned by ownerNodeId.

Body fields

NameTypeRequiredDescription
sopNumberstringrequired1–50 chars; unique per workspace (e.g. SOP-001).
ownerNodeIduuid | nullrequiredOwning org-chart node. Pass null for a catalog-level SOP with no initial assignment.
titlestringrequiredTitle for the initial draft version.
purposestring | nulloptionalWhy this SOP exists.
scopestring | nulloptionalWhat it covers / doesn't cover.
categorystringoptionalUp to 100 chars.
reviewPeriodMonthsintegeroptional1–120, defaults to 12.

Example response

Json
{
  "data": {
    "id": "...",
    "sopNumber": "SOP-005",
    "createdAt": "..."
  }
}
DELETE/api/v1/sops/:id

Discard an eligible SOP and its content. Published or evidence-bearing SOPs have integrity restrictions; deletion creates a recoverable trash record. Returns 204 on success.

Example response

Json
HTTP/1.1 204 No Content
POST/api/v1/sops/:id/versions/:versionId/transition

Move an SOP version through the state machine: draft → in_review → approved → active → retired (with under_revision available off active). Invalid transitions return 422 invalid_transition.

Body fields

NameTypeRequiredDescription
toStatusstringrequireddraft | in_review | approved | active | retired | under_revision
commentstringoptionalOptional reviewer comment, recorded on approval_records.

Example response

Json
{
  "data": {
    "id": "...",
    "status": "active",
    "effectiveDate": "2026-05-03"
  }
}

Phases

POST/api/v1/sops/:id/phases

Add a phase (kanban column) to the SOP's current draft version.

Body fields

NameTypeRequiredDescription
sopVersionIduuidrequiredVersion this phase belongs to.
titlestringrequired—
colorstring | nulloptionalHex code for the column header.
sortOrderintegeroptionalPosition among siblings; defaults to last.

Example response

Json
{
  "data": { "id": "...", "title": "Plan", "sortOrder": 0, "color": "#dbeafe" }
}
PATCH/api/v1/phases/:id

Update a phase's title, color, or sort order.

Example response

Json
{ "data": { "id": "...", "title": "Renamed" } }
DELETE/api/v1/phases/:id

Delete a phase and all of its steps.

Example response

Json
HTTP/1.1 204 No Content

Steps

POST/api/v1/phases/:id/steps

Add a step (card) to a phase.

Body fields

NameTypeRequiredDescription
phaseIduuidrequiredPhase this step belongs to.
titlestringrequiredStep title.
descriptionstring | nulloptionalMarkdown allowed.
stepTypestringoptionalaction | decision | approval | subprocess | reference
assignedRolestring | nulloptionalRole responsible for this step.
estimatedDurationstring | nulloptionalHuman-readable estimate.
sortOrderintegeroptionalPosition within the phase.

Example response

Json
{
  "data": { "id": "...", "title": "Run pre-deploy checks", "stepType": "action" }
}
PATCH/api/v1/steps/:id

Update any step field. Only the keys you supply are written.

Example response

Json
{ "data": { "id": "...", "title": "Updated step" } }
DELETE/api/v1/steps/:id

Delete a step.

Example response

Json
HTTP/1.1 204 No Content

Read a procedure and its current version

List SOPs, select the required SOP ID and request its detail. Inspect activeVersion and handle a missing active version explicitly before showing instructions as current. Keep the SOP ID and version ID distinct.

For authoring, create the draft and add phases and steps through the documented endpoints, then follow the permitted transition workflow. Test with a dedicated sample procedure; do not use a production procedure as a disposable fixture.