Help center

Get an SOP

Reference for GET /sops/{id}, which returns an SOP's fields plus its cards, steps and image URLs, archived or not.

Business plan Updated
On this page
  1. Path parameters
  2. Request
  3. Response
  4. Card fields
  5. Step fields
  6. Working with the HTML
  7. Errors
Shell
GET https://app.sopcompass.com/api/v1/sops/{id}

Scope: read only or read and write.

Returns one SOP: every field of the SOP object, plus cards, its content in order. Any SOP the workspace can open can be fetched, including archived SOPs (check archived_at) and SOPs in libraries shared into the workspace.

Path parameters

Name Type Required Description
id UUID Yes The SOP’s id, from GET /sops, GET /search or an assignment.

Request

Shell
curl https://app.sopcompass.com/api/v1/sops/6c8e0a2b-4d6f-4c8e-9a1b-3d5f7a9c1e08 \
  -H "Authorization: Bearer $SOPCOMPASS_API_KEY"
JavaScript
const id = "6c8e0a2b-4d6f-4c8e-9a1b-3d5f7a9c1e08";
const res = await fetch(`https://app.sopcompass.com/api/v1/sops/${id}`, {
  headers: { Authorization: `Bearer ${process.env.SOPCOMPASS_API_KEY}` },
});
const { data: sop } = await res.json();
Python
import os
import requests

sop_id = "6c8e0a2b-4d6f-4c8e-9a1b-3d5f7a9c1e08"
res = requests.get(
    f"https://app.sopcompass.com/api/v1/sops/{sop_id}",
    headers={"Authorization": f"Bearer {os.environ['SOPCOMPASS_API_KEY']}"},
    timeout=30,
)
sop = res.json()["data"]

Response

200 OK

JSON
{
  "data": {
    "id": "6c8e0a2b-4d6f-4c8e-9a1b-3d5f7a9c1e08",
    "title": "Deep clean a commercial kitchen",
    "description": "Weekly deep clean for client kitchens. Acme Cleaning Co. (example).",
    "library_id": "4a6c8e0b-2d4f-4a1c-8e3a-5c7e9b1d3f07",
    "library_title": "Client sites",
    "board_id": "1b3d5f7a-9c2e-4a6b-8d0f-2a4c6e8b0d14",
    "board_name": "Fulfillment and delivery",
    "tags": ["kitchen", "weekly"],
    "departments": ["operations"],
    "owner_email": "sam.ortiz@example.com",
    "published": true,
    "shared": false,
    "next_review_on": "2027-03-01",
    "archived_at": null,
    "created_at": "2026-09-03T15:12:44.201877Z",
    "updated_at": "2026-09-12T08:05:19.660231Z",
    "cards": [
      {
        "id": "1d3f5b7e-9a2c-4e6b-8d1f-3a5c7e9b0d05",
        "title": "Before you start",
        "position": 0,
        "body_html": "<p>Wear gloves and eye protection. Check the <strong>chemical log</strong> is signed.</p>",
        "steps": [
          {
            "id": "2e4a6c8e-0b1d-4f3a-8c5e-7a9b1d3f5a06",
            "position": 0,
            "title": "Switch off and isolate the fryers",
            "html": "<p>Use the red isolator by the back door.</p>",
            "image_url": "https://auth.sopcompass.com/storage/v1/object/public/step-images/example/isolator.jpg"
          },
          {
            "id": "3f5b7d9a-1c2e-4a4b-9d6f-8b0c2e4a6c15",
            "position": 1,
            "title": "Clear the prep surfaces",
            "html": "<p>Everything off, including the cutting boards.</p>",
            "image_url": null
          }
        ],
        "image_urls": [
          "https://auth.sopcompass.com/storage/v1/object/public/step-images/example/isolator.jpg"
        ]
      },
      {
        "id": "4a6c8e0b-3d5f-4b7a-8c9e-1d3f5a7c9e16",
        "title": "Degrease",
        "position": 1,
        "body_html": "<ol><li><p>Spray the hood filters.</p></li><li><p>Leave for 10 minutes.</p></li></ol>",
        "steps": [],
        "image_urls": []
      }
    ],
    "app_url": "https://app.sopcompass.com/sops/6c8e0a2b-4d6f-4c8e-9a1b-3d5f7a9c1e08?t=7c2e4a6b-8d1f-4a3c-9e5b-0d2f4a6c8e04"
  }
}

Card fields

cards is ordered by position, then id.

Field Type Description
id UUID The card’s id.
title string The card’s title (its section heading).
position integer Its place in the SOP, from 0.
body_html string The card’s content as HTML.
steps array The card’s steps, ordered by position, then id. [] when it has none.
image_urls array of strings Every image the card shows, in order and without repeats: each step’s image_url, plus the src of every <img> in the card’s and its steps’ HTML. Only http and https URLs are included.

Step fields

Field Type Description
id UUID The step’s id.
position integer Its place in the card, from 0.
title string The step’s title.
html string The step’s content as HTML.
image_url string or null The step’s screenshot or image.

Working with the HTML

body_html and html are the SOP’s stored content, as written in the editor. The app sanitizes this HTML when it displays it; the API returns it as stored. Sanitize it before rendering it in your own pages, as you would any user content, for example with DOMPurify in JavaScript or nh3 or bleach in Python.

For plain text (search indexes, AI prompts), strip the tags and use the card title as a heading. image_urls saves you parsing HTML to find images.

Errors

Status Code When
404 not_found The id isn’t a UUID, or no SOP with that id is visible to this workspace (including one in another workspace).
405 method_not_allowed Any method other than GET. There is no update or delete in v1.

Authentication, plan and rate limit errors apply to every endpoint; see Errors.