{
  "auth": {
    "bearer": [
      {
        "key": "token",
        "type": "string",
        "value": "{{access_token}}"
      }
    ],
    "type": "bearer"
  },
  "info": {
    "_postman_id": "b3af4131-04a6-eaab-91e8-ce695bd245bd",
    "description": "Every endpoint of the Hospital Management System API.\n\nStart in **Authentication → POST /auth/login**: send your identifier and password,\nand its test script stores access_token and refresh_token into the environment, so\nevery other request in this collection is authenticated from then on.\n\nRequests are grouped exactly as the router groups them. A request that needs a\npermission says so in its own description — a 403 here almost always means the\naccount is missing that permission, or the branch has the module switched off.",
    "name": "Hospital Management System API v1.0.0",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "description": "",
      "item": [
        {
          "name": "GET /",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "**From the router:** Landing + liveness.\n\n**Access:** open — no token required.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [],
              "raw": "{{base_url}}/"
            }
          }
        },
        {
          "name": "GET /healthz",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "This is the one route that does NOT use the response envelope: a probe is read by Docker, not by the console, and Docker only looks at the status code.\n\n**Access:** open — no token required.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "healthz"
              ],
              "raw": "{{base_url}}/healthz"
            }
          }
        },
        {
          "name": "GET /",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "**Access:** open — no token required.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1"
              ],
              "raw": "{{base_url}}/api/v1"
            }
          }
        }
      ],
      "name": "Service metadata · Taarifa za mfumo"
    },
    {
      "description": "The internal surface. Called by scheduler-service, not by a person. Guarded by the shared key every service in this stack uses, because there is no user behind a 2am sweep to hold a token. Deliberately NOT under /api/v1: these are not part of the application's API and no browser should ever reach them.",
      "item": [
        {
          "name": "POST /internal/jobs/search-reindex",
          "request": {
            "auth": {
              "apikey": [
                {
                  "key": "key",
                  "type": "string",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "type": "string",
                  "value": "{{internal_api_key}}"
                },
                {
                  "key": "in",
                  "type": "string",
                  "value": "header"
                }
              ],
              "type": "apikey"
            },
            "description": "**Access:** the internal `X-API-Key`. Called by scheduler-service, never by a user-facing client.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "internal",
                "jobs",
                "search-reindex"
              ],
              "raw": "{{base_url}}/internal/jobs/search-reindex"
            }
          }
        },
        {
          "name": "POST /internal/jobs/licence-expiry",
          "request": {
            "auth": {
              "apikey": [
                {
                  "key": "key",
                  "type": "string",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "type": "string",
                  "value": "{{internal_api_key}}"
                },
                {
                  "key": "in",
                  "type": "string",
                  "value": "header"
                }
              ],
              "type": "apikey"
            },
            "description": "**Access:** the internal `X-API-Key`. Called by scheduler-service, never by a user-facing client.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "internal",
                "jobs",
                "licence-expiry"
              ],
              "raw": "{{base_url}}/internal/jobs/licence-expiry"
            }
          }
        },
        {
          "name": "POST /internal/jobs/stock-expiry",
          "request": {
            "auth": {
              "apikey": [
                {
                  "key": "key",
                  "type": "string",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "type": "string",
                  "value": "{{internal_api_key}}"
                },
                {
                  "key": "in",
                  "type": "string",
                  "value": "header"
                }
              ],
              "type": "apikey"
            },
            "description": "**Access:** the internal `X-API-Key`. Called by scheduler-service, never by a user-facing client.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "internal",
                "jobs",
                "stock-expiry"
              ],
              "raw": "{{base_url}}/internal/jobs/stock-expiry"
            }
          }
        },
        {
          "name": "POST /internal/jobs/appointment-reminders",
          "request": {
            "auth": {
              "apikey": [
                {
                  "key": "key",
                  "type": "string",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "type": "string",
                  "value": "{{internal_api_key}}"
                },
                {
                  "key": "in",
                  "type": "string",
                  "value": "header"
                }
              ],
              "type": "apikey"
            },
            "description": "The facility's own name goes into the message, because \"you have an appointment tomorrow\" from an unidentified number is a message people delete. It is read from the organisation record rather than configured separately, so a hospital that corrects its name corrects its texts.\n\n**Access:** the internal `X-API-Key`. Called by scheduler-service, never by a user-facing client.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "internal",
                "jobs",
                "appointment-reminders"
              ],
              "raw": "{{base_url}}/internal/jobs/appointment-reminders"
            }
          }
        },
        {
          "name": "POST /internal/jobs/send-messages",
          "request": {
            "auth": {
              "apikey": [
                {
                  "key": "key",
                  "type": "string",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "type": "string",
                  "value": "{{internal_api_key}}"
                },
                {
                  "key": "in",
                  "type": "string",
                  "value": "header"
                }
              ],
              "type": "apikey"
            },
            "description": "Every ten minutes, not nightly. A result-ready text that arrives tomorrow morning is a text that was not worth sending, and the whole point of the queue is that a message the gateway refused once is tried again soon.\n\n**Access:** the internal `X-API-Key`. Called by scheduler-service, never by a user-facing client.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "internal",
                "jobs",
                "send-messages"
              ],
              "raw": "{{base_url}}/internal/jobs/send-messages"
            }
          }
        },
        {
          "name": "POST /internal/jobs/ledger-backfill",
          "request": {
            "auth": {
              "apikey": [
                {
                  "key": "key",
                  "type": "string",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "type": "string",
                  "value": "{{internal_api_key}}"
                },
                {
                  "key": "in",
                  "type": "string",
                  "value": "header"
                }
              ],
              "type": "apikey"
            },
            "description": "A job rather than a button, because it can take minutes on a year of trading and nobody should be watching a spinner for that. Safe to run repeatedly: every posting is idempotent, so a run that fails half way is fixed by the next one, and a run against an already-complete ledger does nothing and says so.\n\n**Access:** the internal `X-API-Key`. Called by scheduler-service, never by a user-facing client.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "internal",
                "jobs",
                "ledger-backfill"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "batch",
                  "value": "500"
                }
              ],
              "raw": "{{base_url}}/internal/jobs/ledger-backfill?batch=500"
            }
          }
        },
        {
          "name": "POST /internal/jobs/bed-charges",
          "request": {
            "auth": {
              "apikey": [
                {
                  "key": "key",
                  "type": "string",
                  "value": "X-API-Key"
                },
                {
                  "key": "value",
                  "type": "string",
                  "value": "{{internal_api_key}}"
                },
                {
                  "key": "in",
                  "type": "string",
                  "value": "header"
                }
              ],
              "type": "apikey"
            },
            "description": "Overnight, and idempotent by construction: a bed charge's source id is derived from the admission and the DATE, so the same night cannot be billed twice however many times this runs. A sweep that had to remember where it got to would lose that memory exactly once, on the night nobody was watching.\n\n**Access:** the internal `X-API-Key`. Called by scheduler-service, never by a user-facing client.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "internal",
                "jobs",
                "bed-charges"
              ],
              "raw": "{{base_url}}/internal/jobs/bed-charges"
            }
          }
        }
      ],
      "name": "Scheduled jobs · Kazi za ratiba"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /public/feedback/:id",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "**Access:** open — no token required.\n\n**Rate limit:** 60 per minute per client address.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "public",
                "feedback",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/public/feedback/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /public/feedback/:id",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"answers\": [\n    {\n      \"question_id\": \"\",\n      \"value\": null\n    }\n  ]\n}"
            },
            "description": "**Access:** open — no token required.\n\n**Rate limit:** 60 per minute per client address.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "public",
                "feedback",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/public/feedback/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Open endpoints · Njia zilizo wazi"
    },
    {
      "description": "Setting a deployment up. Two permissions, because they are two jobs. What the hospital IS — its name, logo and country — is `organisation:update`, held by whoever runs the hospital. What it is WIRED TO — storage, mail server, SMS gateway — is `integration:manage`, held by whoever installs it. Those are rarely the same person, and the credentials behind the second are not the first's to read.",
      "item": [
        {
          "name": "GET /settings/system",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "**From the router:** What this installation is. The hospital's name, logo, colour and country. Read is OPEN because the sign-in screen carries the name and the logo, and there is no account yet when it is drawn; nothing in it is secret — it is what any visitor reads off the front of the building. ITS OWN, MUCH LOOSER CEILING. The feedback limit above is 60 a minute because one patient answers one form once. This is asked for by every browser tab in the hospital on every page load, and a hospital arrives from ONE address: 60 would refuse the second half of a morning shift. The answer is cached both here and in front of config-service, so the cost of a request is close to nothing.\n\n**Access:** open — no token required.\n\n**Rate limit:** 600 per minute per client address.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "system"
              ],
              "raw": "{{base_url}}/api/v1/settings/system"
            }
          }
        },
        {
          "name": "GET /settings/system/image/:kind",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "description": "OPEN, like the settings themselves: the sign-in screen carries the hospital's logo and there is no account yet when it is drawn. It is the picture on the front of the building.\n\nThe bytes come through the backend rather than from a link straight into storage, for the same reason every other file does — file-service will serve an asset to anybody holding its id, and an id in a page's HTML is an id everybody holds.\n\n**From the router:** The logo and the tab icon, for the same reason and under the same ceiling: the sign-in screen draws them before anybody has an account.\n\n**Access:** open — no token required.\n\n**Rate limit:** 600 per minute per client address.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "system",
                "image",
                ":kind"
              ],
              "raw": "{{base_url}}/api/v1/settings/system/image/:kind",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /settings/system",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"accent\": \"\",\n  \"country\": \"\",\n  \"currency\": \"\",\n  \"date_format\": \"\",\n  \"document_accent\": \"\",\n  \"document_footer\": \"\",\n  \"document_theme\": \"\",\n  \"invoice_due_days\": \"\",\n  \"invoice_notice\": \"\",\n  \"invoice_terms\": \"\",\n  \"login_message\": \"\",\n  \"name\": \"\",\n  \"short_name\": \"\",\n  \"support_email\": \"\",\n  \"support_phone\": \"\",\n  \"tagline\": \"\",\n  \"timezone\": \"\"\n}"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "system"
              ],
              "raw": "{{base_url}}/api/v1/settings/system"
            }
          }
        },
        {
          "name": "POST /settings/system/image/:kind",
          "request": {
            "body": {
              "formdata": [
                {
                  "key": "file",
                  "src": [],
                  "type": "file"
                },
                {
                  "key": "entity_type",
                  "type": "text",
                  "value": ""
                },
                {
                  "key": "entity_id",
                  "type": "text",
                  "value": ""
                }
              ],
              "mode": "formdata"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "system",
                "image",
                ":kind"
              ],
              "raw": "{{base_url}}/api/v1/settings/system/image/:kind",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /settings/system/image/:kind",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "system",
                "image",
                ":kind"
              ],
              "raw": "{{base_url}}/api/v1/settings/system/image/:kind",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /settings/documents/preview",
          "request": {
            "description": "WHY A SPECIMEN AND NOT A REAL BILL. Somebody adjusting the wording on the hospital's paper needs to see the effect, and the alternative — find a bill, print it, look, come back, change a word, find the bill again — is a loop nobody completes, so the terms get typed once and never checked. It is also the only safe way to do it: a settings screen that could print any patient's invoice would be a way to read billing without holding bill:read.\n\nTHE FIGURES ARE OBVIOUSLY NOT REAL, and that is deliberate. A specimen that looked like a genuine invoice is one that ends up in front of a patient, so it is drawn for a patient who does not exist, stamped SPECIMEN, and never stored in the document register.\n\n**From the router:** A specimen invoice drawn from the settings as they stand, so somebody editing the wording can see it. Gated with the rest of this screen and NOT on bill:read — it draws an invented patient, so it is not a way to read billing without the permission for it.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "documents",
                "preview"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/settings/documents/preview?language="
            }
          }
        },
        {
          "name": "GET /settings/storage",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "storage"
              ],
              "raw": "{{base_url}}/api/v1/settings/storage"
            }
          }
        },
        {
          "name": "PATCH /settings/storage/:code",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"is_active\": false,\n  \"is_default\": false,\n  \"settings\": {}\n}"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "storage",
                ":code"
              ],
              "raw": "{{base_url}}/api/v1/settings/storage/:code",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "code",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /settings/email",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "email"
              ],
              "raw": "{{base_url}}/api/v1/settings/email"
            }
          }
        },
        {
          "name": "PUT /settings/email",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"config\": {}\n}"
            },
            "description": "The password arrives as the placeholder when it has not been retyped, and notification-service reads that as \"keep what is stored\" — so editing the port does not silently wipe the password.\n\n**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "email"
              ],
              "raw": "{{base_url}}/api/v1/settings/email"
            }
          }
        },
        {
          "name": "POST /settings/email/test",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"config\": {}\n}"
            },
            "description": "IT TESTS WHAT IS IN THE REQUEST, NOT WHAT IS STORED, which is the only order that helps: the question somebody has at this moment is \"is this password right\", and answering it after the password has been saved is answering it too late.\n\nA refusal here is an ANSWER, in the mail server's own words — \"authentication failed\", \"connection refused\". It is not a fault and is not logged as one.\n\n**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "email",
                "test"
              ],
              "raw": "{{base_url}}/api/v1/settings/email/test"
            }
          }
        },
        {
          "name": "GET /settings/sms",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "sms"
              ],
              "raw": "{{base_url}}/api/v1/settings/sms"
            }
          }
        },
        {
          "name": "PATCH /settings/sms/:code",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"is_active\": false,\n  \"is_default\": false,\n  \"settings\": {}\n}"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "sms",
                ":code"
              ],
              "raw": "{{base_url}}/api/v1/settings/sms/:code",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "code",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /settings/email/test-send",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"to\": \"\"\n}"
            },
            "description": "WHY THIS IS NOT `TestEmailSettings`. That one dials the server and authenticates: it answers \"is this password right\", before saving. This one answers a different question — \"does a message actually arrive\" — and only a message somebody receives can answer it. A server that accepts a login can still refuse to relay, reject the From address, or have the mail filed as spam.\n\n**From the router:** Sending a real test message is a SEPARATE route from testing the settings, because they answer different questions: one is \"is this password right\", the other is \"does a message actually arrive\".\n\n**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "email",
                "test-send"
              ],
              "raw": "{{base_url}}/api/v1/settings/email/test-send"
            }
          }
        },
        {
          "name": "POST /settings/sms/test-send",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"phone\": \"\"\n}"
            },
            "description": "IT COSTS MONEY AND ARRIVES ON A HANDSET. That is the point — a gateway that accepts credentials is not a gateway that delivers — and it is why the number is typed here rather than picked from the patient register.\n\nTHE NUMBER MUST CARRY ITS COUNTRY CODE. Gateways route on it, and a national number sent without one is either refused or delivered to whoever holds that number in the gateway's own country. The refusal names the shape wanted.\n\n**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "settings",
                "sms",
                "test-send"
              ],
              "raw": "{{base_url}}/api/v1/settings/sms/test-send"
            }
          }
        }
      ],
      "name": "Installation settings · Mipangilio ya usakinishaji"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /health",
          "request": {
            "description": "It answers 200 even when the stack is in pieces. That is deliberate: this is a REPORT, not a probe. A 503 here would be read by a load balancer as \"the backend is down\" and take the console out over a service the console does not use, and the operator reading this screen needs the detail, not the refusal.\n\nThe probe runs on every call rather than from a cache. A health page that shows a stale green light is worse than no health page: somebody stops investigating.\n\n**Permission:** `platform:health`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "health"
              ],
              "raw": "{{base_url}}/api/v1/health"
            }
          }
        }
      ],
      "name": "Stack health · Afya ya mfumo"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /services",
          "request": {
            "description": "It is separate from StackHealth because it answers instantly: the catalogue is configuration, and reading it does not wait on 33 network round trips.\n\n**Permission:** `platform:health`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "services"
              ],
              "raw": "{{base_url}}/api/v1/services"
            }
          }
        }
      ],
      "name": "Service catalogue · Orodha ya huduma"
    },
    {
      "description": "Authentication. Public: you cannot present a token before you have one.",
      "item": [
        {
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "// Where the tokens are put matters: an environment variable SHADOWS a",
                  "// collection one of the same name, so writing only to the collection",
                  "// would store a token nothing then reads.",
                  "const remember = (key, value) =\u003e {",
                  "  if (pm.environment.name) pm.environment.set(key, value);",
                  "  else pm.collectionVariables.set(key, value);",
                  "};",
                  "",
                  "const body = pm.response.json();",
                  "const tokens = body \u0026\u0026 body.data \u0026\u0026 body.data.tokens;",
                  "if (tokens \u0026\u0026 tokens.access_token) {",
                  "  remember('access_token', tokens.access_token);",
                  "  remember('refresh_token', tokens.refresh_token);",
                  "  console.log('Signed in as', body.data.user \u0026\u0026 body.data.user.display_name);",
                  "} else if (body \u0026\u0026 body.data \u0026\u0026 body.data.requires_2fa) {",
                  "  remember('session_token', body.data.session_token);",
                  "  console.log('Two-factor code required — answer it with POST /auth/verify-2fa');",
                  "}"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "name": "POST /auth/login",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"identifier\": \"{{identifier}}\",\n  \"password\": \"{{password}}\"\n}"
            },
            "description": "**Access:** open — no token required.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "login"
              ],
              "raw": "{{base_url}}/api/v1/auth/login"
            }
          }
        },
        {
          "name": "POST /auth/verify-2fa",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"session_token\": \"{{session_token}}\"\n}"
            },
            "description": "**Access:** open — no token required.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "verify-2fa"
              ],
              "raw": "{{base_url}}/api/v1/auth/verify-2fa"
            }
          }
        },
        {
          "name": "POST /auth/refresh",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"refresh_token\": \"{{refresh_token}}\"\n}"
            },
            "description": "**Access:** open — no token required.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "refresh"
              ],
              "raw": "{{base_url}}/api/v1/auth/refresh"
            }
          }
        },
        {
          "name": "POST /auth/password/forgot",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"contact\": \"\"\n}"
            },
            "description": "IT ANSWERS THE SAME WAY WHETHER OR NOT THE ACCOUNT EXISTS. Anything else is a way to ask this hospital, one address at a time and without signing in, which of its staff have accounts here — and to do it from outside the building, because this route has to be reachable by somebody who is locked out.\n\n**Access:** open — no token required.\n\n**Rate limit:** 10 per minute per client address.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "password",
                "forgot"
              ],
              "raw": "{{base_url}}/api/v1/auth/password/forgot"
            }
          }
        },
        {
          "name": "POST /auth/password/reset",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"contact\": \"\",\n  \"new_password\": \"\"\n}"
            },
            "description": "The code and the new password arrive together. Splitting them into two calls would mean holding the verified ticket in the browser between them, which is a session in everything but name and buys nothing: the person is standing at the form either way.\n\n**Access:** open — no token required.\n\n**Rate limit:** 10 per minute per client address.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "password",
                "reset"
              ],
              "raw": "{{base_url}}/api/v1/auth/password/reset"
            }
          }
        },
        {
          "name": "GET /auth/me",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "me"
              ],
              "raw": "{{base_url}}/api/v1/auth/me"
            }
          }
        },
        {
          "name": "POST /auth/logout",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"all_devices\": false\n}"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "logout"
              ],
              "raw": "{{base_url}}/api/v1/auth/logout"
            }
          }
        },
        {
          "name": "POST /auth/password",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"current_password\": \"\",\n  \"new_password\": \"\"\n}"
            },
            "description": "There is no permission on it. One that every account had to hold would not be a permission, and an account that cannot change its own password is an account whose password never changes after somebody else has typed it in.\n\n**From the router:** Changing your own password is in the same class: an account that cannot change its own is an account whose password stays whatever the person who created it typed.\n\n**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "password"
              ],
              "raw": "{{base_url}}/api/v1/auth/password"
            }
          }
        }
      ],
      "name": "Authentication · Kuingia kwenye mfumo"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /search",
          "request": {
            "description": "GATED ON BEING SIGNED IN, NOT ON A PERMISSION. There is no single permission that means \"may search\", because the question spans three registers a caller may hold different rights over. The gate is applied to the RESULTS instead: each kind is dropped unless the caller holds the permission for that register, so a cashier searching a surname finds the patient and not the nurse's staff record. Filtering in the browser would have shipped the row first and merely hidden it.\n\nA caller who may read none of the registers gets an empty list rather than a 403 — they are allowed to ask, there is simply nothing they may be told.\n\n**From the router:** Your own notifications. Behind no permission beyond being signed in: they are addressed to you, and read state is yours. A permission every account had to hold would not be a permission. The account comes from the token, never from a query. One search box. Gated on being signed in; the RESULTS are filtered by what the caller may read, register by register. There is no single \"may search\" permission because the question spans three registers with three different rights over them.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "search"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "20"
                },
                {
                  "disabled": true,
                  "key": "q",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/search?limit=20\u0026q="
            }
          }
        }
      ],
      "name": "Search · Utafutaji"
    },
    {
      "description": "Attachments. One surface for every kind of record. Gated on being signed in here; the real gate is inside, and it is the permission of the RECORD the file hangs off — whoever may read the patient may read their referral letter. Naming a permission on the route instead would mean one code that opened every scan in the building. Photographs. The subject decides the permission, inside the handler: whoever may open a patient may see the patient's face. media-service would serve the image to anybody holding its asset id, so the id stays inside the backend and every read comes through here.",
      "item": [
        {
          "name": "GET /photos/:subject/:id",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "photos",
                ":subject",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "size",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/photos/:subject/:id?size=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "subject",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /photos/:subject/:id",
          "request": {
            "body": {
              "formdata": [
                {
                  "key": "photo",
                  "type": "text",
                  "value": ""
                }
              ],
              "mode": "formdata"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "photos",
                ":subject",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/photos/:subject/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "subject",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Photographs · Picha"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /attachments",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "attachments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "entity_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "entity_type",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/attachments?entity_id=\u0026entity_type="
            }
          }
        },
        {
          "name": "POST /attachments",
          "request": {
            "body": {
              "formdata": [
                {
                  "key": "file",
                  "src": [],
                  "type": "file"
                },
                {
                  "key": "entity_type",
                  "type": "text",
                  "value": ""
                },
                {
                  "key": "entity_id",
                  "type": "text",
                  "value": ""
                }
              ],
              "mode": "formdata"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "attachments"
              ],
              "raw": "{{base_url}}/api/v1/attachments"
            }
          }
        },
        {
          "name": "GET /attachments/:id/download",
          "request": {
            "description": "The file's OWN record is fetched first, purely to learn what it is attached to — the permission is then the entity's. Asking the caller to tell us the entity type would let them name one they are allowed to read.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "attachments",
                ":id",
                "download"
              ],
              "raw": "{{base_url}}/api/v1/attachments/:id/download",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /attachments/:id/text",
          "request": {
            "description": "WHAT THIS IS ACTUALLY FOR. A referral letter arrives as a photograph of a page. A clerk who needs the referring doctor's name has, without this, to open an image, read it on screen and retype it — which is where the transcription errors come from. This returns the text so it can be read and copied.\n\nThe permission is the RECORD's, exactly as it is for the file itself: whoever may open the patient may read what was filed against them. Reading the words on a page is not a lesser act than looking at it.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "attachments",
                ":id",
                "text"
              ],
              "raw": "{{base_url}}/api/v1/attachments/:id/text",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /attachments/:id",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "attachments",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/attachments/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Attachments · Viambatisho"
    },
    {
      "description": "Asking IT for help, and talking to each other. Behind no permission beyond being signed in, deliberately. A permission to message a colleague is one every member of staff would have to hold, which is not a permission — and the person who most needs to report a frozen ward terminal is the one least likely to have been granted anything. Working the QUEUE is the gated half, and support-service makes that check itself against the caller's own token.",
      "item": [
        {
          "name": "GET /support/tickets",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "tickets"
              ],
              "raw": "{{base_url}}/api/v1/support/tickets"
            }
          }
        },
        {
          "name": "POST /support/tickets",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"body\": \"\",\n  \"category\": \"\",\n  \"priority\": \"\",\n  \"subject\": \"\"\n}"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "tickets"
              ],
              "raw": "{{base_url}}/api/v1/support/tickets"
            }
          }
        },
        {
          "name": "GET /support/queue",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "queue"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/queue?status="
            }
          }
        },
        {
          "name": "GET /support/tickets/:id",
          "request": {
            "description": "An agent's view carries the internal notes; a requester's does not. Which is used is decided by the permission, not by anything the browser asks for.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "tickets",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/support/tickets/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/tickets/:id/messages",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"body\": \"\",\n  \"internal\": false\n}"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "tickets",
                ":id",
                "messages"
              ],
              "raw": "{{base_url}}/api/v1/support/tickets/:id/messages",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/tickets/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"status\": \"\"\n}"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "tickets",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/support/tickets/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /support/summary",
          "request": {
            "description": "**Permission:** `asset:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/support/summary"
            }
          }
        },
        {
          "name": "GET /support/mortuary/bays",
          "request": {
            "description": "**Permission:** `mortuary:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `mortuary`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "mortuary",
                "bays"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/mortuary/bays?facility_id="
            }
          }
        },
        {
          "name": "GET /support/mortuary/bodies",
          "request": {
            "description": "**Permission:** `mortuary:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `mortuary`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "mortuary",
                "bodies"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/mortuary/bodies?limit=100\u0026status="
            }
          }
        },
        {
          "name": "POST /support/mortuary/bays",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"kind\": \"\",\n  \"label\": \"\"\n}"
            },
            "description": "**Permission:** `mortuary:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `mortuary`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "mortuary",
                "bays"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/mortuary/bays?facility_id="
            }
          }
        },
        {
          "name": "POST /support/mortuary/bodies",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bay_id\": \"\",\n  \"cause_of_death\": \"\",\n  \"certificate_no\": \"\",\n  \"certified_by\": \"\",\n  \"died_at\": \"\",\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"received_from\": \"\",\n  \"unknown_label\": \"\"\n}"
            },
            "description": "**Permission:** `mortuary:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `mortuary`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "mortuary",
                "bodies"
              ],
              "raw": "{{base_url}}/api/v1/support/mortuary/bodies"
            }
          }
        },
        {
          "name": "POST /support/mortuary/bodies/:id/release",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"receiver_id_number\": \"\",\n  \"receiver_id_type\": \"\",\n  \"receiver_name\": \"\",\n  \"receiver_relation\": \"\"\n}"
            },
            "description": "Its own permission: this is the moment something irreversible leaves the building, and the record of who took it is the only thing anybody has afterwards.\n\n**Permission:** `mortuary:release`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `mortuary`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "mortuary",
                "bodies",
                ":id",
                "release"
              ],
              "raw": "{{base_url}}/api/v1/support/mortuary/bodies/:id/release",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /support/blood/units",
          "request": {
            "description": "**Permission:** `bloodbank:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "units"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "group",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/blood/units?group=\u0026status="
            }
          }
        },
        {
          "name": "GET /support/blood/requests",
          "request": {
            "description": "**Permission:** `bloodbank:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "requests"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/blood/requests?limit=100\u0026status="
            }
          }
        },
        {
          "name": "POST /support/blood/units",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"blood_group\": \"\",\n  \"collected_on\": \"\",\n  \"component\": \"\",\n  \"donor_reference\": \"\",\n  \"expires_on\": \"\",\n  \"screen_notes\": \"\",\n  \"screened\": false,\n  \"unit_number\": \"\",\n  \"volume_ml\": 0\n}"
            },
            "description": "Unscreened blood goes to quarantine, not to the shelf.\n\n**Permission:** `bloodbank:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "units"
              ],
              "raw": "{{base_url}}/api/v1/support/blood/units"
            }
          }
        },
        {
          "name": "POST /support/blood/units/:id/screen",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"notes\": \"\",\n  \"passed\": false\n}"
            },
            "description": "**Permission:** `bloodbank:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "units",
                ":id",
                "screen"
              ],
              "raw": "{{base_url}}/api/v1/support/blood/units/:id/screen",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/blood/units/:id/crossmatch",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"patient_id\": \"\"\n}"
            },
            "description": "**Permission:** `bloodbank:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "units",
                ":id",
                "crossmatch"
              ],
              "raw": "{{base_url}}/api/v1/support/blood/units/:id/crossmatch",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/blood/units/:id/discard",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `bloodbank:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "units",
                ":id",
                "discard"
              ],
              "raw": "{{base_url}}/api/v1/support/blood/units/:id/discard",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/blood/units/:id/issue",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"patient_id\": \"\",\n  \"to\": \"\"\n}"
            },
            "description": "**Permission:** `bloodbank:issue`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "units",
                ":id",
                "issue"
              ],
              "raw": "{{base_url}}/api/v1/support/blood/units/:id/issue",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/blood/requests",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"blood_group\": \"\",\n  \"component\": \"\",\n  \"indication\": \"\",\n  \"patient_id\": \"\",\n  \"units\": 0,\n  \"urgency\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `bloodbank:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "requests"
              ],
              "raw": "{{base_url}}/api/v1/support/blood/requests"
            }
          }
        },
        {
          "name": "POST /support/blood/requests/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `bloodbank:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `blood-bank`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "blood",
                "requests",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/support/blood/requests/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /support/fleet/vehicles",
          "request": {
            "description": "**From the router:** THE REGISTER IS NOT THE DISPATCH DESK, and only one of them is optional. A branch that owns a vehicle records trips for it whether or not it runs a dispatch operation, so the register and the trip log stay open to anybody with `fleet:read`.\n\n**Permission:** `fleet:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "vehicles"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/vehicles?facility_id="
            }
          }
        },
        {
          "name": "GET /support/fleet/trips",
          "request": {
            "description": "**Permission:** `fleet:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "trips"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/trips?limit=100\u0026status="
            }
          }
        },
        {
          "name": "POST /support/fleet/vehicles",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"capability\": \"\",\n  \"fuel_pct\": 0,\n  \"inspection_expiry\": \"\",\n  \"insurance_expiry\": \"\",\n  \"kind\": \"\",\n  \"make_model\": \"\",\n  \"odometer_km\": 0,\n  \"registration\": \"\",\n  \"status\": \"\",\n  \"status_reason\": \"\"\n}"
            },
            "description": "**Permission:** `fleet:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "vehicles"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/vehicles?facility_id="
            }
          }
        },
        {
          "name": "PUT /support/fleet/vehicles/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"capability\": \"\",\n  \"fuel_pct\": 0,\n  \"inspection_expiry\": \"\",\n  \"insurance_expiry\": \"\",\n  \"kind\": \"\",\n  \"make_model\": \"\",\n  \"odometer_km\": 0,\n  \"registration\": \"\",\n  \"status\": \"\",\n  \"status_reason\": \"\"\n}"
            },
            "description": "**Permission:** `fleet:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "vehicles",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/vehicles/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/fleet/trips",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"crew\": \"\",\n  \"driver\": \"\",\n  \"from_place\": \"\",\n  \"kind\": \"\",\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"to_place\": \"\",\n  \"vehicle_id\": \"\"\n}"
            },
            "description": "**Permission:** `fleet:dispatch`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "trips"
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/trips"
            }
          }
        },
        {
          "name": "POST /support/fleet/trips/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"distance_km\": 0,\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `fleet:dispatch`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "trips",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/trips/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /support/fleet/zones",
          "request": {
            "description": "**Permission:** `fleet:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `ambulance`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "zones"
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/zones"
            }
          }
        },
        {
          "name": "GET /support/fleet/drivers",
          "request": {
            "description": "**Permission:** `fleet:dispatch`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `ambulance`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "drivers"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "zone_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/drivers?zone_id="
            }
          }
        },
        {
          "name": "GET /support/fleet/settings",
          "request": {
            "description": "**Permission:** `fleet:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `ambulance`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "settings"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "category",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/settings?category="
            }
          }
        },
        {
          "name": "PUT /support/fleet/settings/:key",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"value\": \"\"\n}"
            },
            "description": "The bounds are the service's, not this handler's. A timeout of zero seconds is wrong whether the console or a script asked for it, so the check belongs where both go through.\n\n**Permission:** `fleet:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `ambulance`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "settings",
                ":key"
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/settings/:key",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "key",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /support/fleet/vehicles/:id/position",
          "request": {
            "description": "THE TIME IS ALWAYS RETURNED WITH IT. A position with no time on it is a position somebody trusts for longer than they should: an ambulance that reported forty minutes ago is not where the map says it is, and a dispatcher deciding which vehicle is nearest needs to know that.\n\n**Permission:** `fleet:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `ambulance`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "vehicles",
                ":id",
                "position"
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/vehicles/:id/position",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /support/fleet/vehicles/:id/position",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"latitude\": 0,\n  \"longitude\": 0\n}"
            },
            "description": "Gated on fleet:dispatch rather than fleet:manage: this is reported BY the people running trips, from a handset in the vehicle, not by whoever maintains the register.\n\n**Permission:** `fleet:dispatch`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `ambulance`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "fleet",
                "vehicles",
                ":id",
                "position"
              ],
              "raw": "{{base_url}}/api/v1/support/fleet/vehicles/:id/position",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /support/assets",
          "request": {
            "description": "**Permission:** `asset:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "assets"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/assets?facility_id=\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /support/assets/:id/history",
          "request": {
            "description": "**Permission:** `asset:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "assets",
                ":id",
                "history"
              ],
              "raw": "{{base_url}}/api/v1/support/assets/:id/history",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/assets",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"category\": \"\",\n  \"department\": \"\",\n  \"location_id\": \"\",\n  \"make_model\": \"\",\n  \"name\": \"\",\n  \"purchase_cost\": 0,\n  \"purchased_on\": \"\",\n  \"serial_no\": \"\",\n  \"service_every_days\": 0,\n  \"status\": \"\",\n  \"status_reason\": \"\",\n  \"tag\": \"\",\n  \"warranty_until\": \"\"\n}"
            },
            "description": "**Permission:** `asset:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "assets"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/assets?facility_id="
            }
          }
        },
        {
          "name": "PUT /support/assets/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"category\": \"\",\n  \"department\": \"\",\n  \"location_id\": \"\",\n  \"make_model\": \"\",\n  \"name\": \"\",\n  \"purchase_cost\": 0,\n  \"purchased_on\": \"\",\n  \"serial_no\": \"\",\n  \"service_every_days\": 0,\n  \"status\": \"\",\n  \"status_reason\": \"\",\n  \"tag\": \"\",\n  \"warranty_until\": \"\"\n}"
            },
            "description": "**Permission:** `asset:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "assets",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/support/assets/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/assets/:id/events",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"cost\": 0,\n  \"detail\": \"\",\n  \"downtime_hours\": 0,\n  \"kind\": \"\",\n  \"performed_by\": \"\"\n}"
            },
            "description": "**Permission:** `asset:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "assets",
                ":id",
                "events"
              ],
              "raw": "{{base_url}}/api/v1/support/assets/:id/events",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /support/assets/:id/assignment",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"assigned_on\": \"\",\n  \"due_back_on\": \"\",\n  \"note\": \"\",\n  \"returned_on\": \"\",\n  \"staff_id\": \"\"\n}"
            },
            "description": "Gated on `asset:manage`, the same code that adds a machine to the register: handing a laptop to somebody and writing down that it exists are the same kind of act on the same register, and a separate code would suggest they are separate registers.\n\n**From the router:** Issuing a laptop and booking in a defibrillator are the same register. See the note on the handler.\n\n**Permission:** `asset:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "support",
                "assets",
                ":id",
                "assignment"
              ],
              "raw": "{{base_url}}/api/v1/support/assets/:id/assignment",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Support and specialist registers · Msaada na madaftari maalum"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /messaging/conversations",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "messaging",
                "conversations"
              ],
              "raw": "{{base_url}}/api/v1/messaging/conversations"
            }
          }
        },
        {
          "name": "POST /messaging/conversations",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"name\": \"\",\n  \"with\": [\n    \"\"\n  ]\n}"
            },
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "messaging",
                "conversations"
              ],
              "raw": "{{base_url}}/api/v1/messaging/conversations"
            }
          }
        },
        {
          "name": "GET /messaging/conversations/:id/messages",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "messaging",
                "conversations",
                ":id",
                "messages"
              ],
              "raw": "{{base_url}}/api/v1/messaging/conversations/:id/messages",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /messaging/conversations/:id/messages",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"body\": \"\",\n  \"file_id\": \"\",\n  \"file_name\": \"\",\n  \"file_size\": 0,\n  \"mime_type\": \"\"\n}"
            },
            "description": "{\"body\": \"…\", \"file_id\": \"…\", \"file_name\": \"…\", \"file_size\": 0, \"mime_type\": \"…\"}\n\nThe file fields are what UploadConversationFile answered. They are optional, and a line may be a file with no words — a photograph of a request form says what it says.\n\n**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "messaging",
                "conversations",
                ":id",
                "messages"
              ],
              "raw": "{{base_url}}/api/v1/messaging/conversations/:id/messages",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /messaging/conversations/:id/attachments",
          "request": {
            "body": {
              "formdata": [
                {
                  "key": "file",
                  "src": [],
                  "type": "file"
                },
                {
                  "key": "entity_type",
                  "type": "text",
                  "value": ""
                },
                {
                  "key": "entity_id",
                  "type": "text",
                  "value": ""
                }
              ],
              "mode": "formdata"
            },
            "description": "TWO STEPS, NOT ONE. The bytes go to file-service here; the LINE is written by SendMessage afterwards, carrying the handle this returns. A single step would mean an upload that succeeded and a message that failed leaves a file nobody can see and no way to retry without sending it twice.\n\nTHE GATE IS MEMBERSHIP, not a permission. Messaging is deliberately behind no permission — one every member of staff would have to hold is not a permission — so what decides who may put a file in a thread is whether the thread is theirs, which only the chat service knows.\n\n**From the router:** Files in a thread. The conversation is in the path on both, because membership of it is the gate — see the handlers.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "messaging",
                "conversations",
                ":id",
                "attachments"
              ],
              "raw": "{{base_url}}/api/v1/messaging/conversations/:id/attachments",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /messaging/conversations/:id/attachments/:file",
          "request": {
            "description": "The conversation is in the path so that membership can be checked BEFORE the file is fetched. A route that took only the file id would have to trust whoever knew it.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "messaging",
                "conversations",
                ":id",
                "attachments",
                ":file"
              ],
              "raw": "{{base_url}}/api/v1/messaging/conversations/:id/attachments/:file",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "file",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Staff messaging · Mawasiliano ya wafanyakazi"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /notifications",
          "request": {
            "description": "Always the caller's own — the account comes from the token, never a query.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "notifications"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                },
                {
                  "disabled": true,
                  "key": "unread",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/notifications?limit=50\u0026unread="
            }
          }
        },
        {
          "name": "POST /notifications/read-all",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "notifications",
                "read-all"
              ],
              "raw": "{{base_url}}/api/v1/notifications/read-all"
            }
          }
        },
        {
          "name": "POST /notifications/:id/read",
          "request": {
            "description": "**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "notifications",
                ":id",
                "read"
              ],
              "raw": "{{base_url}}/api/v1/notifications/:id/read",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Notifications · Arifa"
    },
    {
      "description": "The patient register. The root of the clinical domain. Reading is granted widely — a nurse, a cashier and a lab technician all need to know who the patient is — while opening and correcting a file stay with the people accountable for the register.",
      "item": [
        {
          "name": "GET /patients",
          "request": {
            "description": "**Permission:** `patient:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "gender",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "insured",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "page",
                  "value": "1"
                },
                {
                  "disabled": true,
                  "key": "page_size",
                  "value": "20"
                },
                {
                  "disabled": true,
                  "key": "payer",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/patients?gender=\u0026insured=\u0026page=1\u0026page_size=20\u0026payer=\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /patients/summary",
          "request": {
            "description": "Separate from the list because the tiles must count EVERY file: a total that changes as you page is not a total.\n\n**Permission:** `patient:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/patients/summary"
            }
          }
        },
        {
          "name": "GET /patients/:id",
          "request": {
            "description": "**Permission:** `patient:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/patients/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /patients",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"address\": \"\",\n  \"age_years\": 0,\n  \"allergies\": [\n    \"\"\n  ],\n  \"blood_group\": \"\",\n  \"chronic_conditions\": [\n    \"\"\n  ],\n  \"date_of_birth\": \"\",\n  \"date_of_death\": \"\",\n  \"district\": \"\",\n  \"email\": \"\",\n  \"first_name\": \"\",\n  \"gender\": \"\",\n  \"insurance_expiry\": \"\",\n  \"insurance_number\": \"\",\n  \"insurance_provider\": \"\",\n  \"last_name\": \"\",\n  \"marital_status\": \"\",\n  \"middle_name\": \"\",\n  \"national_id\": \"\",\n  \"next_of_kin\": \"\",\n  \"next_of_kin_phone\": \"\",\n  \"next_of_kin_relation\": \"\",\n  \"notes\": \"\",\n  \"occupation\": \"\",\n  \"patient_number\": \"\",\n  \"phone\": \"\",\n  \"region\": \"\",\n  \"registered_date\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `patient:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients"
              ],
              "raw": "{{base_url}}/api/v1/patients"
            }
          }
        },
        {
          "name": "PUT /patients/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"address\": \"\",\n  \"age_years\": 0,\n  \"allergies\": [\n    \"\"\n  ],\n  \"blood_group\": \"\",\n  \"chronic_conditions\": [\n    \"\"\n  ],\n  \"date_of_birth\": \"\",\n  \"date_of_death\": \"\",\n  \"district\": \"\",\n  \"email\": \"\",\n  \"first_name\": \"\",\n  \"gender\": \"\",\n  \"insurance_expiry\": \"\",\n  \"insurance_number\": \"\",\n  \"insurance_provider\": \"\",\n  \"last_name\": \"\",\n  \"marital_status\": \"\",\n  \"middle_name\": \"\",\n  \"national_id\": \"\",\n  \"next_of_kin\": \"\",\n  \"next_of_kin_phone\": \"\",\n  \"next_of_kin_relation\": \"\",\n  \"notes\": \"\",\n  \"occupation\": \"\",\n  \"patient_number\": \"\",\n  \"phone\": \"\",\n  \"region\": \"\",\n  \"registered_date\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `patient:update`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/patients/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /patients/:id",
          "request": {
            "description": "**Permission:** `patient:delete`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/patients/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /patients/:id/visits",
          "request": {
            "description": "**From the router:** One patient's attendances and observations. Gated on the VISIT permission, not the patient one: knowing who somebody is and knowing what they have been treated for are different questions, and a cashier needs the first without the second.\n\n**Permission:** `visit:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "visits"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                }
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/visits?limit=50",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /patients/:id/vitals",
          "request": {
            "description": "**Permission:** `visit:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "vitals"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                }
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/vitals?limit=50",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /patients/:id/bills",
          "request": {
            "description": "**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "bills"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                }
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/bills?limit=50",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /patients/:id/diagnostics",
          "request": {
            "description": "**Permission:** `lab:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "diagnostics"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "30"
                }
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/diagnostics?limit=30",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /patients/:id/diagnostics/trend",
          "request": {
            "description": "The join that makes a result mean something: a potassium of 5.4 is a different conversation depending on whether last month's was 5.3 or 3.9.\n\n**Permission:** `lab:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "diagnostics",
                "trend"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "code",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "24"
                }
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/diagnostics/trend?code=\u0026limit=24",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /patients/:id/prescriptions",
          "request": {
            "description": "**Permission:** `prescription:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "prescriptions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                }
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/prescriptions?limit=50",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /patients/:id/appointments",
          "request": {
            "description": "**Permission:** `appointment:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "appointments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                }
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/appointments?limit=50",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /patients/:id/consents",
          "request": {
            "description": "Every purpose the caller may read is returned, INCLUDING the ones with nothing recorded — a list that showed only what had been asked would make a patient nobody has asked look like a patient with nothing outstanding.\n\n**From the router:** What this patient has agreed to. The permission depends on WHICH consent — a theatre consent and a records-release consent are read by different people — so it is checked per purpose inside the handler.\n\n**Access:** any signed-in account. No further permission.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "consents"
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/consents",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /patients/:id/consents",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"granted\": false,\n  \"purpose\": \"\"\n}"
            },
            "description": "A WITHDRAWAL IS A NEW RECORD, NOT A DELETION. That it was granted on Tuesday and withdrawn on Thursday is the part that matters afterwards, and a system that overwrote the first would be unable to say what was true on Wednesday.\n\n**Access:** any signed-in account. No further permission.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "patients",
                ":id",
                "consents"
              ],
              "raw": "{{base_url}}/api/v1/patients/:id/consents",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Patient register · Daftari la wagonjwa"
    },
    {
      "description": "Visits, the queue. Moving somebody along the queue and writing up their consultation are separate permissions on purpose. A receptionist calls the next patient all day and never writes a clinical word; collapsing the two would mean granting one to grant the other.",
      "item": [
        {
          "name": "GET /visits",
          "request": {
            "description": "Defaults to everybody still in the building, ordered sickest-first: that is what a queue board is opened for, and requiring a filter to get it would make the common case the awkward one.\n\n**Permission:** `visit:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "department",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/visits?date=\u0026department=\u0026facility_id=\u0026limit=100\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /visits/summary",
          "request": {
            "description": "**Permission:** `visit:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits",
                "summary"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/visits/summary?facility_id="
            }
          }
        },
        {
          "name": "GET /visits/:id",
          "request": {
            "description": "**Permission:** `visit:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/visits/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /visits/:id/timeline",
          "request": {
            "description": "Gated on `visit:read` rather than a permission of its own: somebody who may see the visit may see how long it took. The wait is not more sensitive than the attendance it belongs to.\n\n**Permission:** `visit:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits",
                ":id",
                "timeline"
              ],
              "raw": "{{base_url}}/api/v1/visits/:id/timeline",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /visits",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"acuity\": 0,\n  \"chief_complaint\": \"\",\n  \"clinician_id\": \"\",\n  \"department\": \"\",\n  \"diagnosis\": [\n    \"\"\n  ],\n  \"examination\": \"\",\n  \"history\": \"\",\n  \"icd_codes\": [\n    \"\"\n  ],\n  \"insurance_number\": \"\",\n  \"needs_doctor\": false,\n  \"notes\": \"\",\n  \"outcome\": \"\",\n  \"patient_id\": \"\",\n  \"payer\": \"\",\n  \"referred_to\": \"\",\n  \"service_code\": \"\",\n  \"status\": \"\",\n  \"treatment_plan\": \"\",\n  \"visit_type\": \"\"\n}"
            },
            "description": "**Permission:** `visit:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/visits?facility_id="
            }
          }
        },
        {
          "name": "PUT /visits/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"acuity\": 0,\n  \"chief_complaint\": \"\",\n  \"clinician_id\": \"\",\n  \"department\": \"\",\n  \"diagnosis\": [\n    \"\"\n  ],\n  \"examination\": \"\",\n  \"history\": \"\",\n  \"icd_codes\": [\n    \"\"\n  ],\n  \"insurance_number\": \"\",\n  \"needs_doctor\": false,\n  \"notes\": \"\",\n  \"outcome\": \"\",\n  \"patient_id\": \"\",\n  \"payer\": \"\",\n  \"referred_to\": \"\",\n  \"service_code\": \"\",\n  \"status\": \"\",\n  \"treatment_plan\": \"\",\n  \"visit_type\": \"\"\n}"
            },
            "description": "**Permission:** `visit:update`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/visits/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /visits/:id/advance",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"label\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "Its own permission, and its own route, because moving somebody is a different act from writing on their record — see the note at the top of this file.\n\n**Permission:** `visit:advance`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits",
                ":id",
                "advance"
              ],
              "raw": "{{base_url}}/api/v1/visits/:id/advance",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /visits/:id/notes",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"note\": \"\"\n}"
            },
            "description": "**Permission:** `visit:advance`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits",
                ":id",
                "notes"
              ],
              "raw": "{{base_url}}/api/v1/visits/:id/notes",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /visits/:id/vitals",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bp_diastolic\": 0,\n  \"bp_systolic\": 0,\n  \"height_cm\": 0,\n  \"notes\": \"\",\n  \"pain_score\": 0,\n  \"pulse_bpm\": 0,\n  \"respiratory_rate\": 0,\n  \"spo2\": 0,\n  \"temperature_c\": 0,\n  \"weight_kg\": 0\n}"
            },
            "description": "Gated on `vitals:record`, held by nurses and clinical officers who do not necessarily hold `visit:update`: taking observations is not writing up a consultation, and a triage nurse must be able to do the first without the second.\n\n**From the router:** Taking observations is not writing up a consultation. A triage nurse must be able to do the first without the second.\n\n**Permission:** `vitals:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "visits",
                ":id",
                "vitals"
              ],
              "raw": "{{base_url}}/api/v1/visits/:id/vitals",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Visits and the queue · Mahudhurio na foleni"
    },
    {
      "description": "The organisation and its branches. Reading the branch list is separate from editing it, and editing the organisation itself is separate again: a ward clerk picking a branch from a dropdown is not somebody who may change the licence number.",
      "item": [
        {
          "name": "GET /organisation",
          "request": {
            "description": "**Permission:** `organisation:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation"
              ],
              "raw": "{{base_url}}/api/v1/organisation"
            }
          }
        },
        {
          "name": "PUT /organisation",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"address\": \"\",\n  \"country\": \"\",\n  \"currency\": \"\",\n  \"district\": \"\",\n  \"email\": \"\",\n  \"fiscal_year_start\": 0,\n  \"legal_name\": \"\",\n  \"licence_expiry\": \"\",\n  \"licence_no\": \"\",\n  \"logo_url\": \"\",\n  \"name\": \"\",\n  \"ownership\": \"\",\n  \"phone\": \"\",\n  \"region\": \"\",\n  \"registration_no\": \"\",\n  \"timezone\": \"\",\n  \"tin\": \"\",\n  \"vrn\": \"\",\n  \"website\": \"\"\n}"
            },
            "description": "**Permission:** `organisation:update`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation"
              ],
              "raw": "{{base_url}}/api/v1/organisation"
            }
          }
        },
        {
          "name": "GET /organisation/facilities",
          "request": {
            "description": "**Permission:** `facility:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "facilities"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "include_inactive",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/organisation/facilities?include_inactive="
            }
          }
        },
        {
          "name": "GET /organisation/facilities/:id",
          "request": {
            "description": "**Permission:** `facility:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "facilities",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/organisation/facilities/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /organisation/facilities",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"address\": \"\",\n  \"code\": \"\",\n  \"district\": \"\",\n  \"email\": \"\",\n  \"is_primary\": false,\n  \"licensed_beds\": 0,\n  \"name\": \"\",\n  \"ownership\": \"\",\n  \"phone\": \"\",\n  \"region\": \"\",\n  \"status\": \"\",\n  \"tier\": \"\",\n  \"ward\": \"\"\n}"
            },
            "description": "**Permission:** `facility:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "facilities"
              ],
              "raw": "{{base_url}}/api/v1/organisation/facilities"
            }
          }
        },
        {
          "name": "PUT /organisation/facilities/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"address\": \"\",\n  \"code\": \"\",\n  \"district\": \"\",\n  \"email\": \"\",\n  \"is_primary\": false,\n  \"licensed_beds\": 0,\n  \"name\": \"\",\n  \"ownership\": \"\",\n  \"phone\": \"\",\n  \"region\": \"\",\n  \"status\": \"\",\n  \"tier\": \"\",\n  \"ward\": \"\"\n}"
            },
            "description": "**Permission:** `facility:update`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "facilities",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/organisation/facilities/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /organisation/facilities/:id",
          "request": {
            "description": "**Permission:** `facility:delete`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "facilities",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/organisation/facilities/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /organisation/facilities/:id/modules",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"enabled\": false,\n  \"module_id\": \"\",\n  \"reason\": \"\"\n}"
            },
            "description": "**From the router:** Switching a module off at a branch is its own permission. It removes a screen from everybody who works there, which is a bigger act than correcting the branch's phone number.\n\n**Permission:** `module:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "facilities",
                ":id",
                "modules"
              ],
              "raw": "{{base_url}}/api/v1/organisation/facilities/:id/modules",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /organisation/departments",
          "request": {
            "description": "**Permission:** `department:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "departments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/organisation/departments?facility_id="
            }
          }
        },
        {
          "name": "POST /organisation/departments",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"annual_budget\": 0,\n  \"code\": \"\",\n  \"head_name\": \"\",\n  \"head_user_id\": \"\",\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"phone\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `department:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "departments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/organisation/departments?facility_id="
            }
          }
        },
        {
          "name": "PUT /organisation/departments/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"annual_budget\": 0,\n  \"code\": \"\",\n  \"head_name\": \"\",\n  \"head_user_id\": \"\",\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"phone\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `department:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "departments",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/organisation/departments/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /organisation/departments/:id",
          "request": {
            "description": "**Permission:** `department:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "departments",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/organisation/departments/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /organisation/locations",
          "request": {
            "description": "**Permission:** `location:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "locations"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "kind",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/organisation/locations?facility_id=\u0026kind="
            }
          }
        },
        {
          "name": "POST /organisation/locations",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"building\": \"\",\n  \"capacity\": 0,\n  \"code\": \"\",\n  \"department_id\": \"\",\n  \"floor\": \"\",\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `location:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "locations"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/organisation/locations?facility_id="
            }
          }
        },
        {
          "name": "PUT /organisation/locations/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"building\": \"\",\n  \"capacity\": 0,\n  \"code\": \"\",\n  \"department_id\": \"\",\n  \"floor\": \"\",\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `location:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "locations",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/organisation/locations/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /organisation/locations/:id",
          "request": {
            "description": "**Permission:** `location:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "organisation",
                "locations",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/organisation/locations/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Organisation and branches · Taasisi na matawi"
    },
    {
      "description": "Money. The finest-grained gates in the system, because the acts are genuinely different jobs. `bill:discount` and `payment:reverse` are the two that matter most: both are ways for money to legitimately leave, and both are ways for it to leave illegitimately. Neither belongs to whoever happens to be able to raise an invoice.",
      "item": [
        {
          "name": "GET /billing/bills",
          "request": {
            "description": "**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "outstanding",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "payer",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/bills?date=\u0026facility_id=\u0026limit=100\u0026outstanding=\u0026payer=\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /billing/summary",
          "request": {
            "description": "**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/billing/summary"
            }
          }
        },
        {
          "name": "GET /billing/bills/:id",
          "request": {
            "description": "**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/bills/:id/invoice",
          "request": {
            "description": "GATED ON bill:read, the same permission as looking at the bill on screen. A bill somebody may read is a bill they may print: the paper and the screen carry identical information, and a gate on one and not the other protects nothing while stopping somebody doing their job at a printer.\n\n**From the router:** The invoice. Gated on bill:read, exactly as the screen is: a bill somebody may look at is a bill they may print, and a separate print permission would protect nothing while stopping a clerk handing a patient the paper they are standing there asking for.\n\n**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "invoice"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/invoice?language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/bills/:id/credit-note",
          "request": {
            "description": "IT IS REFUSED FOR A BILL THAT IS STILL OWED, and that refusal is the most important line in this file. A credit note says a debt was reduced. Issued against a live bill it is a document asserting something untrue, on the hospital's letterhead, with a number on it — and it is exactly the document somebody would want in order to make a debt disappear quietly. If nothing has been cancelled, written off or discounted, there is nothing to credit.\n\nITS NUMBER IS DERIVED FROM THE BILL'S, not drawn from a sequence. Reprinting a document must produce the same document; a fresh number on every print would mean a patient and the hospital holding two credit notes for one reduction, with no way to tell they were the same event.\n\n**From the router:** The note that takes a demand back. Same permission as the invoice — it is a view of the same bill — and the handler refuses outright for a bill that is still owed, because a credit note against a live debt is a false document and exactly the one somebody would want.\n\n**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "credit-note"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/credit-note?language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/patients/:id/statement",
          "request": {
            "description": "A DIFFERENT QUESTION FROM AN INVOICE. An invoice asks somebody to pay a figure. A statement answers \"how did I get here\" — it is what is produced when a patient disputes a balance, or arrives with a handful of receipts and wants them accounted for. So it is a table of EVENTS with a balance running down it, not a longer invoice.\n\nN+1 ON PURPOSE, and only just. The payments are fetched one bill at a time rather than in a single query, because the alternative is a bespoke join that exists solely for this document. A statement is printed rarely and by hand; fifty small queries on that path is a trade worth making to avoid a second way of reading payments that could disagree with the first.\n\n**From the router:** Everything that has happened on one patient's account. Gated on bill:read rather than on patient:read: it is a page of money, and seeing what somebody was charged is not part of seeing who they are.\n\n**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "patients",
                ":id",
                "statement"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/patients/:id/statement?language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /billing/bills",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"items\": [\n    {\n      \"category\": \"\",\n      \"code\": \"\",\n      \"department\": \"\",\n      \"description\": \"\",\n      \"quantity\": 0,\n      \"source\": \"\",\n      \"source_id\": \"\",\n      \"unit_price\": 0\n    }\n  ],\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"payer\": \"\",\n  \"scheme_id\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `bill:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills"
            }
          }
        },
        {
          "name": "POST /billing/sales",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"lines\": [\n    {\n      \"batch_id\": \"\",\n      \"category\": \"\",\n      \"code\": \"\",\n      \"department\": \"\",\n      \"description\": \"\",\n      \"quantity\": 0,\n      \"unit_price\": 0\n    }\n  ],\n  \"method\": \"\",\n  \"patient_id\": \"\",\n  \"reference\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "ONE REQUEST, because a sale is one event. What this replaces was four calls made from the browser — open the bill, add each line, issue it, take the payment — and a dropped connection between any two of them left a half-sale for somebody to unpick at the counter with a queue behind them. There is now no state in which the patient has paid for a bill that does not exist, or holds goods the shelf still thinks it has.\n\n**From the router:** The till. One request for a whole sale, gated on creating a bill AND taking money, because it does both — a cashier who may only raise bills must not be able to ring one up and receipt it in a single call that skips the second gate.\n\n**Permission:** `bill:create` + `payment:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "sales"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/sales?facility_id="
            }
          }
        },
        {
          "name": "POST /billing/bills/:id/items",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"category\": \"\",\n  \"code\": \"\",\n  \"department\": \"\",\n  \"description\": \"\",\n  \"quantity\": 0,\n  \"source\": \"\",\n  \"source_id\": \"\",\n  \"unit_price\": 0\n}"
            },
            "description": "**Permission:** `bill:update`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "items"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/items",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /billing/bills/:id/items/:itemId",
          "request": {
            "description": "Draft only. Once a bill is issued the patient has been shown it, and quietly removing a line from a document somebody has already seen is how a dispute becomes unresolvable.\n\n**Permission:** `bill:update`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "items",
                ":itemId"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/items/:itemId",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "itemId",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /billing/bills/:id/issue",
          "request": {
            "description": "**Permission:** `bill:update`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "issue"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/issue",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /billing/bills/:id/discount",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `bill:discount`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "discount"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/discount",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /billing/bills/:id/void",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `bill:void`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "void"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/void",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/payments",
          "request": {
            "description": "**Permission:** `payment:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "payments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "method",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/payments?date=\u0026facility_id=\u0026limit=200\u0026method="
            }
          }
        },
        {
          "name": "POST /billing/bills/:id/payments",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"method\": \"\",\n  \"reference\": \"\"\n}"
            },
            "description": "**Permission:** `payment:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "payments"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/payments",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/payment-providers",
          "request": {
            "description": "Read from the service each time. A provider whose agreement has lapsed disappears from the cashier's list on the next screen load rather than on the next deploy — and a cashier offering a service the hospital can no longer collect through is a queue that stops moving.\n\n**From the router:** Mobile money. Two calls, because the money arrives seconds after the button is pressed and sometimes not at all — see handlers/mobilemoney.go. Both need payment:create: this IS taking money, whatever it looks like.\n\n**Permission:** `payment:create`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "payment-providers"
              ],
              "raw": "{{base_url}}/api/v1/billing/payment-providers"
            }
          }
        },
        {
          "name": "POST /billing/bills/:id/payments/mobile",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"phone\": \"\",\n  \"provider\": \"\"\n}"
            },
            "description": "{\"provider\": \"mpesa\", \"phone\": \"+2557…\", \"amount\": 12000}\n\n**Permission:** `payment:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "payments",
                "mobile"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/payments/mobile",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /billing/payments/confirm",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bill_id\": \"\",\n  \"reference\": \"\"\n}"
            },
            "description": "SAFE TO CALL REPEATEDLY. The cashier's screen polls this while the patient is looking for their PIN. A reference that has already produced a receipt returns that same receipt rather than taking the money twice — the guard is the provider's reference, which is unique and is stored on the payment row.\n\n**Permission:** `payment:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "payments",
                "confirm"
              ],
              "raw": "{{base_url}}/api/v1/billing/payments/confirm"
            }
          }
        },
        {
          "name": "POST /billing/payments/:id/reverse",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `payment:reverse`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "payments",
                ":id",
                "reverse"
              ],
              "raw": "{{base_url}}/api/v1/billing/payments/:id/reverse",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/payments/:id/receipt",
          "request": {
            "description": "**From the router:** The receipt itself. Gated on payment:read rather than payment:create: reprinting one a patient has lost is a records job, not a till job.\n\n**Permission:** `payment:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "payments",
                ":id",
                "receipt"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/payments/:id/receipt?language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/till",
          "request": {
            "description": "The caller's OWN, always: the account id comes from the token, never from the query. A cashier reconciling their drawer has no business reading somebody else's, and passing the id in would make that a matter of typing a different one.\n\n**From the router:** Your OWN till. The account id comes from the token, never from a query — a cashier reconciling their drawer has no business reading somebody else's, and passing an id in would make that a matter of typing a different one. Gated on taking money rather than on reading receipts, because that is who has a drawer.\n\n**Permission:** `payment:create`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "till"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/till?date="
            }
          }
        },
        {
          "name": "GET /billing/tariffs",
          "request": {
            "description": "**Permission:** `tariff:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "tariffs"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "category",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "payer",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/tariffs?category=\u0026payer=\u0026search="
            }
          }
        },
        {
          "name": "POST /billing/tariffs",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"category\": \"\",\n  \"code\": \"\",\n  \"department\": \"\",\n  \"name\": \"\",\n  \"payer\": \"\",\n  \"price\": 0\n}"
            },
            "description": "A change retires the old row and writes a new one. Yesterday's invoices have to remain explicable, and the only way to explain them is to still have the price that produced them.\n\n**Permission:** `tariff:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "tariffs"
              ],
              "raw": "{{base_url}}/api/v1/billing/tariffs"
            }
          }
        },
        {
          "name": "GET /billing/flow",
          "request": {
            "description": "**From the router:** The front desk's two fees and the collection rule. Gated on the price list's own permissions rather than an accounting one: this says what the counter charges, and the person who maintains the price list is the person who knows.\n\n**Permission:** `tariff:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "flow"
              ],
              "raw": "{{base_url}}/api/v1/billing/flow"
            }
          }
        },
        {
          "name": "PUT /billing/flow",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"consultation\": {\n    \"code\": \"\",\n    \"name\": \"\",\n    \"price\": 0\n  },\n  \"payment_before_service\": false,\n  \"registration\": {\n    \"code\": \"\",\n    \"name\": \"\",\n    \"price\": 0\n  }\n}"
            },
            "description": "**Permission:** `tariff:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "flow"
              ],
              "raw": "{{base_url}}/api/v1/billing/flow"
            }
          }
        },
        {
          "name": "GET /billing/schemes",
          "request": {
            "description": "**Permission:** `insurance:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "schemes"
              ],
              "raw": "{{base_url}}/api/v1/billing/schemes"
            }
          }
        },
        {
          "name": "POST /billing/schemes",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"code\": \"\",\n  \"contact_person\": \"\",\n  \"contract_expiry\": \"\",\n  \"contract_no\": \"\",\n  \"coverage_pct\": 0,\n  \"email\": \"\",\n  \"name\": \"\",\n  \"phone\": \"\",\n  \"preauth_above\": 0,\n  \"settlement_days\": 0\n}"
            },
            "description": "**Permission:** `claim:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "schemes"
              ],
              "raw": "{{base_url}}/api/v1/billing/schemes"
            }
          }
        },
        {
          "name": "PUT /billing/schemes/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"code\": \"\",\n  \"contact_person\": \"\",\n  \"contract_expiry\": \"\",\n  \"contract_no\": \"\",\n  \"coverage_pct\": 0,\n  \"email\": \"\",\n  \"name\": \"\",\n  \"phone\": \"\",\n  \"preauth_above\": 0,\n  \"settlement_days\": 0\n}"
            },
            "description": "**Permission:** `claim:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "schemes",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/billing/schemes/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/claims",
          "request": {
            "description": "**Permission:** `insurance:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "claims"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "scheme_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/claims?scheme_id=\u0026status="
            }
          }
        },
        {
          "name": "GET /billing/claims/:id/invoice",
          "request": {
            "description": "WHAT IS DEMANDED IS THE SCHEME'S SHARE, not the bill's total. Cover is copied onto a bill the day it is raised, so a claim settled in March is settled at the March arrangement — reading today's percentage would rewrite history every time a contract was renegotiated, and always in one party's favour.\n\n**From the router:** The claim on paper, for a scheme that wants one. Gated with the register it comes from: printing a claim is reading a claim.\n\n**Permission:** `insurance:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "claims",
                ":id",
                "invoice"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/claims/:id/invoice?language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /billing/bills/:id/claim",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"preauth_reference\": \"\"\n}"
            },
            "description": "The reference is optional in the request and MANDATORY in the answer when the scheme requires it: a claim over that scheme's `preauth_above` is refused without one, and the refusal names both the claim and the threshold.\n\n**Permission:** `claim:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "bills",
                ":id",
                "claim"
              ],
              "raw": "{{base_url}}/api/v1/billing/bills/:id/claim",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /billing/claims/:id/advance",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"approved\": 0,\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `claim:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "claims",
                ":id",
                "advance"
              ],
              "raw": "{{base_url}}/api/v1/billing/claims/:id/advance",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/expenses",
          "request": {
            "description": "**Permission:** `expense:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "expenses"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "category",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/expenses?category=\u0026from=\u0026status="
            }
          }
        },
        {
          "name": "POST /billing/expenses",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"category\": \"\",\n  \"department\": \"\",\n  \"description\": \"\",\n  \"method\": \"\",\n  \"payee\": \"\",\n  \"spent_on\": \"\"\n}"
            },
            "description": "**Permission:** `expense:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "expenses"
              ],
              "raw": "{{base_url}}/api/v1/billing/expenses"
            }
          }
        },
        {
          "name": "POST /billing/expenses/:id/decide",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `expense:approve`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "expenses",
                ":id",
                "decide"
              ],
              "raw": "{{base_url}}/api/v1/billing/expenses/:id/decide",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /billing/expenses/:id/voucher",
          "request": {
            "description": "AN UNAPPROVED EXPENSE STILL PRINTS, and says so. The voucher is what somebody carries to get an expense approved as often as it is what records an approved one; refusing to draw it until approval would mean the approval had to happen on a screen with no paper in front of it.\n\n**From the router:** The voucher. On expense:read, not expense:approve — it is as often the paper somebody carries IN ORDER to get an expense approved as it is the record of an approved one, and it says on its face when it has not been approved.\n\n**Permission:** `expense:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "billing",
                "expenses",
                ":id",
                "voucher"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/billing/expenses/:id/voucher?language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Billing and payments · Ankara na malipo"
    },
    {
      "description": "Diagnostics. Entering a result and RELEASING one are separate permissions, and the repository refuses a release by whoever entered every value even if somebody holds both. Two pairs of eyes is the control; a system that lets one person do both has it written on a wall, not implemented.",
      "item": [
        {
          "name": "GET /diagnostics/orders",
          "request": {
            "description": "**Permission:** `lab:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "orders"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "discipline",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "pending",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "priority",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/orders?date=\u0026discipline=\u0026limit=100\u0026pending=\u0026priority=\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /diagnostics/summary",
          "request": {
            "description": "**Permission:** `lab:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "summary"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "discipline",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/summary?discipline="
            }
          }
        },
        {
          "name": "GET /diagnostics/orders/:id",
          "request": {
            "description": "**Permission:** `lab:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "orders",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/orders/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /diagnostics/critical",
          "request": {
            "description": "Gated on `lab:read` rather than something narrower: the point of this list is that somebody sees it. A permission that kept it from a ward nurse would be working against the only reason it exists.\n\n**From the router:** The critical list is gated on plain read on purpose: the whole point of it is that somebody sees it, and a narrower permission would work against the only reason it exists.\n\n**Permission:** `lab:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "critical"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/critical"
            }
          }
        },
        {
          "name": "POST /diagnostics/results/:id/acknowledge",
          "request": {
            "description": "**Permission:** `lab:read`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "results",
                ":id",
                "acknowledge"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/results/:id/acknowledge",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /diagnostics/orders",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"clinical_notes\": \"\",\n  \"discipline\": \"\",\n  \"patient_id\": \"\",\n  \"priority\": \"\",\n  \"test_codes\": [\n    \"\"\n  ],\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `lab:order`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "orders"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/orders"
            }
          }
        },
        {
          "name": "POST /diagnostics/orders/:id/advance",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `lab:process`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "orders",
                ":id",
                "advance"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/orders/:id/advance",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /diagnostics/orders/:id/reject",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `lab:process`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "orders",
                ":id",
                "reject"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/orders/:id/reject",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /diagnostics/orders/:id/results",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"results\": [\n    {\n      \"comment\": \"\",\n      \"id\": \"\",\n      \"value_num\": 0,\n      \"value_text\": \"\"\n    }\n  ]\n}"
            },
            "description": "**Permission:** `lab:result`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "orders",
                ":id",
                "results"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/orders/:id/results",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /diagnostics/orders/:id/verify",
          "request": {
            "description": "**Permission:** `lab:verify`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "orders",
                ":id",
                "verify"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/orders/:id/verify",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /diagnostics/tests",
          "request": {
            "description": "**Permission:** `lab:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "tests"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "discipline",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/tests?discipline=\u0026search="
            }
          }
        },
        {
          "name": "POST /diagnostics/tests",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"category\": \"\",\n  \"code\": \"\",\n  \"critical_high\": 0,\n  \"critical_low\": 0,\n  \"discipline\": \"\",\n  \"name\": \"\",\n  \"ref_high\": 0,\n  \"ref_low\": 0,\n  \"specimen\": \"\",\n  \"tariff_code\": \"\",\n  \"turnaround_hours\": 0,\n  \"unit\": \"\"\n}"
            },
            "description": "**From the router:** Editing a reference range silently changes what counts as abnormal for every result entered afterwards. A manager's decision, not a bench technician's.\n\n**Permission:** `lab:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "tests"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/tests"
            }
          }
        },
        {
          "name": "PUT /diagnostics/tests/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"category\": \"\",\n  \"code\": \"\",\n  \"critical_high\": 0,\n  \"critical_low\": 0,\n  \"discipline\": \"\",\n  \"name\": \"\",\n  \"ref_high\": 0,\n  \"ref_low\": 0,\n  \"specimen\": \"\",\n  \"tariff_code\": \"\",\n  \"turnaround_hours\": 0,\n  \"unit\": \"\"\n}"
            },
            "description": "**Permission:** `lab:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "tests",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/tests/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /diagnostics/results/:id/release",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"withhold_reason\": \"\"\n}"
            },
            "description": "Its own permission, because deciding that somebody may read their own result is a clinical judgement. It is the single point at which this system could otherwise tell a person they have cancer with nobody in the room.\n\n**From the router:** Releasing a result to the patient is a CLINICAL judgement, so it has its own permission rather than riding on lab:verify. It is the single point at which this system could otherwise tell somebody they have cancer with nobody in the room.\n\n**Permission:** `result:release`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "diagnostics",
                "results",
                ":id",
                "release"
              ],
              "raw": "{{base_url}}/api/v1/diagnostics/results/:id/release",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Laboratory and imaging · Maabara na picha"
    },
    {
      "description": "Stock: the pharmacy and the store. One stock system, two workflows. Moving stock is separate from editing the catalogue: a storekeeper moves stock all day and never touches the catalogue, and whoever decides what the catalogue contains is not thereby somebody who should be writing stock off.",
      "item": [
        {
          "name": "GET /inventory/products",
          "request": {
            "description": "**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "products"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "category",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "kind",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "low",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "page",
                  "value": "1"
                },
                {
                  "description": "Capped at 200. `page_size` is accepted as an alias.",
                  "disabled": true,
                  "key": "per_page",
                  "value": "50"
                },
                {
                  "description": "Free-text filter.",
                  "disabled": true,
                  "key": "search",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inventory/products?category=\u0026kind=\u0026low=\u0026page=1\u0026per_page=50\u0026search="
            }
          }
        },
        {
          "name": "GET /inventory/summary",
          "request": {
            "description": "**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/inventory/summary"
            }
          }
        },
        {
          "name": "GET /inventory/batches",
          "request": {
            "description": "**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "batches"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "expiring",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "product_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inventory/batches?expiring=\u0026product_id="
            }
          }
        },
        {
          "name": "GET /inventory/movements",
          "request": {
            "description": "**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "movements"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "kind",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "product_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inventory/movements?from=\u0026kind=\u0026limit=200\u0026product_id="
            }
          }
        },
        {
          "name": "GET /inventory/suppliers",
          "request": {
            "description": "**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "suppliers"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "page",
                  "value": "1"
                },
                {
                  "description": "Capped at 200. `page_size` is accepted as an alias.",
                  "disabled": true,
                  "key": "per_page",
                  "value": "50"
                },
                {
                  "description": "Free-text filter.",
                  "disabled": true,
                  "key": "search",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inventory/suppliers?page=1\u0026per_page=50\u0026search="
            }
          }
        },
        {
          "name": "POST /inventory/products",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"brand_id\": \"\",\n  \"category\": \"\",\n  \"category_id\": \"\",\n  \"code\": \"\",\n  \"controlled\": false,\n  \"form\": \"\",\n  \"generic_name\": \"\",\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"prescription_only\": false,\n  \"reorder_level\": 0,\n  \"sale_price\": 0,\n  \"strength\": \"\",\n  \"tariff_code\": \"\",\n  \"unit\": \"\",\n  \"unit_id\": \"\"\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "products"
              ],
              "raw": "{{base_url}}/api/v1/inventory/products"
            }
          }
        },
        {
          "name": "PUT /inventory/products/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"brand_id\": \"\",\n  \"category\": \"\",\n  \"category_id\": \"\",\n  \"code\": \"\",\n  \"controlled\": false,\n  \"form\": \"\",\n  \"generic_name\": \"\",\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"prescription_only\": false,\n  \"reorder_level\": 0,\n  \"sale_price\": 0,\n  \"strength\": \"\",\n  \"tariff_code\": \"\",\n  \"unit\": \"\",\n  \"unit_id\": \"\"\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "products",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/inventory/products/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /inventory/suppliers",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"address\": \"\",\n  \"code\": \"\",\n  \"contact_person\": \"\",\n  \"email\": \"\",\n  \"lead_days\": 0,\n  \"name\": \"\",\n  \"payment_terms\": \"\",\n  \"phone\": \"\",\n  \"tin\": \"\"\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "suppliers"
              ],
              "raw": "{{base_url}}/api/v1/inventory/suppliers"
            }
          }
        },
        {
          "name": "PUT /inventory/suppliers/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"address\": \"\",\n  \"code\": \"\",\n  \"contact_person\": \"\",\n  \"email\": \"\",\n  \"lead_days\": 0,\n  \"name\": \"\",\n  \"payment_terms\": \"\",\n  \"phone\": \"\",\n  \"tin\": \"\"\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "suppliers",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/inventory/suppliers/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /inventory/receipts",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"batch_number\": \"\",\n  \"expiry_date\": \"\",\n  \"location_id\": \"\",\n  \"product_code\": \"\",\n  \"product_id\": \"\",\n  \"quantity\": 0,\n  \"supplier_id\": \"\",\n  \"unit_cost\": 0\n}"
            },
            "description": "**Permission:** `stock:receive`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "receipts"
              ],
              "raw": "{{base_url}}/api/v1/inventory/receipts"
            }
          }
        },
        {
          "name": "POST /inventory/movements",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"batch_id\": \"\",\n  \"issued_to\": \"\",\n  \"kind\": \"\",\n  \"quantity\": 0,\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `stock:issue`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "movements"
              ],
              "raw": "{{base_url}}/api/v1/inventory/movements"
            }
          }
        },
        {
          "name": "POST /inventory/batches/:id/quarantine",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `stock:issue`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "batches",
                ":id",
                "quarantine"
              ],
              "raw": "{{base_url}}/api/v1/inventory/batches/:id/quarantine",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /inventory/settings",
          "request": {
            "description": "**From the router:** The catalogue's own lists. One endpoint keyed on `:kind`, the same shape the HR catalogues use — three near-identical endpoints is three places to fix the next time a list gains a column. `/settings/adopt` is registered BEFORE `/settings/:kind`, or the wildcard swallows it and \"adopt\" is read as the name of a list.\n\n**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "settings"
              ],
              "raw": "{{base_url}}/api/v1/inventory/settings"
            }
          }
        },
        {
          "name": "POST /inventory/settings/adopt",
          "request": {
            "description": "SAFE TO RUN TWICE, and the answer says why: it reports what it created and what it found already there. It only ever adds — nothing existing is renamed, reparented or retired.\n\n`kind` scopes it to one list, because the button lives on each list's own screen and one on the Units page that silently writes fifteen categories is a button people stop pressing.\n\n**Permission:** `inventory:manage`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "settings",
                "adopt"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "kind",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inventory/settings/adopt?kind="
            }
          }
        },
        {
          "name": "GET /inventory/settings/:kind",
          "request": {
            "description": "**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "settings",
                ":kind"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "inactive",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "page",
                  "value": "1"
                },
                {
                  "description": "Capped at 200. `page_size` is accepted as an alias.",
                  "disabled": true,
                  "key": "per_page",
                  "value": "50"
                },
                {
                  "description": "Free-text filter.",
                  "disabled": true,
                  "key": "search",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inventory/settings/:kind?inactive=\u0026page=1\u0026per_page=50\u0026search=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /inventory/settings/:kind",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"base_unit_id\": \"\",\n  \"code\": \"\",\n  \"factor\": 0,\n  \"manufacturer\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"parent_id\": \"\"\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "settings",
                ":kind"
              ],
              "raw": "{{base_url}}/api/v1/inventory/settings/:kind",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /inventory/settings/:kind/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"base_unit_id\": \"\",\n  \"code\": \"\",\n  \"factor\": 0,\n  \"manufacturer\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"parent_id\": \"\"\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "settings",
                ":kind",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/inventory/settings/:kind/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /inventory/settings/:kind/:id",
          "request": {
            "description": "Not a delete: a product filed under a category that no longer exists is a product nobody can explain.\n\n**Permission:** `inventory:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "settings",
                ":kind",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/inventory/settings/:kind/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /inventory/preferences",
          "request": {
            "description": "**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "preferences"
              ],
              "raw": "{{base_url}}/api/v1/inventory/preferences"
            }
          }
        },
        {
          "name": "PUT /inventory/preferences",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code_prefix\": \"\",\n  \"default_unit_id\": \"\",\n  \"require_brand\": false,\n  \"require_category\": false\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "preferences"
              ],
              "raw": "{{base_url}}/api/v1/inventory/preferences"
            }
          }
        },
        {
          "name": "GET /inventory/products/:id/variants",
          "request": {
            "description": "**Permission:** `inventory:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "products",
                ":id",
                "variants"
              ],
              "raw": "{{base_url}}/api/v1/inventory/products/:id/variants",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /inventory/products/:id/variants",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"code\": \"\",\n  \"name\": \"\",\n  \"reorder_level\": 0,\n  \"sale_price\": 0,\n  \"unit_id\": \"\",\n  \"variant_attributes\": {}\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "products",
                ":id",
                "variants"
              ],
              "raw": "{{base_url}}/api/v1/inventory/products/:id/variants",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /inventory/variants/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"code\": \"\",\n  \"name\": \"\",\n  \"reorder_level\": 0,\n  \"sale_price\": 0,\n  \"unit_id\": \"\",\n  \"variant_attributes\": {}\n}"
            },
            "description": "**Permission:** `inventory:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inventory",
                "variants",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/inventory/variants/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Stock and the store · Bidhaa na ghala"
    },
    {
      "description": "The pharmacy counter. Prescribing and dispensing are different people doing different things. A clinician writes; a pharmacist hands over and the stock leaves the shelf in the same transaction.",
      "item": [
        {
          "name": "GET /pharmacy/prescriptions",
          "request": {
            "description": "**Permission:** `prescription:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "pharmacy",
                "prescriptions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "pending",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/pharmacy/prescriptions?limit=100\u0026pending=\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /pharmacy/prescriptions/:id",
          "request": {
            "description": "**Permission:** `prescription:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "pharmacy",
                "prescriptions",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/pharmacy/prescriptions/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /pharmacy/prescriptions",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"items\": [\n    {\n      \"code\": \"\",\n      \"dose\": \"\",\n      \"duration\": \"\",\n      \"frequency\": \"\",\n      \"instructions\": \"\",\n      \"name\": \"\",\n      \"product_id\": \"\",\n      \"quantity\": 0,\n      \"route\": \"\"\n    }\n  ],\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `prescription:write`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "pharmacy",
                "prescriptions"
              ],
              "raw": "{{base_url}}/api/v1/pharmacy/prescriptions"
            }
          }
        },
        {
          "name": "POST /pharmacy/prescriptions/:id/cancel",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `prescription:write`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "pharmacy",
                "prescriptions",
                ":id",
                "cancel"
              ],
              "raw": "{{base_url}}/api/v1/pharmacy/prescriptions/:id/cancel",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /pharmacy/prescriptions/:id/dispense",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"lines\": [\n    {\n      \"batch_id\": \"\",\n      \"item_id\": \"\",\n      \"quantity\": 0\n    }\n  ]\n}"
            },
            "description": "**Permission:** `dispense:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "pharmacy",
                "prescriptions",
                ":id",
                "dispense"
              ],
              "raw": "{{base_url}}/api/v1/pharmacy/prescriptions/:id/dispense",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Pharmacy counter · Dawa na utoaji"
    },
    {
      "description": "Inpatient: wards, beds and admissions. Signing a discharge summary is its own permission. A ward clerk types the summary; a clinician signs it. One permission for both would make the signature meaningless.",
      "item": [
        {
          "name": "GET /inpatient/wards",
          "request": {
            "description": "**Permission:** `ward:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "wards"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inpatient/wards?facility_id="
            }
          }
        },
        {
          "name": "GET /inpatient/beds",
          "request": {
            "description": "**Permission:** `ward:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "beds"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "ward_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inpatient/beds?ward_id="
            }
          }
        },
        {
          "name": "GET /inpatient/summary",
          "request": {
            "description": "**Permission:** `ward:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/summary"
            }
          }
        },
        {
          "name": "POST /inpatient/wards",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"daily_rate\": 0,\n  \"kind\": \"\",\n  \"location_id\": \"\",\n  \"name\": \"\",\n  \"sex_restriction\": \"\",\n  \"status\": \"\",\n  \"tariff_code\": \"\"\n}"
            },
            "description": "**Permission:** `ward:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "wards"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inpatient/wards?facility_id="
            }
          }
        },
        {
          "name": "PUT /inpatient/wards/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"daily_rate\": 0,\n  \"kind\": \"\",\n  \"location_id\": \"\",\n  \"name\": \"\",\n  \"sex_restriction\": \"\",\n  \"status\": \"\",\n  \"tariff_code\": \"\"\n}"
            },
            "description": "**Permission:** `ward:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "wards",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inpatient/wards/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /inpatient/wards/:id/beds",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"label\": \"\",\n  \"status\": \"\",\n  \"status_reason\": \"\"\n}"
            },
            "description": "**Permission:** `ward:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "wards",
                ":id",
                "beds"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/wards/:id/beds",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /inpatient/beds/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"label\": \"\",\n  \"status\": \"\",\n  \"status_reason\": \"\"\n}"
            },
            "description": "**Permission:** `ward:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "beds",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/beds/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /inpatient/admissions",
          "request": {
            "description": "**Permission:** `admission:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "admissions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "ward_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/inpatient/admissions?limit=100\u0026search=\u0026status=\u0026ward_id="
            }
          }
        },
        {
          "name": "GET /inpatient/admissions/:id",
          "request": {
            "description": "**Permission:** `admission:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "admissions",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/admissions/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /inpatient/admissions/:id/journey",
          "request": {
            "description": "Asked after an infection is traced: \"which bed was she in on the 14th\".\n\n**Permission:** `admission:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "admissions",
                ":id",
                "journey"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/admissions/:id/journey",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /inpatient/admissions",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bed_id\": \"\",\n  \"consultant_name\": \"\",\n  \"diagnosis\": \"\",\n  \"patient_id\": \"\",\n  \"reason\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `admission:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "admissions"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/admissions"
            }
          }
        },
        {
          "name": "POST /inpatient/admissions/:id/transfer",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bed_id\": \"\",\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `admission:update`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "admissions",
                ":id",
                "transfer"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/admissions/:id/transfer",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /inpatient/admissions/:id/summary",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"summary\": \"\"\n}"
            },
            "description": "**Permission:** `admission:update`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "admissions",
                ":id",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/admissions/:id/summary",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /inpatient/admissions/:id/discharge",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"summary\": \"\",\n  \"type\": \"\"\n}"
            },
            "description": "**Permission:** `admission:discharge`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "admissions",
                ":id",
                "discharge"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/admissions/:id/discharge",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /inpatient/admissions/:id/sign",
          "request": {
            "description": "Its own permission: a ward clerk types the summary, a clinician signs it. One permission for both would make the signature meaningless.\n\n**Permission:** `admission:sign`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "inpatient",
                "admissions",
                ":id",
                "sign"
              ],
              "raw": "{{base_url}}/api/v1/inpatient/admissions/:id/sign",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Wards and admissions · Wodi na kulazwa"
    },
    {
      "description": "The clinical floor. Triage and treatment are separate permissions because they are done by different people at different moments: a nurse categorises at the door, a clinician treats inside. Collapsing them would mean either a triage nurse who can write treatment, or a doctor who cannot re-categorise somebody who has deteriorated in the waiting room.",
      "item": [
        {
          "name": "POST /clinical/assist",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"ageYears\": 0,\n  \"allergies\": [\n    \"\"\n  ],\n  \"chiefComplaint\": \"\",\n  \"examination\": \"\",\n  \"historyOfPresentIllness\": \"\",\n  \"knownConditions\": [\n    \"\"\n  ],\n  \"pregnant\": false,\n  \"sex\": \"\",\n  \"vitals\": {\n    \"diastolic\": 0,\n    \"heartRate\": 0,\n    \"oxygenSaturation\": 0,\n    \"respiratoryRate\": 0,\n    \"systolic\": 0,\n    \"temperature\": 0\n  }\n}"
            },
            "description": "Gated on prescription:write — the permission held by people who write up a consultation. Reading a differential is part of writing one up, and giving it its own permission would mean an administrator has to grant a second thing before the panel a clinician already has appears.\n\n**From the router:** The clinical assistant. Gated on the permission held by whoever writes up a consultation — reading a differential is part of writing one, and a permission of its own would mean an administrator has to grant a second thing before a panel the clinician already has appears.\n\n**Permission:** `prescription:write`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "assist"
              ],
              "raw": "{{base_url}}/api/v1/clinical/assist"
            }
          }
        },
        {
          "name": "GET /clinical/summary",
          "request": {
            "description": "**Permission:** `nursing:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/clinical/summary"
            }
          }
        },
        {
          "name": "GET /clinical/appointments",
          "request": {
            "description": "**Permission:** `appointment:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "appointments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "department",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/clinical/appointments?date=\u0026department=\u0026limit=200\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "POST /clinical/appointments",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"clinician_id\": \"\",\n  \"clinician_name\": \"\",\n  \"department\": \"\",\n  \"duration_min\": 0,\n  \"kind\": \"\",\n  \"location_id\": \"\",\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"reason\": \"\",\n  \"scheduled_for\": \"\"\n}"
            },
            "description": "**Permission:** `appointment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "appointments"
              ],
              "raw": "{{base_url}}/api/v1/clinical/appointments"
            }
          }
        },
        {
          "name": "POST /clinical/appointments/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `appointment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "appointments",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/clinical/appointments/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /clinical/appointments/:id/reschedule",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"scheduled_for\": \"\"\n}"
            },
            "description": "**Permission:** `appointment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "appointments",
                ":id",
                "reschedule"
              ],
              "raw": "{{base_url}}/api/v1/clinical/appointments/:id/reschedule",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /clinical/emergency",
          "request": {
            "description": "**Permission:** `emergency:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "emergency"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "open",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/clinical/emergency?limit=100\u0026open="
            }
          }
        },
        {
          "name": "POST /clinical/emergency",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"arrival_mode\": \"\",\n  \"brought_by\": \"\",\n  \"category\": \"\",\n  \"patient_id\": \"\",\n  \"presenting_complaint\": \"\",\n  \"triage_category\": 0,\n  \"unknown_label\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `emergency:triage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "emergency"
              ],
              "raw": "{{base_url}}/api/v1/clinical/emergency"
            }
          }
        },
        {
          "name": "POST /clinical/emergency/:id/triage",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"category\": 0,\n  \"complaint\": \"\"\n}"
            },
            "description": "**Permission:** `emergency:triage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "emergency",
                ":id",
                "triage"
              ],
              "raw": "{{base_url}}/api/v1/clinical/emergency/:id/triage",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /clinical/emergency/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"note\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `emergency:treat`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "emergency",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/clinical/emergency/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /clinical/tasks",
          "request": {
            "description": "**Permission:** `nursing:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "tasks"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "admission_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "due",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/clinical/tasks?admission_id=\u0026due=\u0026limit=200\u0026status="
            }
          }
        },
        {
          "name": "POST /clinical/tasks",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"admission_id\": \"\",\n  \"category\": \"\",\n  \"due_at\": \"\",\n  \"every_hours\": 0,\n  \"instructions\": \"\",\n  \"patient_id\": \"\",\n  \"task\": \"\"\n}"
            },
            "description": "**Permission:** `nursing:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "tasks"
              ],
              "raw": "{{base_url}}/api/v1/clinical/tasks"
            }
          }
        },
        {
          "name": "POST /clinical/tasks/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"notes\": \"\",\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `nursing:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "tasks",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/clinical/tasks/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /clinical/doses",
          "request": {
            "description": "**Permission:** `nursing:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "doses"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "admission_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "due",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/clinical/doses?admission_id=\u0026due=\u0026limit=200\u0026status="
            }
          }
        },
        {
          "name": "POST /clinical/doses",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"admission_id\": \"\",\n  \"dose\": \"\",\n  \"due_at\": \"\",\n  \"medicine\": \"\",\n  \"patient_id\": \"\",\n  \"prescription_item_id\": \"\",\n  \"route\": \"\"\n}"
            },
            "description": "**Permission:** `nursing:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "doses"
              ],
              "raw": "{{base_url}}/api/v1/clinical/doses"
            }
          }
        },
        {
          "name": "POST /clinical/doses/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"notes\": \"\",\n  \"reason\": \"\",\n  \"status\": \"\",\n  \"witness\": \"\"\n}"
            },
            "description": "**Permission:** `nursing:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "doses",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/clinical/doses/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /clinical/referrals",
          "request": {
            "description": "**Permission:** `referral:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "referrals"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "direction",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/clinical/referrals?direction=\u0026limit=100\u0026status="
            }
          }
        },
        {
          "name": "POST /clinical/referrals",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"clinical_summary\": \"\",\n  \"contact\": \"\",\n  \"department\": \"\",\n  \"direction\": \"\",\n  \"facility\": \"\",\n  \"patient_id\": \"\",\n  \"reason\": \"\",\n  \"urgency\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `referral:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "referrals"
              ],
              "raw": "{{base_url}}/api/v1/clinical/referrals"
            }
          }
        },
        {
          "name": "POST /clinical/referrals/:id/advance",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"feedback\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `referral:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "referrals",
                ":id",
                "advance"
              ],
              "raw": "{{base_url}}/api/v1/clinical/referrals/:id/advance",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /clinical/records",
          "request": {
            "description": "**Permission:** `record:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "records"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "kind",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "notifiable",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/clinical/records?kind=\u0026limit=100\u0026notifiable=\u0026patient_id=\u0026search="
            }
          }
        },
        {
          "name": "POST /clinical/records",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"admission_id\": \"\",\n  \"body\": \"\",\n  \"code\": \"\",\n  \"coding_system\": \"\",\n  \"kind\": \"\",\n  \"notifiable\": false,\n  \"patient_id\": \"\",\n  \"rank\": \"\",\n  \"title\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**From the router:** Coding is a records-office job with reporting consequences: a notifiable condition entered here goes onto a weekly return.\n\n**Permission:** `record:code`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "clinical",
                "records"
              ],
              "raw": "{{base_url}}/api/v1/clinical/records"
            }
          }
        }
      ],
      "name": "Clinical floor · Huduma za kliniki"
    },
    {
      "description": "The operating theatre. There is deliberately no permission for CLOSING an operation. It is gated on whether the checklist is complete and the counts balance, and the database refuses regardless of who is asking — a stronger control than a role, and one that cannot be worked around by somebody senior enough. Behind the module as well as the permission: a branch that has told the system it has no operating theatre should not be able to schedule a surgery into it from a saved address.",
      "item": [
        {
          "name": "GET /theatre/rooms",
          "request": {
            "description": "**Permission:** `theatre:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "rooms"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/theatre/rooms?facility_id="
            }
          }
        },
        {
          "name": "GET /theatre/list",
          "request": {
            "description": "**Permission:** `theatre:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "list"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/theatre/list?date=\u0026limit=100\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /theatre/summary",
          "request": {
            "description": "**Permission:** `theatre:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/theatre/summary"
            }
          }
        },
        {
          "name": "GET /theatre/surgeries/:id",
          "request": {
            "description": "**Permission:** `theatre:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "surgeries",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/theatre/surgeries/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /theatre/rooms",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"kind\": \"\",\n  \"location_id\": \"\",\n  \"name\": \"\",\n  \"status\": \"\",\n  \"status_reason\": \"\"\n}"
            },
            "description": "**Permission:** `theatre:schedule`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "rooms"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/theatre/rooms?facility_id="
            }
          }
        },
        {
          "name": "PUT /theatre/rooms/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"kind\": \"\",\n  \"location_id\": \"\",\n  \"name\": \"\",\n  \"status\": \"\",\n  \"status_reason\": \"\"\n}"
            },
            "description": "**Permission:** `theatre:schedule`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "rooms",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/theatre/rooms/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /theatre/surgeries",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"admission_id\": \"\",\n  \"anaesthesia\": \"\",\n  \"anaesthetist_name\": \"\",\n  \"indication\": \"\",\n  \"laterality\": \"\",\n  \"patient_id\": \"\",\n  \"planned_minutes\": 0,\n  \"procedure_code\": \"\",\n  \"procedure_name\": \"\",\n  \"room_id\": \"\",\n  \"scheduled_for\": \"\",\n  \"surgeon_name\": \"\",\n  \"urgency\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `theatre:schedule`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "surgeries"
              ],
              "raw": "{{base_url}}/api/v1/theatre/surgeries"
            }
          }
        },
        {
          "name": "POST /theatre/surgeries/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `theatre:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "surgeries",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/theatre/surgeries/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /theatre/surgeries/:id/checklist",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"by\": \"\",\n  \"count_discrepancy_note\": \"\",\n  \"instruments_in\": 0,\n  \"instruments_out\": 0,\n  \"stage\": \"\",\n  \"swabs_in\": 0,\n  \"swabs_out\": 0\n}"
            },
            "description": "**Permission:** `theatre:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "surgeries",
                ":id",
                "checklist"
              ],
              "raw": "{{base_url}}/api/v1/theatre/surgeries/:id/checklist",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /theatre/surgeries/:id/outcome",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"blood_loss_ml\": 0,\n  \"complications\": \"\",\n  \"findings\": \"\",\n  \"outcome\": \"\",\n  \"specimen_taken\": false\n}"
            },
            "description": "**Permission:** `theatre:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "surgeries",
                ":id",
                "outcome"
              ],
              "raw": "{{base_url}}/api/v1/theatre/surgeries/:id/outcome",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /theatre/surgeries/:id/team",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"name\": \"\",\n  \"role\": \"\"\n}"
            },
            "description": "**Permission:** `theatre:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `theatre`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "theatre",
                "surgeries",
                ":id",
                "team"
              ],
              "raw": "{{base_url}}/api/v1/theatre/surgeries/:id/team",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Operating theatre · Chumba cha upasuaji"
    },
    {
      "description": "Reproductive and child health. Every service here is a schedule somebody can fall off, so every list takes ?overdue=true and the defaulter list is one query rather than a report somebody has to remember to run. `rch:record` is separate from `rch:manage`: the person who weighs a baby and gives the dose is not usually the person who books a pregnancy or edits the immunisation schedule — and every due date in the register is generated from that schedule, so an accidental edit moves everybody. One gate for the whole register, listing every menu entry it serves: the request does not say which screen the caller came from, so this closes only for a branch that has switched off ALL of maternal and child health. Switching off deliveries alone still leaves antenatal working, which is the point.",
      "item": [
        {
          "name": "GET /rch/summary",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/rch/summary"
            }
          }
        },
        {
          "name": "GET /rch/anc",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "anc"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "overdue",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/rch/anc?limit=100\u0026overdue=\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /rch/anc/:id",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "anc",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/rch/anc/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /rch/anc",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"edd\": \"\",\n  \"gravida\": 0,\n  \"high_risk\": false,\n  \"lmp\": \"\",\n  \"para\": 0,\n  \"patient_id\": \"\",\n  \"risk_factors\": [\n    \"\"\n  ]\n}"
            },
            "description": "**Permission:** `rch:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "anc"
              ],
              "raw": "{{base_url}}/api/v1/rch/anc"
            }
          }
        },
        {
          "name": "POST /rch/anc/:id/close",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `rch:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "anc",
                ":id",
                "close"
              ],
              "raw": "{{base_url}}/api/v1/rch/anc/:id/close",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /rch/anc/:id/visits/:visit",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bp_diastolic\": 0,\n  \"bp_systolic\": 0,\n  \"danger_signs\": [\n    \"\"\n  ],\n  \"foetal_heart_rate\": 0,\n  \"fundal_height_cm\": 0,\n  \"gestation_weeks\": 0,\n  \"haemoglobin\": 0,\n  \"hiv_tested\": false,\n  \"iptp_given\": false,\n  \"iron_folate\": false,\n  \"llin_given\": false,\n  \"notes\": \"\",\n  \"seen_by\": \"\",\n  \"syphilis_tested\": false,\n  \"tt_given\": false,\n  \"weight_kg\": 0\n}"
            },
            "description": "**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "anc",
                ":id",
                "visits",
                ":visit"
              ],
              "raw": "{{base_url}}/api/v1/rch/anc/:id/visits/:visit",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "visit",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /rch/deliveries",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "deliveries"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/rch/deliveries?limit=100\u0026status="
            }
          }
        },
        {
          "name": "POST /rch/deliveries",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"anc_id\": \"\",\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"place\": \"\"\n}"
            },
            "description": "**Permission:** `rch:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "deliveries"
              ],
              "raw": "{{base_url}}/api/v1/rch/deliveries"
            }
          }
        },
        {
          "name": "POST /rch/deliveries/:id/births",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"apgar_1\": 0,\n  \"apgar_5\": 0,\n  \"bcg_given\": false,\n  \"breastfed_within_hour\": false,\n  \"notes\": \"\",\n  \"outcome\": \"\",\n  \"polio_0\": false,\n  \"resuscitated\": false,\n  \"sex\": \"\",\n  \"vitamin_k\": false,\n  \"weight_g\": 0\n}"
            },
            "description": "A twin delivery is two calls. One record with \"twins\" written on it cannot give the second twin an Apgar score of its own.\n\n**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "deliveries",
                ":id",
                "births"
              ],
              "raw": "{{base_url}}/api/v1/rch/deliveries/:id/births",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /rch/deliveries/:id/outcome",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"blood_loss_ml\": 0,\n  \"conducted_by\": \"\",\n  \"mode\": \"\",\n  \"mother_complications\": [\n    \"\"\n  ],\n  \"mother_outcome\": \"\",\n  \"notes\": \"\"\n}"
            },
            "description": "**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "deliveries",
                ":id",
                "outcome"
              ],
              "raw": "{{base_url}}/api/v1/rch/deliveries/:id/outcome",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /rch/pnc",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "pnc"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "overdue",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/rch/pnc?limit=100\u0026overdue=\u0026patient_id="
            }
          }
        },
        {
          "name": "POST /rch/pnc/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"baby_danger_signs\": [\n    \"\"\n  ],\n  \"baby_temp\": 0,\n  \"baby_weight_g\": 0,\n  \"bleeding\": \"\",\n  \"cord_condition\": \"\",\n  \"family_planning_counselled\": false,\n  \"feeding\": \"\",\n  \"mother_bp_diastolic\": 0,\n  \"mother_bp_systolic\": 0,\n  \"mother_danger_signs\": [\n    \"\"\n  ],\n  \"mother_temp\": 0,\n  \"notes\": \"\",\n  \"seen_by\": \"\"\n}"
            },
            "description": "**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "pnc",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/rch/pnc/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /rch/family-planning",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "family-planning"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "overdue",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/rch/family-planning?limit=100\u0026overdue=\u0026status="
            }
          }
        },
        {
          "name": "POST /rch/family-planning",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"counselled_on_alternatives\": false,\n  \"method\": \"\",\n  \"next_due_on\": \"\",\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"removal_due_on\": \"\",\n  \"side_effects\": \"\",\n  \"started_on\": \"\"\n}"
            },
            "description": "**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "family-planning"
              ],
              "raw": "{{base_url}}/api/v1/rch/family-planning"
            }
          }
        },
        {
          "name": "POST /rch/family-planning/:id/resupply",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"next_due_on\": \"\"\n}"
            },
            "description": "**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "family-planning",
                ":id",
                "resupply"
              ],
              "raw": "{{base_url}}/api/v1/rch/family-planning/:id/resupply",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /rch/family-planning/:id/discontinue",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "family-planning",
                ":id",
                "discontinue"
              ],
              "raw": "{{base_url}}/api/v1/rch/family-planning/:id/discontinue",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /rch/immunisation",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "immunisation"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "due",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/rch/immunisation?due=\u0026limit=200\u0026patient_id="
            }
          }
        },
        {
          "name": "GET /rch/immunisation/schedule",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "immunisation",
                "schedule"
              ],
              "raw": "{{base_url}}/api/v1/rch/immunisation/schedule"
            }
          }
        },
        {
          "name": "POST /rch/immunisation/schedule",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"antigen\": \"\",\n  \"counts_for_coverage\": false,\n  \"dose_number\": 0,\n  \"due_weeks\": 0\n}"
            },
            "description": "Behind rch:manage rather than rch:record: every due date in the register is generated from this table, so an accidental edit moves everybody.\n\n**Permission:** `rch:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "immunisation",
                "schedule"
              ],
              "raw": "{{base_url}}/api/v1/rch/immunisation/schedule"
            }
          }
        },
        {
          "name": "POST /rch/immunisation/enrol",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"patient_id\": \"\"\n}"
            },
            "description": "**Permission:** `rch:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "immunisation",
                "enrol"
              ],
              "raw": "{{base_url}}/api/v1/rch/immunisation/enrol"
            }
          }
        },
        {
          "name": "POST /rch/immunisation/:id/give",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"batch_number\": \"\",\n  \"given_by\": \"\",\n  \"not_given_reason\": \"\",\n  \"site\": \"\"\n}"
            },
            "description": "**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "immunisation",
                ":id",
                "give"
              ],
              "raw": "{{base_url}}/api/v1/rch/immunisation/:id/give",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /rch/growth",
          "request": {
            "description": "**Permission:** `rch:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "growth"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "malnourished",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/rch/growth?limit=100\u0026malnourished=\u0026patient_id="
            }
          }
        },
        {
          "name": "POST /rch/growth",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"age_months\": 0,\n  \"height_cm\": 0,\n  \"measured_by\": \"\",\n  \"measured_on\": \"\",\n  \"muac_mm\": 0,\n  \"notes\": \"\",\n  \"oedema\": false,\n  \"patient_id\": \"\",\n  \"weight_kg\": 0\n}"
            },
            "description": "**Permission:** `rch:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `anc`, `delivery`, `pnc`, `family-planning`, `immunization`, `growth`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "rch",
                "growth"
              ],
              "raw": "{{base_url}}/api/v1/rch/growth"
            }
          }
        }
      ],
      "name": "Reproductive and child health · Afya ya uzazi na mtoto"
    },
    {
      "description": "Programme clinics. TB, HIV care and treatment, and non-communicable disease share one set of routes: they differ in vocabulary, not in shape, and three copies would be three defaulter queries to get subtly different. Closing is behind `program:manage` rather than `program:record` because the outcome IS the cohort report — \"cured\" and \"lost to follow-up\" are the numbers the programme is judged on nationally. TB and HIV care run at DESIGNATED sites, so both are off until a branch says it is one. NCD is not — diabetes and hypertension follow-up happens everywhere — which is why one entry keeps this group open.",
      "item": [
        {
          "name": "GET /programs/summary",
          "request": {
            "description": "**Permission:** `program:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `tb`, `ctc`, `ncd`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "programs",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/programs/summary"
            }
          }
        },
        {
          "name": "GET /programs/enrolments",
          "request": {
            "description": "**Permission:** `program:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `tb`, `ctc`, `ncd`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "programs",
                "enrolments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "overdue",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "program",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/programs/enrolments?limit=100\u0026overdue=\u0026program=\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /programs/enrolments/:id",
          "request": {
            "description": "**Permission:** `program:read`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `tb`, `ctc`, `ncd`.",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "programs",
                "enrolments",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/programs/enrolments/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /programs/enrolments",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"diagnosis\": \"\",\n  \"enrolled_on\": \"\",\n  \"next_appointment\": \"\",\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"phase\": \"\",\n  \"program\": \"\",\n  \"regimen\": \"\",\n  \"transferred_from\": \"\",\n  \"transferred_in\": false\n}"
            },
            "description": "**Permission:** `program:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `tb`, `ctc`, `ncd`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "programs",
                "enrolments"
              ],
              "raw": "{{base_url}}/api/v1/programs/enrolments"
            }
          }
        },
        {
          "name": "PUT /programs/enrolments/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"diagnosis\": \"\",\n  \"enrolled_on\": \"\",\n  \"next_appointment\": \"\",\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"phase\": \"\",\n  \"program\": \"\",\n  \"regimen\": \"\",\n  \"transferred_from\": \"\",\n  \"transferred_in\": false\n}"
            },
            "description": "**Permission:** `program:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `tb`, `ctc`, `ncd`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "programs",
                "enrolments",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/programs/enrolments/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /programs/enrolments/:id/close",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"note\": \"\",\n  \"outcome\": \"\"\n}"
            },
            "description": "The database refuses a close without an outcome. An enrolment that just stops has silently become \"lost to follow-up\" without anybody deciding it.\n\n**Permission:** `program:manage`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `tb`, `ctc`, `ncd`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "programs",
                "enrolments",
                ":id",
                "close"
              ],
              "raw": "{{base_url}}/api/v1/programs/enrolments/:id/close",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /programs/enrolments/:id/visits",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"attended\": false,\n  \"doses_dispensed\": 0,\n  \"doses_expected\": 0,\n  \"missed_reason\": \"\",\n  \"next_appointment\": \"\",\n  \"notes\": \"\",\n  \"phase\": \"\",\n  \"regimen\": \"\",\n  \"scheduled_on\": \"\",\n  \"seen_by\": \"\",\n  \"weight_kg\": 0\n}"
            },
            "description": "**Permission:** `program:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `tb`, `ctc`, `ncd`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "programs",
                "enrolments",
                ":id",
                "visits"
              ],
              "raw": "{{base_url}}/api/v1/programs/enrolments/:id/visits",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /programs/enrolments/:id/results",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"interpretation\": \"\",\n  \"kind\": \"\",\n  \"measured_on\": \"\",\n  \"notes\": \"\",\n  \"recorded_by\": \"\",\n  \"unit\": \"\",\n  \"value_numeric\": 0,\n  \"value_text\": \"\",\n  \"visit_id\": \"\"\n}"
            },
            "description": "**Permission:** `program:record`\n\n**Module switch:** closed with 403 when the caller's branch has switched off every one of `tb`, `ctc`, `ncd`.",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "programs",
                "enrolments",
                ":id",
                "results"
              ],
              "raw": "{{base_url}}/api/v1/programs/enrolments/:id/results",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Programme clinics · Kliniki za programu"
    },
    {
      "description": "Patient feedback. Reading what patients said and writing the form they say it on are different jobs: one is management, the other is whoever runs quality. There is no route that returns individual responses. On an anonymous form those are the one thing nobody in the hospital should read, and a route for them would be used the week somebody wanted to know who complained.",
      "item": [
        {
          "name": "GET /feedback/forms",
          "request": {
            "description": "**Permission:** `feedback:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "feedback",
                "forms"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/feedback/forms?limit=50\u0026status="
            }
          }
        },
        {
          "name": "GET /feedback/forms/:id",
          "request": {
            "description": "**Permission:** `feedback:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "feedback",
                "forms",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/feedback/forms/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /feedback/forms/:id/results",
          "request": {
            "description": "AGGREGATES ONLY. There is no route here that returns individual responses, and that is deliberate: on an anonymous form the individual answers are the one thing nobody in the hospital should be reading, and a route that returned them would be used the week somebody wanted to know who complained.\n\n**Permission:** `feedback:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "feedback",
                "forms",
                ":id",
                "results"
              ],
              "raw": "{{base_url}}/api/v1/feedback/forms/:id/results",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /feedback/forms",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"anonymous\": false,\n  \"description\": \"\",\n  \"multiple\": false,\n  \"title\": \"\"\n}"
            },
            "description": "**Permission:** `feedback:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "feedback",
                "forms"
              ],
              "raw": "{{base_url}}/api/v1/feedback/forms"
            }
          }
        },
        {
          "name": "POST /feedback/forms/:id/questions",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"description\": \"\",\n  \"id\": \"\",\n  \"label\": \"\",\n  \"options\": [\n    \"\"\n  ],\n  \"position\": 0,\n  \"required\": false,\n  \"type\": \"\"\n}"
            },
            "description": "**Permission:** `feedback:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "feedback",
                "forms",
                ":id",
                "questions"
              ],
              "raw": "{{base_url}}/api/v1/feedback/forms/:id/questions",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /feedback/forms/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `feedback:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "feedback",
                "forms",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/feedback/forms/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Patient feedback · Maoni ya wagonjwa"
    },
    {
      "description": "Human resources. PAYROLL HAS THREE CODES, not one. Seeing what people are paid, building a run and signing it off are three different jobs, and the person who assembles the numbers must not be the person who approves them — that is the whole control. `payroll:read` is the most sensitive read in the API: it is every salary in the hospital. Leave is split the same way for a smaller reason: everybody applies for leave, and almost nobody approves it.",
      "item": [
        {
          "name": "GET /hr/summary",
          "request": {
            "description": "**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "summary"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/summary?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/attendance",
          "request": {
            "description": "**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "attendance"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "department",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/attendance?date=\u0026department=\u0026facility_id=\u0026limit=200\u0026staff_id="
            }
          }
        },
        {
          "name": "GET /hr/attendance/summary",
          "request": {
            "description": "Its own route rather than a figure on the list, because it answers a question the list cannot: eleven people present means nothing until somebody knows whether eighty were expected.\n\n**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "attendance",
                "summary"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "date",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/attendance/summary?date=\u0026facility_id="
            }
          }
        },
        {
          "name": "POST /hr/attendance",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"clock_in\": \"\",\n  \"clock_out\": \"\",\n  \"notes\": \"\",\n  \"reason\": \"\",\n  \"staff_id\": \"\",\n  \"status\": \"\",\n  \"work_date\": \"\"\n}"
            },
            "description": "**Permission:** `hr:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "attendance"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/attendance?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/leave",
          "request": {
            "description": "**Permission:** `leave:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "leave"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/leave?facility_id=\u0026limit=100\u0026staff_id=\u0026status="
            }
          }
        },
        {
          "name": "GET /hr/leave/balances",
          "request": {
            "description": "**Permission:** `leave:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "leave",
                "balances"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "department",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "year",
                  "value": "0"
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/leave/balances?department=\u0026facility_id=\u0026staff_id=\u0026year=0"
            }
          }
        },
        {
          "name": "POST /hr/leave",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"days\": 0,\n  \"ends_on\": \"\",\n  \"handover_to\": \"\",\n  \"leave_type\": \"\",\n  \"reason\": \"\",\n  \"staff_id\": \"\",\n  \"starts_on\": \"\"\n}"
            },
            "description": "**Permission:** `leave:request`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "leave"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/leave?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/leave/entitlements",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"carried_over\": 0,\n  \"days\": 0,\n  \"leave_type\": \"\",\n  \"staff_id\": \"\",\n  \"year\": 0\n}"
            },
            "description": "**Permission:** `leave:approve`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "leave",
                "entitlements"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/leave/entitlements?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/leave/:id/decide",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"note\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "The repository refuses to let anybody approve their own. That is not a permission question — it is the point of an approval.\n\n**Permission:** `leave:approve`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "leave",
                ":id",
                "decide"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/leave/:id/decide?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/roster",
          "request": {
            "description": "**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "roster"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "department",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/roster?department=\u0026facility_id=\u0026from=\u0026to="
            }
          }
        },
        {
          "name": "POST /hr/roster/shifts",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"department\": \"\",\n  \"ends_at\": \"\",\n  \"notes\": \"\",\n  \"required\": 0,\n  \"shift_date\": \"\",\n  \"slot\": \"\",\n  \"starts_at\": \"\"\n}"
            },
            "description": "FOR THAT WEEKDAY, NOT THAT DATE. hr-service keeps the requirement as policy — \"maternity nights need three\" — rather than as a row per date, so a matron declares it once instead of every week. The screen says so.\n\n**Permission:** `hr:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "roster",
                "shifts"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/roster/shifts?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/roster/shifts/:id/assign",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"role\": \"\",\n  \"staff_id\": \"\"\n}"
            },
            "description": "**Permission:** `hr:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "roster",
                "shifts",
                ":id",
                "assign"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/roster/shifts/:id/assign?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/roster/shifts/:id/assign/:staff",
          "request": {
            "description": "**Permission:** `hr:record`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "roster",
                "shifts",
                ":id",
                "assign",
                ":staff"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/roster/shifts/:id/assign/:staff?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "staff",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/payroll",
          "request": {
            "description": "**Permission:** `payroll:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "payroll"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "24"
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/payroll?facility_id=\u0026limit=24"
            }
          }
        },
        {
          "name": "GET /hr/payroll/:id",
          "request": {
            "description": "**Permission:** `payroll:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "payroll",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/payroll/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/payslips",
          "request": {
            "description": "**Permission:** `payroll:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "payslips"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "run_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/payslips?facility_id=\u0026run_id=\u0026staff_id="
            }
          }
        },
        {
          "name": "GET /hr/payslips/:id/pdf",
          "request": {
            "description": "WHOEVER MAY READ PAYROLL MAY PRINT IT. There is no separate print permission, because a payslip on a screen and the same payslip on paper carry exactly the same information — a gate on one and not the other protects nothing and merely stops somebody doing their job at the printer.\n\nIt uses the payment_voucher template, and that is not a compromise: a payslip IS a voucher for a payment, with the gross as lines, the statutory deductions as negative lines, and the net as the amount. Drawing it from the same template as everything else the institution pays out means one letterhead, one signature block, and one place to change them.\n\n**From the router:** The payslip on paper. Same permission as the payslip on a screen: they carry identical information, and gating one and not the other protects nothing while stopping somebody at the printer.\n\n**Permission:** `payroll:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "payslips",
                ":id",
                "pdf"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/payslips/:id/pdf?facility_id=\u0026language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /hr/payroll",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"month\": 0,\n  \"year\": 0\n}"
            },
            "description": "**Permission:** `payroll:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "payroll"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/payroll?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/payroll/:id/compute",
          "request": {
            "description": "SAFE TO PRESS TWICE. Each computation undoes the previous one -- including the instalments it took off everybody's salary advances -- which is the whole reason this is a service's job and not a screen's.\n\n**Permission:** `payroll:manage`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "payroll",
                ":id",
                "compute"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/payroll/:id/compute?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /hr/payroll/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `payroll:approve`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "payroll",
                ":id",
                "status"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/payroll/:id/status?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/salaries",
          "request": {
            "description": "Behind `payroll:read`, which is the most sensitive read in the system: it is every salary in the hospital on one screen.\n\n**From the router:** What people are paid, and the table it is taxed by. Both are `payroll:manage`: they are what a run is BUILT from, and the person who builds a run is not the person who signs it off.\n\n**Permission:** `payroll:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "salaries"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/salaries?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/salaries",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"basic_salary\": 0,\n  \"effective_from\": \"\",\n  \"reason\": \"\",\n  \"staff_id\": \"\"\n}"
            },
            "description": "A REASON IS REQUIRED. It is the question every HR manager is asked about a salary they did not set, and nothing else on the record can answer it.\n\n**Permission:** `payroll:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "salaries"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/salaries?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/tax-bands",
          "request": {
            "description": "AN EMPTY TABLE IS A REAL ANSWER, not a fault. No deployment ships with tax rates -- they are set by law and changed by budget speeches -- so an empty list means this year's have not been entered, and the payroll run says so in words the person approving it will read.\n\n**Permission:** `payroll:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "tax-bands"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/tax-bands?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/tax-bands",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bands\": [\n    {\n      \"description\": \"\",\n      \"effective_from\": \"\",\n      \"fixed_amount\": 0,\n      \"id\": \"\",\n      \"lower_bound\": 0,\n      \"rate\": 0,\n      \"upper_bound\": 0\n    }\n  ],\n  \"effective_from\": \"\"\n}"
            },
            "description": "THE WHOLE TABLE AT ONCE. The bands only make sense together, and a table half-way between last year's and this year's computes a figure that was never lawful in either. The old table is not deleted: it stays in force up to the day before, which is what lets a re-computed March run produce March's tax.\n\n**Permission:** `payroll:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "tax-bands"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/tax-bands?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/vacancies",
          "request": {
            "description": "**Permission:** `recruitment:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "vacancies"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/vacancies?limit=100\u0026status="
            }
          }
        },
        {
          "name": "GET /hr/applicants",
          "request": {
            "description": "**Permission:** `recruitment:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "applicants"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "stage",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "vacancy_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/applicants?limit=200\u0026stage=\u0026vacancy_id="
            }
          }
        },
        {
          "name": "POST /hr/vacancies",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"applied\": 0,\n  \"cadre\": \"\",\n  \"close_reason\": \"\",\n  \"closes_on\": \"\",\n  \"days_open\": 0,\n  \"department\": \"\",\n  \"description\": \"\",\n  \"employment_type\": \"\",\n  \"hired\": 0,\n  \"id\": \"\",\n  \"interviewed\": 0,\n  \"job_title\": \"\",\n  \"offered\": 0,\n  \"positions\": 0,\n  \"posted_on\": \"\",\n  \"reference\": \"\",\n  \"rejected\": 0,\n  \"requirements\": \"\",\n  \"shortlisted\": 0,\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `recruitment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "vacancies"
              ],
              "raw": "{{base_url}}/api/v1/hr/vacancies"
            }
          }
        },
        {
          "name": "PUT /hr/vacancies/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"applied\": 0,\n  \"cadre\": \"\",\n  \"close_reason\": \"\",\n  \"closes_on\": \"\",\n  \"days_open\": 0,\n  \"department\": \"\",\n  \"description\": \"\",\n  \"employment_type\": \"\",\n  \"hired\": 0,\n  \"id\": \"\",\n  \"interviewed\": 0,\n  \"job_title\": \"\",\n  \"offered\": 0,\n  \"positions\": 0,\n  \"posted_on\": \"\",\n  \"reference\": \"\",\n  \"rejected\": 0,\n  \"requirements\": \"\",\n  \"shortlisted\": 0,\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `recruitment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "vacancies",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/hr/vacancies/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /hr/vacancies/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `recruitment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "vacancies",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/hr/vacancies/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /hr/applicants",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"created_at\": \"\",\n  \"cv_url\": \"\",\n  \"email\": \"\",\n  \"full_name\": \"\",\n  \"id\": \"\",\n  \"interviewed_on\": \"\",\n  \"phone\": \"\",\n  \"qualification\": \"\",\n  \"score\": 0,\n  \"staff_id\": \"\",\n  \"stage\": \"\",\n  \"stage_note\": \"\",\n  \"vacancy_id\": \"\",\n  \"vacancy_title\": \"\",\n  \"years_experience\": 0\n}"
            },
            "description": "**Permission:** `recruitment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "applicants"
              ],
              "raw": "{{base_url}}/api/v1/hr/applicants"
            }
          }
        },
        {
          "name": "POST /hr/applicants/:id/stage",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"note\": \"\",\n  \"score\": 0,\n  \"stage\": \"\"\n}"
            },
            "description": "**Permission:** `recruitment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "applicants",
                ":id",
                "stage"
              ],
              "raw": "{{base_url}}/api/v1/hr/applicants/:id/stage",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/training",
          "request": {
            "description": "**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "training"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "expiring",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "mandatory",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/training?expiring=\u0026limit=200\u0026mandatory=\u0026staff_id="
            }
          }
        },
        {
          "name": "POST /hr/training",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"certificate_url\": \"\",\n  \"completed_on\": \"\",\n  \"course\": \"\",\n  \"cpd_points\": 0,\n  \"days_to_expiry\": 0,\n  \"department\": \"\",\n  \"expires_on\": \"\",\n  \"id\": \"\",\n  \"mandatory\": false,\n  \"notes\": \"\",\n  \"provider\": \"\",\n  \"staff_id\": \"\",\n  \"staff_name\": \"\",\n  \"staff_number\": \"\"\n}"
            },
            "description": "**Permission:** `hr:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "training"
              ],
              "raw": "{{base_url}}/api/v1/hr/training"
            }
          }
        },
        {
          "name": "PUT /hr/training/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"certificate_url\": \"\",\n  \"completed_on\": \"\",\n  \"course\": \"\",\n  \"cpd_points\": 0,\n  \"days_to_expiry\": 0,\n  \"department\": \"\",\n  \"expires_on\": \"\",\n  \"id\": \"\",\n  \"mandatory\": false,\n  \"notes\": \"\",\n  \"provider\": \"\",\n  \"staff_id\": \"\",\n  \"staff_name\": \"\",\n  \"staff_number\": \"\"\n}"
            },
            "description": "**Permission:** `hr:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "training",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/hr/training/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/departments",
          "request": {
            "description": "**From the router:** The establishment. The employing departments, the posts inside them and the pay bands those posts sit on. All three come from hr-service, which owns them because a payroll run is grouped by them. These are gated on `department:*` and `position:*` rather than on `hr:read`, because picking a post from a dropdown and inventing a post are different acts: one is done by anybody filling in a transfer form, the other commits a salary the budget carries.\n\n**Permission:** `department:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "departments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/departments?facility_id=\u0026status="
            }
          }
        },
        {
          "name": "POST /hr/departments",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"description\": \"\",\n  \"manager_id\": \"\",\n  \"name\": \"\",\n  \"parent_id\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `department:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "departments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/departments?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/departments/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"description\": \"\",\n  \"manager_id\": \"\",\n  \"name\": \"\",\n  \"parent_id\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `department:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "departments",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/departments/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/departments/:id",
          "request": {
            "description": "**Permission:** `department:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "departments",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/departments/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/positions",
          "request": {
            "description": "**Permission:** `position:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "positions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "department_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "vacant",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/positions?department_id=\u0026facility_id=\u0026status=\u0026vacant="
            }
          }
        },
        {
          "name": "POST /hr/positions",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"currency\": \"\",\n  \"default_role_code\": \"\",\n  \"department_id\": \"\",\n  \"description\": \"\",\n  \"headcount_limit\": 0,\n  \"level\": 0,\n  \"max_salary\": \"\",\n  \"min_salary\": \"\",\n  \"name\": \"\",\n  \"requires_system_access\": false,\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `position:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "positions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/positions?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/positions/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"currency\": \"\",\n  \"default_role_code\": \"\",\n  \"department_id\": \"\",\n  \"description\": \"\",\n  \"headcount_limit\": 0,\n  \"level\": 0,\n  \"max_salary\": \"\",\n  \"min_salary\": \"\",\n  \"name\": \"\",\n  \"requires_system_access\": false,\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `position:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "positions",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/positions/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/positions/:id",
          "request": {
            "description": "**Permission:** `position:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "positions",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/positions/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/salary-grades",
          "request": {
            "description": "**Permission:** `position:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "salary-grades"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/salary-grades?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/salary-grades",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"currency\": \"\",\n  \"description\": \"\",\n  \"level\": 0,\n  \"max_salary\": \"\",\n  \"min_salary\": \"\",\n  \"name\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `position:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "salary-grades"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/salary-grades?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/salary-grades/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"currency\": \"\",\n  \"description\": \"\",\n  \"level\": 0,\n  \"max_salary\": \"\",\n  \"min_salary\": \"\",\n  \"name\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `position:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "salary-grades",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/salary-grades/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/salary-grades/:id",
          "request": {
            "description": "**Permission:** `position:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "salary-grades",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/salary-grades/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/documents",
          "request": {
            "description": "**From the router:** The personnel file. Its own codes, not `hr:read`. This is somebody's qualifications, their identity documents and their police clearance — the most sensitive reading in employment after payroll. `/expiring` and `/summary` are registered BEFORE `/:id` would be a problem, and there is no `/:id` GET at all: a single document is read from the listing the console already has, and a route that took an id here would shadow both of these words.\n\n**Permission:** `hrdocument:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "documents"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "expiring_within",
                  "value": "0"
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "0"
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "type_code",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "unverified",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/documents?expiring_within=0\u0026facility_id=\u0026limit=0\u0026staff_id=\u0026status=\u0026type_code=\u0026unverified="
            }
          }
        },
        {
          "name": "GET /hr/documents/expiring",
          "request": {
            "description": "**Permission:** `hrdocument:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "documents",
                "expiring"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "days",
                  "value": "0"
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/documents/expiring?days=0\u0026facility_id="
            }
          }
        },
        {
          "name": "GET /hr/documents/summary",
          "request": {
            "description": "**Permission:** `hrdocument:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "documents",
                "summary"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/documents/summary?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/documents",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"expires_on\": \"\",\n  \"file_id\": \"\",\n  \"file_name\": \"\",\n  \"issued_on\": \"\",\n  \"issuer\": \"\",\n  \"mime_type\": \"\",\n  \"notes\": \"\",\n  \"number\": \"\",\n  \"size_bytes\": 0,\n  \"staff_id\": \"\",\n  \"status\": \"\",\n  \"type_code\": \"\"\n}"
            },
            "description": "**Permission:** `hrdocument:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "documents"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/documents?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/documents/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"expires_on\": \"\",\n  \"file_id\": \"\",\n  \"file_name\": \"\",\n  \"issued_on\": \"\",\n  \"issuer\": \"\",\n  \"mime_type\": \"\",\n  \"notes\": \"\",\n  \"number\": \"\",\n  \"size_bytes\": 0,\n  \"staff_id\": \"\",\n  \"status\": \"\",\n  \"type_code\": \"\"\n}"
            },
            "description": "**Permission:** `hrdocument:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "documents",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/documents/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /hr/documents/:id/verify",
          "request": {
            "description": "**Permission:** `hrdocument:manage`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "documents",
                ":id",
                "verify"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/documents/:id/verify?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/documents/:id",
          "request": {
            "description": "**Permission:** `hrdocument:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "documents",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/documents/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/deductions",
          "request": {
            "description": "**From the router:** Benefits and deductions. Gated on payroll's codes, because a standing deduction IS a line on a payslip. Somebody who may see what people are paid may see it; somebody who may build a run may set it.\n\n**Permission:** `payroll:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "deductions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/deductions?facility_id=\u0026staff_id=\u0026status="
            }
          }
        },
        {
          "name": "POST /hr/deductions",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount_per_period\": \"\",\n  \"component_code\": \"\",\n  \"end_period\": 0,\n  \"notes\": \"\",\n  \"recovered_amount\": \"\",\n  \"source\": \"\",\n  \"source_reference\": \"\",\n  \"staff_id\": \"\",\n  \"start_period\": 0,\n  \"status\": \"\",\n  \"total_amount\": \"\"\n}"
            },
            "description": "**Permission:** `payroll:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "deductions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/deductions?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/deductions/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount_per_period\": \"\",\n  \"component_code\": \"\",\n  \"end_period\": 0,\n  \"notes\": \"\",\n  \"recovered_amount\": \"\",\n  \"source\": \"\",\n  \"source_reference\": \"\",\n  \"staff_id\": \"\",\n  \"start_period\": 0,\n  \"status\": \"\",\n  \"total_amount\": \"\"\n}"
            },
            "description": "**Permission:** `payroll:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "deductions",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/deductions/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/deductions/:id",
          "request": {
            "description": "**Permission:** `payroll:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "deductions",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/deductions/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/settings",
          "request": {
            "description": "**From the router:** The coded lists. `/settings/adopt` is registered BEFORE `/settings/:kind`, because gin would otherwise match \"adopt\" as a catalogue name and the button that sets up a fresh deployment would 400 on the word it posts to.\n\n**Permission:** `hrsetting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "settings"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/settings?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/settings/adopt",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"kinds\": [\n    \"\"\n  ]\n}"
            },
            "description": "**Permission:** `hrsetting:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "settings",
                "adopt"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/settings/adopt?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/settings/values",
          "request": {
            "description": "The keys ride along with the values deliberately. A screen that received the values alone would have to carry its own copy of the key list — label, type, default, the sentence explaining what reads it — and that copy would go stale the first time hr-service added a rule. Sent together, a new rule appears on the screen without a console release.\n\n**From the router:** The rules, as opposed to the lists: when the leave year starts, which day people are paid, what an overtime hour is worth. Static segments before the :kind ones below, which is also how gin reads them — /settings/values is not a catalogue called \"values\".\n\n**Permission:** `hrsetting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "settings",
                "values"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/settings/values?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/settings/values",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"values\": {}\n}"
            },
            "description": "Only what the form edited is sent, which is what keeps \"not decided\" a state the institution can be in. See the note on SaveHRPolicySettings.\n\n**Permission:** `hrsetting:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "settings",
                "values"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/settings/values?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/settings/:kind",
          "request": {
            "description": "**Permission:** `hrsetting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "settings",
                ":kind"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/settings/:kind?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /hr/settings/:kind",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"description\": \"\",\n  \"extra\": {},\n  \"name\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `hrsetting:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "settings",
                ":kind"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/settings/:kind?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "PUT /hr/settings/:kind/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"description\": \"\",\n  \"extra\": {},\n  \"name\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `hrsetting:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "settings",
                ":kind",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/settings/:kind/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/settings/:kind/:id",
          "request": {
            "description": "**Permission:** `hrsetting:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "settings",
                ":kind",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/settings/:kind/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/employment-events",
          "request": {
            "description": "**From the router:** Joining and leaving. Onboarding and offboarding are both a list of employment events with dates and names against them, so they read the same endpoint and differ only by which event types they ask for. The exit-type list is SERVED rather than hard-coded in the client, so the reasons on the form are the reasons hr-service accepts.\n\n**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "employment-events"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "event_type",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "0"
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/employment-events?event_type=\u0026facility_id=\u0026limit=0\u0026staff_id="
            }
          }
        },
        {
          "name": "GET /hr/performance/summary",
          "request": {
            "description": "**From the router:** Appraisals. `/summary` is registered before `/reviews/:id` could shadow it, and moving a review is its own route: editing changes what the appraisal says, moving it changes who has seen it.\n\n**Permission:** `appraisal:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "summary"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/summary?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/performance/reviews",
          "request": {
            "description": "**Permission:** `appraisal:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "reviews"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "overdue",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "period",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/reviews?facility_id=\u0026overdue=\u0026period=\u0026staff_id=\u0026status="
            }
          }
        },
        {
          "name": "GET /hr/performance/reviews/:id",
          "request": {
            "description": "**Permission:** `appraisal:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "reviews",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/reviews/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /hr/performance/reviews",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"employee_comment\": \"\",\n  \"period\": \"\",\n  \"period_end\": \"\",\n  \"period_start\": \"\",\n  \"promotion_recommended\": false,\n  \"rating\": \"\",\n  \"rating_label\": \"\",\n  \"reviewer_staff_id\": \"\",\n  \"staff_id\": \"\",\n  \"summary\": \"\",\n  \"type\": \"\"\n}"
            },
            "description": "**Permission:** `appraisal:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "reviews"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/reviews?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/performance/reviews/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"employee_comment\": \"\",\n  \"period\": \"\",\n  \"period_end\": \"\",\n  \"period_start\": \"\",\n  \"promotion_recommended\": false,\n  \"rating\": \"\",\n  \"rating_label\": \"\",\n  \"reviewer_staff_id\": \"\",\n  \"staff_id\": \"\",\n  \"summary\": \"\",\n  \"type\": \"\"\n}"
            },
            "description": "**Permission:** `appraisal:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "reviews",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/reviews/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /hr/performance/reviews/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"status\": \"\"\n}"
            },
            "description": "A SEPARATE ROUTE FROM THE EDIT. Editing changes what the appraisal says; moving it changes who has seen it. One form doing both would let a save meant to fix a typo also put the document in front of somebody.\n\n**Permission:** `appraisal:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "reviews",
                ":id",
                "status"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/reviews/:id/status?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/performance/reviews/:id",
          "request": {
            "description": "**Permission:** `appraisal:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "reviews",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/reviews/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/performance/objectives",
          "request": {
            "description": "**Permission:** `appraisal:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "objectives"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "appraisal_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "open",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/objectives?appraisal_id=\u0026facility_id=\u0026open=\u0026staff_id="
            }
          }
        },
        {
          "name": "POST /hr/performance/objectives",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"appraisal_id\": \"\",\n  \"category\": \"\",\n  \"description\": \"\",\n  \"due_date\": \"\",\n  \"metric\": \"\",\n  \"progress\": 0,\n  \"staff_id\": \"\",\n  \"status\": \"\",\n  \"target\": \"\",\n  \"title\": \"\",\n  \"weight\": \"\"\n}"
            },
            "description": "**Permission:** `appraisal:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "objectives"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/objectives?facility_id="
            }
          }
        },
        {
          "name": "PUT /hr/performance/objectives/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"appraisal_id\": \"\",\n  \"category\": \"\",\n  \"description\": \"\",\n  \"due_date\": \"\",\n  \"metric\": \"\",\n  \"progress\": 0,\n  \"staff_id\": \"\",\n  \"status\": \"\",\n  \"target\": \"\",\n  \"title\": \"\",\n  \"weight\": \"\"\n}"
            },
            "description": "**Permission:** `appraisal:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "objectives",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/objectives/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /hr/performance/objectives/:id",
          "request": {
            "description": "**Permission:** `appraisal:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "performance",
                "objectives",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/performance/objectives/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /hr/contracts",
          "request": {
            "description": "Gated on `hr:read` rather than on a code of its own: an employment type and a contract end date are on every staff profile already. What is NOT here, and stays behind payroll's codes, is what anybody is paid.\n\n**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "contracts"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/contracts?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/disciplinary",
          "request": {
            "description": "IT IS THE SAME EVENT LOG as onboarding and offboarding read, filtered to the acts that take somebody off duty and put them back. There is no separate disciplinary record because a suspension already IS one: it has a date, a reason, a decision about pay and the name of whoever made it.\n\n**Permission:** `employment:manage`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "disciplinary"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "0"
                },
                {
                  "disabled": true,
                  "key": "staff_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/disciplinary?facility_id=\u0026limit=0\u0026staff_id="
            }
          }
        },
        {
          "name": "GET /hr/leavers",
          "request": {
            "description": "A separate call from the employment history because the two answer different questions: the history is a timeline of acts, this is the current state of everybody who has gone — and it is the only one that carries whether the hospital would have them back.\n\n**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "leavers"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/leavers?facility_id="
            }
          }
        },
        {
          "name": "GET /hr/turnover",
          "request": {
            "description": "**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "turnover"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/turnover?facility_id=\u0026from=\u0026to="
            }
          }
        },
        {
          "name": "GET /hr/exit-types",
          "request": {
            "description": "Served rather than hard-coded in the client so the choices on the form are the choices hr-service will actually accept. A dropdown offering a reason the service refuses is a form that cannot be submitted and does not say why.\n\n**Permission:** `hr:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "exit-types"
              ],
              "raw": "{{base_url}}/api/v1/hr/exit-types"
            }
          }
        },
        {
          "name": "POST /hr/employment/confirm",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"confirmed_on\": \"\",\n  \"new_status\": \"\",\n  \"notes\": \"\",\n  \"staff_id\": \"\"\n}"
            },
            "description": "**Permission:** `employment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "employment",
                "confirm"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/employment/confirm?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/employment/transfer",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"effective_date\": \"\",\n  \"event_type\": \"\",\n  \"reason\": \"\",\n  \"staff_id\": \"\",\n  \"to_branch_id\": \"\",\n  \"to_department_id\": \"\",\n  \"to_manager_id\": \"\",\n  \"to_position_id\": \"\"\n}"
            },
            "description": "**Permission:** `employment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "employment",
                "transfer"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/employment/transfer?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/employment/suspend",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"effective_date\": \"\",\n  \"reason\": \"\",\n  \"staff_id\": \"\",\n  \"until_date\": \"\",\n  \"with_pay\": false\n}"
            },
            "description": "**Permission:** `employment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "employment",
                "suspend"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/employment/suspend?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/employment/reinstate",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"effective_date\": \"\",\n  \"new_status\": \"\",\n  \"reason\": \"\",\n  \"staff_id\": \"\"\n}"
            },
            "description": "**Permission:** `employment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "employment",
                "reinstate"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/employment/reinstate?facility_id="
            }
          }
        },
        {
          "name": "POST /hr/employment/terminate",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"eligible_for_rehire\": false,\n  \"exit_reason\": \"\",\n  \"exit_type\": \"\",\n  \"final_status\": \"\",\n  \"staff_id\": \"\",\n  \"termination_date\": \"\"\n}"
            },
            "description": "**Permission:** `employment:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "hr",
                "employment",
                "terminate"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/hr/employment/terminate?facility_id="
            }
          }
        }
      ],
      "name": "Human resources · Rasilimali watu"
    },
    {
      "description": "Accounting. THERE IS NO EDIT AND NO DELETE FOR A POSTED ENTRY. A mistake is corrected by posting the mirror image and then the right entry, so both stay on the record — a ledger whose history can be edited cannot be audited, and \"we fixed it\" and \"it was always like that\" become the same thing. `ledger:reverse` is separate from `ledger:post` for the same reason an approval is separate from a request: the person who made the entry should not always be the person who unwinds it. And `account:manage` is separate again, because moving an account between types silently moves money between the income statement and the balance sheet. Procurement: order → deliver → invoice → pay. Five permissions across four steps, because the three-way match is only a control when different people hold its ends. One person who can order, receive, invoice and pay can pay a supplier for goods that never arrived, and no database constraint will notice.",
      "item": [
        {
          "name": "GET /procurement/summary",
          "request": {
            "description": "**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/procurement/summary"
            }
          }
        },
        {
          "name": "GET /procurement/orders",
          "request": {
            "description": "**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "orders"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "supplier_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/procurement/orders?limit=100\u0026search=\u0026status=\u0026supplier_id="
            }
          }
        },
        {
          "name": "GET /procurement/orders/:id",
          "request": {
            "description": "**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "orders",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/procurement/orders/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /procurement/orders/:id/pdf",
          "request": {
            "description": "THE ONE DOCUMENT HERE WHERE THE HOSPITAL IS THE BUYER. It says deliver this, not pay us, so it carries no payment block — and the handler clears the accounts explicitly rather than relying on the template, because a shared sheet that happened to print \"how to pay\" on an order would be telling a supplier where to send money the hospital is about to send them.\n\nPRICES ARE ON IT BECAUSE THEY WERE AGREED. An order without them is a request, and a supplier delivering at a price it chose itself is a cost nobody authorised and an invoice nobody can check.\n\n**From the router:** The order as the supplier receives it.\n\n**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "orders",
                ":id",
                "pdf"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/procurement/orders/:id/pdf?language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /procurement/orders",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"expected_on\": \"\",\n  \"items\": [\n    {\n      \"account_id\": \"\",\n      \"description\": \"\",\n      \"product_id\": \"\",\n      \"quantity\": 0,\n      \"unit_cost\": 0\n    }\n  ],\n  \"notes\": \"\",\n  \"supplier_id\": \"\"\n}"
            },
            "description": "**Permission:** `purchase:order`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "orders"
              ],
              "raw": "{{base_url}}/api/v1/procurement/orders"
            }
          }
        },
        {
          "name": "PUT /procurement/orders/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"expected_on\": \"\",\n  \"items\": [\n    {\n      \"account_id\": \"\",\n      \"description\": \"\",\n      \"product_id\": \"\",\n      \"quantity\": 0,\n      \"unit_cost\": 0\n    }\n  ],\n  \"notes\": \"\",\n  \"supplier_id\": \"\"\n}"
            },
            "description": "**Permission:** `purchase:order`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "orders",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/procurement/orders/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /procurement/orders/:id/send",
          "request": {
            "description": "**Permission:** `purchase:order`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "orders",
                ":id",
                "send"
              ],
              "raw": "{{base_url}}/api/v1/procurement/orders/:id/send",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /procurement/orders/:id/cancel",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `purchase:order`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "orders",
                ":id",
                "cancel"
              ],
              "raw": "{{base_url}}/api/v1/procurement/orders/:id/cancel",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /procurement/receipts",
          "request": {
            "description": "**From the router:** Booking a delivery in IS booking stock in, so it is the same permission. A separate one would let somebody receive goods they are not trusted to put on a shelf.\n\n**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "receipts"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "order_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "supplier_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/procurement/receipts?limit=100\u0026order_id=\u0026supplier_id="
            }
          }
        },
        {
          "name": "GET /procurement/receipts/:id/lines",
          "request": {
            "description": "**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "receipts",
                ":id",
                "lines"
              ],
              "raw": "{{base_url}}/api/v1/procurement/receipts/:id/lines",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /procurement/receipts",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"delivery_note\": \"\",\n  \"items\": [\n    {\n      \"batch_number\": \"\",\n      \"description\": \"\",\n      \"expiry_date\": \"\",\n      \"location_id\": \"\",\n      \"order_item_id\": \"\",\n      \"product_id\": \"\",\n      \"quantity\": 0,\n      \"unit_cost\": 0\n    }\n  ],\n  \"notes\": \"\",\n  \"order_id\": \"\",\n  \"supplier_id\": \"\"\n}"
            },
            "description": "**Permission:** `stock:receive`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "receipts"
              ],
              "raw": "{{base_url}}/api/v1/procurement/receipts"
            }
          }
        },
        {
          "name": "GET /procurement/invoices",
          "request": {
            "description": "**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "invoices"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "supplier_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "unpaid",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/procurement/invoices?limit=100\u0026status=\u0026supplier_id=\u0026unpaid="
            }
          }
        },
        {
          "name": "GET /procurement/invoices/:id",
          "request": {
            "description": "**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "invoices",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/procurement/invoices/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /procurement/invoices",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"due_date\": \"\",\n  \"invoice_date\": \"\",\n  \"invoice_number\": \"\",\n  \"items\": [\n    {\n      \"account_id\": \"\",\n      \"description\": \"\",\n      \"quantity\": 0,\n      \"receipt_item_id\": \"\",\n      \"unit_cost\": 0\n    }\n  ],\n  \"order_id\": \"\",\n  \"supplier_id\": \"\",\n  \"tax_amount\": 0\n}"
            },
            "description": "**Permission:** `purchase:invoice`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "invoices"
              ],
              "raw": "{{base_url}}/api/v1/procurement/invoices"
            }
          }
        },
        {
          "name": "POST /procurement/invoices/:id/approve",
          "request": {
            "description": "**Permission:** `purchase:approve`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "invoices",
                ":id",
                "approve"
              ],
              "raw": "{{base_url}}/api/v1/procurement/invoices/:id/approve",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /procurement/invoices/:id/dispute",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `purchase:invoice`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "invoices",
                ":id",
                "dispute"
              ],
              "raw": "{{base_url}}/api/v1/procurement/invoices/:id/dispute",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /procurement/payments",
          "request": {
            "description": "**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "payments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "invoice_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                }
              ],
              "raw": "{{base_url}}/api/v1/procurement/payments?invoice_id=\u0026limit=100"
            }
          }
        },
        {
          "name": "GET /procurement/payments/:id/pdf",
          "request": {
            "description": "WHAT IT IS FOR. A supplier receives a bank transfer with a reference and no explanation, and has to guess which of its invoices was settled. Half the disputes in a payables ledger are that guess going wrong. This says which invoice, for how much, on what date — and it is the document the hospital keeps to prove it said so.\n\nA REVERSAL PRINTS AND SAYS SO, exactly as a reversed receipt does. Whoever is holding the original advice needs the paper that contradicts it.\n\n**From the router:** The advice that goes with the money, so a supplier is not left guessing which invoice a bank transfer settled.\n\n**Permission:** `purchase:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "payments",
                ":id",
                "pdf"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "language",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/procurement/payments/:id/pdf?language=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /procurement/invoices/:id/pay",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"bank_reference\": \"\",\n  \"method\": \"\"\n}"
            },
            "description": "**Permission:** `purchase:pay`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "invoices",
                ":id",
                "pay"
              ],
              "raw": "{{base_url}}/api/v1/procurement/invoices/:id/pay",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /procurement/payments/:id/reverse",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `purchase:pay`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "procurement",
                "payments",
                ":id",
                "reverse"
              ],
              "raw": "{{base_url}}/api/v1/procurement/payments/:id/reverse",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Procurement · Manunuzi"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /accounting/summary",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/accounting/summary"
            }
          }
        },
        {
          "name": "GET /accounting/statements",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "statements"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/statements?facility_id=\u0026from=\u0026to="
            }
          }
        },
        {
          "name": "GET /accounting/trial-balance",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "trial-balance"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/trial-balance?facility_id=\u0026to="
            }
          }
        },
        {
          "name": "GET /accounting/ageing",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "ageing"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "direction",
                  "value": "receivable"
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/ageing?direction=receivable"
            }
          }
        },
        {
          "name": "GET /accounting/posting-failures",
          "request": {
            "description": "This is the screen that makes automatic posting honest. Postings are never allowed to refuse a payment or a clinical write — a patient at a till is not the person to tell about an unconfigured chart — so the ones that cannot be made land here instead. A queue nobody looks at is the same as a log, which is why it is a page rather than a log line.\n\n**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "posting-failures"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "resolved",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/posting-failures?limit=100\u0026resolved="
            }
          }
        },
        {
          "name": "GET /accounting/readiness",
          "request": {
            "description": "Asked at SETUP, not at the counter. Every required role with nothing bound to it is a whole class of transaction that will land in the exception queue instead of the accounts, and the time to find that out is while somebody is configuring the system.\n\n**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "readiness"
              ],
              "raw": "{{base_url}}/api/v1/accounting/readiness"
            }
          }
        },
        {
          "name": "GET /accounting/reconciliation",
          "request": {
            "description": "Three comparisons, each reaching the same fact from the opposite end: receivables against unpaid bills, the inventory account against the value of every stock movement, cash against the till. Automatic posting is only worth having if somebody can prove it worked, and this is the proof.\n\n**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "reconciliation"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/reconciliation?facility_id="
            }
          }
        },
        {
          "name": "GET /accounting/accounts",
          "request": {
            "description": "Named for the chart rather than \"accounts\": ListAccounts already means user accounts in the access API, and two handlers with one name is how somebody wires a ledger route to the user directory.\n\n**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "accounts"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "inactive",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "kind",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "page",
                  "value": "1"
                },
                {
                  "description": "Capped at 200. `page_size` is accepted as an alias.",
                  "disabled": true,
                  "key": "per_page",
                  "value": "50"
                },
                {
                  "description": "Free-text filter.",
                  "disabled": true,
                  "key": "search",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/accounts?inactive=\u0026kind=\u0026page=1\u0026per_page=50\u0026search="
            }
          }
        },
        {
          "name": "POST /accounting/accounts",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"balance\": 0,\n  \"code\": \"\",\n  \"grouping\": \"\",\n  \"id\": \"\",\n  \"is_bank\": false,\n  \"kind\": \"\",\n  \"line_count\": 0,\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"parent_id\": \"\",\n  \"postable\": false,\n  \"role\": \"\",\n  \"sort_order\": 0,\n  \"statement_section\": \"\"\n}"
            },
            "description": "**Permission:** `account:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "accounts"
              ],
              "raw": "{{base_url}}/api/v1/accounting/accounts"
            }
          }
        },
        {
          "name": "PUT /accounting/accounts/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"balance\": 0,\n  \"code\": \"\",\n  \"grouping\": \"\",\n  \"id\": \"\",\n  \"is_bank\": false,\n  \"kind\": \"\",\n  \"line_count\": 0,\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"parent_id\": \"\",\n  \"postable\": false,\n  \"role\": \"\",\n  \"sort_order\": 0,\n  \"statement_section\": \"\"\n}"
            },
            "description": "**Permission:** `account:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "accounts",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/accounting/accounts/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounting/entries",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "entries"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "account_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "source",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/entries?account_id=\u0026from=\u0026limit=100\u0026source=\u0026status=\u0026to="
            }
          }
        },
        {
          "name": "GET /accounting/entries/:id",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "entries",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/accounting/entries/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounting/entries",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"entry_date\": \"\",\n  \"lines\": [\n    {\n      \"account_id\": \"\",\n      \"credit\": 0,\n      \"debit\": 0,\n      \"department\": \"\",\n      \"description\": \"\"\n    }\n  ],\n  \"memo\": \"\",\n  \"post\": false,\n  \"source\": \"\",\n  \"source_id\": \"\"\n}"
            },
            "description": "Balance is enforced by the database at commit, not here. An application check holds right up until somebody writes a line in a script.\n\n**Permission:** `ledger:post`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "entries"
              ],
              "raw": "{{base_url}}/api/v1/accounting/entries"
            }
          }
        },
        {
          "name": "POST /accounting/entries/:id/post",
          "request": {
            "description": "**Permission:** `ledger:post`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "entries",
                ":id",
                "post"
              ],
              "raw": "{{base_url}}/api/v1/accounting/entries/:id/post",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounting/entries/:id/reverse",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "There is no edit and no delete. Both entries stay on the record, so the history shows what was posted and what was done about it.\n\n**Permission:** `ledger:reverse`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "entries",
                ":id",
                "reverse"
              ],
              "raw": "{{base_url}}/api/v1/accounting/entries/:id/reverse",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounting/bank",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "bank"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/bank?facility_id="
            }
          }
        },
        {
          "name": "GET /accounting/bank/:id/statement",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "bank",
                ":id",
                "statement"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "unmatched",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/bank/:id/statement?limit=200\u0026unmatched=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounting/bank/:id/statement",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"bank_account_id\": \"\",\n  \"bank_reference\": \"\",\n  \"description\": \"\",\n  \"id\": \"\",\n  \"matched_amount\": 0,\n  \"matched_at\": \"\",\n  \"matched_entry_reference\": \"\",\n  \"matched_line_id\": \"\",\n  \"note\": \"\",\n  \"value_date\": \"\"\n}"
            },
            "description": "**Permission:** `bank:reconcile`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "bank",
                ":id",
                "statement"
              ],
              "raw": "{{base_url}}/api/v1/accounting/bank/:id/statement",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounting/bank/statement/:id/match",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"journal_line_id\": \"\",\n  \"note\": \"\"\n}"
            },
            "description": "**Permission:** `bank:reconcile`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "bank",
                "statement",
                ":id",
                "match"
              ],
              "raw": "{{base_url}}/api/v1/accounting/bank/statement/:id/match",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounting/budgets",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "budgets"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "department",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "year",
                  "value": "0"
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/budgets?department=\u0026year=0"
            }
          }
        },
        {
          "name": "POST /accounting/budgets",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_code\": \"\",\n  \"account_id\": \"\",\n  \"account_name\": \"\",\n  \"actual\": 0,\n  \"amount\": 0,\n  \"department\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"notes\": \"\",\n  \"period_month\": 0,\n  \"period_year\": 0,\n  \"used_pct\": 0,\n  \"variance\": 0\n}"
            },
            "description": "**Permission:** `budget:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "budgets"
              ],
              "raw": "{{base_url}}/api/v1/accounting/budgets"
            }
          }
        },
        {
          "name": "GET /accounting/filings",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "filings"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "year",
                  "value": "0"
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/filings?status=\u0026year=0"
            }
          }
        },
        {
          "name": "POST /accounting/filings",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount_due\": 0,\n  \"amount_paid\": 0,\n  \"days_to_due\": 0,\n  \"due_on\": \"\",\n  \"filed_on\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"notes\": \"\",\n  \"outstanding\": 0,\n  \"paid_on\": \"\",\n  \"period_month\": 0,\n  \"period_year\": 0,\n  \"receipt_no\": \"\",\n  \"status\": \"\",\n  \"waiver_reason\": \"\"\n}"
            },
            "description": "**Permission:** `tax:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "filings"
              ],
              "raw": "{{base_url}}/api/v1/accounting/filings"
            }
          }
        },
        {
          "name": "PUT /accounting/filings/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount_due\": 0,\n  \"amount_paid\": 0,\n  \"days_to_due\": 0,\n  \"due_on\": \"\",\n  \"filed_on\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"notes\": \"\",\n  \"outstanding\": 0,\n  \"paid_on\": \"\",\n  \"period_month\": 0,\n  \"period_year\": 0,\n  \"receipt_no\": \"\",\n  \"status\": \"\",\n  \"waiver_reason\": \"\"\n}"
            },
            "description": "**Permission:** `tax:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "filings",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/accounting/filings/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounting/filings/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"reason\": \"\",\n  \"receipt_no\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "Filed and paid are separate. A return submitted and not paid is the one that attracts the penalty, and a single status cannot say which happened.\n\n**Permission:** `tax:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "filings",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/accounting/filings/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounting/tree",
          "request": {
            "description": "**From the router:** The chart as a tree, and the two operations a flat list never needed: moving an account, and removing one nothing has used.\n\n**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "tree"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "inactive",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/tree?inactive="
            }
          }
        },
        {
          "name": "POST /accounting/accounts/:id/move",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"parent_id\": \"\",\n  \"sort_order\": 0\n}"
            },
            "description": "**Permission:** `account:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "accounts",
                ":id",
                "move"
              ],
              "raw": "{{base_url}}/api/v1/accounting/accounts/:id/move",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /accounting/accounts/:id",
          "request": {
            "description": "**Permission:** `account:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "accounts",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/accounting/accounts/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounting/settings/chart/adopt",
          "request": {
            "description": "SAFE TO RUN TWICE, and the answer says why: it reports what it created and what it found already there. It only ever adds — nothing existing is renamed, moved, deactivated, or rebound.\n\n**From the router:** The rules the chart is posted under. `accounting:configure` is separate from `account:manage`: adding an expense account is bookkeeping, whereas closing a year or rebinding what \"Sales\" posts to changes what everybody else's postings do.\n\n**Permission:** `accounting:configure`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "chart",
                "adopt"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/chart/adopt"
            }
          }
        },
        {
          "name": "GET /accounting/settings/fiscal-years",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "fiscal-years"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/fiscal-years"
            }
          }
        },
        {
          "name": "POST /accounting/settings/fiscal-years",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"ends_on\": \"\",\n  \"name\": \"\",\n  \"starts_on\": \"\"\n}"
            },
            "description": "**Permission:** `accounting:configure`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "fiscal-years"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/fiscal-years"
            }
          }
        },
        {
          "name": "PUT /accounting/settings/fiscal-years/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"ends_on\": \"\",\n  \"name\": \"\",\n  \"starts_on\": \"\"\n}"
            },
            "description": "**Permission:** `accounting:configure`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "fiscal-years",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/fiscal-years/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounting/settings/fiscal-years/:id/close",
          "request": {
            "description": "**Permission:** `accounting:configure`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "fiscal-years",
                ":id",
                "close"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/fiscal-years/:id/close",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounting/settings/prefixes",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "prefixes"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/prefixes"
            }
          }
        },
        {
          "name": "PUT /accounting/settings/prefixes/:kind",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"prefix\": \"\"\n}"
            },
            "description": "**Permission:** `accounting:configure`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "prefixes",
                ":kind"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/prefixes/:kind",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "kind",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounting/settings/bindings",
          "request": {
            "description": "The unbound ones come back too, with a count of the required ones still missing: a screen that lists only what is configured cannot show anybody what is not, which is the only question it exists to answer.\n\n**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "bindings"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/bindings"
            }
          }
        },
        {
          "name": "PUT /accounting/settings/bindings/:role",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_id\": \"\"\n}"
            },
            "description": "**Permission:** `accounting:configure`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "bindings",
                ":role"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/bindings/:role",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "role",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounting/settings/tax-rates",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "tax-rates"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "inactive",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/tax-rates?inactive="
            }
          }
        },
        {
          "name": "POST /accounting/settings/tax-rates",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"code\": \"\",\n  \"inclusive\": false,\n  \"liability_account_id\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"rate\": 0\n}"
            },
            "description": "**Permission:** `tax:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "tax-rates"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/tax-rates"
            }
          }
        },
        {
          "name": "PUT /accounting/settings/tax-rates/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"code\": \"\",\n  \"inclusive\": false,\n  \"liability_account_id\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"rate\": 0\n}"
            },
            "description": "**Permission:** `tax:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "tax-rates",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/tax-rates/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /accounting/settings/tax-rates/:id",
          "request": {
            "description": "**Permission:** `tax:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "tax-rates",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/tax-rates/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounting/settings/preferences",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "preferences"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/preferences"
            }
          }
        },
        {
          "name": "PUT /accounting/settings/preferences",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"allow_negative_funding\": false,\n  \"cash_group_id\": \"\",\n  \"lock_date\": \"\"\n}"
            },
            "description": "**Permission:** `accounting:configure`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "preferences"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/preferences"
            }
          }
        },
        {
          "name": "GET /accounting/settings/currencies",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounting",
                "settings",
                "currencies"
              ],
              "raw": "{{base_url}}/api/v1/accounting/settings/currencies"
            }
          }
        }
      ],
      "name": "Accounting · Uhasibu"
    },
    {
      "description": "Funding accounts — the money the branch actually holds Three permissions, because these are three jobs. A cashier reads the accounts and moves money between them all day; deciding what accounts EXIST, and which one a payment method routes into, is configuration and belongs with whoever owns the chart. Every route is scoped to the caller's own branch by the handler. Nothing here trusts a facility in the request body. The branch's money, read-only: the dashboard totals and the one transaction list that Transactions, Transfers, Deposits and Withdrawals all render with a different filter. Analytics — what the hospital did, and what its staff did in the console. Two sources behind one screen; see handlers/analytics.go for which figures are exact and which are not.",
      "item": [
        {
          "name": "GET /analytics/overview",
          "request": {
            "description": "One request rather than six, because six would be six round trips for a page that is always drawn whole, and because the headline figures and the breakdowns have to describe the SAME period — two requests a second apart either side of midnight would not.\n\n**Permission:** `analytics:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "analytics",
                "overview"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/analytics/overview?facility_id=\u0026from=\u0026to="
            }
          }
        },
        {
          "name": "GET /analytics/journey",
          "request": {
            "description": "**Permission:** `analytics:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "analytics",
                "journey"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "steps",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/analytics/journey?facility_id=\u0026from=\u0026steps=\u0026to="
            }
          }
        },
        {
          "name": "GET /analytics/usage",
          "request": {
            "description": "THE ONLY ENDPOINT HERE THAT IS NOT EXACT, and the response says so in a field rather than only in this comment. Events are emitted fire-and-forget by the audit middleware, so a service restart loses a handful. That is the right trade for \"which screens are used and when the busy hours are\", and the wrong one for anything about money — which is why nothing about money comes from here.\n\nA stream that is down is not an error. The page renders the exact figures and says this panel could not be reached, which is more useful than a 503 over a panel nobody would have made a decision from.\n\n**Permission:** `analytics:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "analytics",
                "usage"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "event",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "interval",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/analytics/usage?event=\u0026from=\u0026interval=\u0026to="
            }
          }
        }
      ],
      "name": "Analytics · Takwimu"
    },
    {
      "description": "",
      "item": [
        {
          "name": "GET /accounts/dashboard",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "dashboard"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/dashboard?facility_id=\u0026from=\u0026to="
            }
          }
        },
        {
          "name": "GET /accounts/transactions",
          "request": {
            "description": "One endpoint behind four screens. Transactions is this unfiltered; Transfers, Deposits and Withdrawals are this with a source. Four endpoints would be four places for the branch scoping to be got wrong, and the one that was would be the one nobody tested.\n\n**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "transactions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "account",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "source",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/transactions?account=\u0026facility_id=\u0026from=\u0026limit=\u0026search=\u0026source=\u0026to="
            }
          }
        },
        {
          "name": "GET /accounts/funding",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "inactive",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding?facility_id=\u0026from=\u0026inactive=\u0026to="
            }
          }
        },
        {
          "name": "GET /accounts/funding/:id",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /accounts/funding/:id/movements",
          "request": {
            "description": "**Permission:** `accounting:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding",
                ":id",
                "movements"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding/:id/movements?facility_id=\u0026from=\u0026limit=\u0026to=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounts/funding",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_id\": \"\",\n  \"active\": false,\n  \"branch_name\": \"\",\n  \"currency\": \"\",\n  \"institution\": \"\",\n  \"is_default\": false,\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"number\": \"\"\n}"
            },
            "description": "**Permission:** `funding:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding?facility_id="
            }
          }
        },
        {
          "name": "PUT /accounts/funding/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_id\": \"\",\n  \"active\": false,\n  \"branch_name\": \"\",\n  \"currency\": \"\",\n  \"institution\": \"\",\n  \"is_default\": false,\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"number\": \"\"\n}"
            },
            "description": "**Permission:** `funding:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /accounts/funding/:id",
          "request": {
            "description": "**Permission:** `funding:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounts/funding/:id/default",
          "request": {
            "description": "**Permission:** `funding:manage`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding",
                ":id",
                "default"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding/:id/default?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /accounts/funding/deposit",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_id\": \"\",\n  \"amount\": 0,\n  \"note\": \"\",\n  \"to_account_id\": \"\",\n  \"to_facility_id\": \"\"\n}"
            },
            "description": "CAPITAL ONLY. A patient paying a bill does not come through here — that posts against their receivable when the receipt is written. Routing it here would credit the owner with money the hospital earned and the income statement would never see it.\n\n**From the router:** Moving money. A deposit here is CAPITAL, not a customer paying — a patient's payment posts against their receivable at the till and never reaches this route.\n\n**Permission:** `funding:move`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding",
                "deposit"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding/deposit?facility_id="
            }
          }
        },
        {
          "name": "POST /accounts/funding/withdraw",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_id\": \"\",\n  \"amount\": 0,\n  \"note\": \"\",\n  \"to_account_id\": \"\",\n  \"to_facility_id\": \"\"\n}"
            },
            "description": "**Permission:** `funding:move`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding",
                "withdraw"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding/withdraw?facility_id="
            }
          }
        },
        {
          "name": "POST /accounts/funding/transfer",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_id\": \"\",\n  \"amount\": 0,\n  \"note\": \"\",\n  \"to_account_id\": \"\",\n  \"to_facility_id\": \"\"\n}"
            },
            "description": "**Permission:** `funding:move`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "accounts",
                "funding",
                "transfer"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/accounts/funding/transfer?facility_id="
            }
          }
        }
      ],
      "name": "Funding accounts · Akaunti za fedha"
    },
    {
      "description": "The commercial side. THERE IS NO TILL ENDPOINT HERE. A counter sale is a bill and a payment in /billing, plus a stock movement in /inventory. A second place where money is taken means two day-end figures that disagree, and the one that gets banked is whichever somebody printed. There is also no way to edit the contact log — what somebody was told on the phone in June is not editable in July, and a log that can be revised is worth nothing in a dispute. `salesreturn:decide` is separate from `salesreturn:manage`: a return puts money back and stock on a shelf, and the person handing over the refund should not be the person authorising it.",
      "item": [
        {
          "name": "GET /commercial/summary",
          "request": {
            "description": "**Permission:** `client:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/commercial/summary"
            }
          }
        },
        {
          "name": "GET /commercial/clients",
          "request": {
            "description": "**Permission:** `client:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "clients"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "kind",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "page",
                  "value": "1"
                },
                {
                  "description": "Capped at 200. `page_size` is accepted as an alias.",
                  "disabled": true,
                  "key": "per_page",
                  "value": "50"
                },
                {
                  "description": "Free-text filter.",
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/commercial/clients?kind=\u0026page=1\u0026per_page=50\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "GET /commercial/clients/:id",
          "request": {
            "description": "**Permission:** `client:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "clients",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/commercial/clients/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /commercial/clients",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_manager\": \"\",\n  \"address\": \"\",\n  \"close_reason\": \"\",\n  \"contacts\": [\n    {\n      \"client_id\": \"\",\n      \"client_name\": \"\",\n      \"email\": \"\",\n      \"full_name\": \"\",\n      \"id\": \"\",\n      \"is_primary\": false,\n      \"job_title\": \"\",\n      \"notes\": \"\",\n      \"phone\": \"\"\n    }\n  ],\n  \"contract_days_left\": 0,\n  \"contract_ends\": \"\",\n  \"contract_ref\": \"\",\n  \"contract_starts\": \"\",\n  \"credit_limit\": 0,\n  \"discount_pct\": 0,\n  \"email\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"open_follow_ups\": 0,\n  \"outstanding\": 0,\n  \"payment_terms_days\": 0,\n  \"phone\": \"\",\n  \"reference\": \"\",\n  \"region\": \"\",\n  \"scheme_id\": \"\",\n  \"scheme_name\": \"\",\n  \"status\": \"\",\n  \"tin\": \"\"\n}"
            },
            "description": "**Permission:** `client:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "clients"
              ],
              "raw": "{{base_url}}/api/v1/commercial/clients"
            }
          }
        },
        {
          "name": "PUT /commercial/clients/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_manager\": \"\",\n  \"address\": \"\",\n  \"close_reason\": \"\",\n  \"contacts\": [\n    {\n      \"client_id\": \"\",\n      \"client_name\": \"\",\n      \"email\": \"\",\n      \"full_name\": \"\",\n      \"id\": \"\",\n      \"is_primary\": false,\n      \"job_title\": \"\",\n      \"notes\": \"\",\n      \"phone\": \"\"\n    }\n  ],\n  \"contract_days_left\": 0,\n  \"contract_ends\": \"\",\n  \"contract_ref\": \"\",\n  \"contract_starts\": \"\",\n  \"credit_limit\": 0,\n  \"discount_pct\": 0,\n  \"email\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"open_follow_ups\": 0,\n  \"outstanding\": 0,\n  \"payment_terms_days\": 0,\n  \"phone\": \"\",\n  \"reference\": \"\",\n  \"region\": \"\",\n  \"scheme_id\": \"\",\n  \"scheme_name\": \"\",\n  \"status\": \"\",\n  \"tin\": \"\"\n}"
            },
            "description": "**Permission:** `client:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "clients",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/commercial/clients/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /commercial/contacts",
          "request": {
            "description": "**Permission:** `client:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "contacts"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "client_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/commercial/contacts?client_id="
            }
          }
        },
        {
          "name": "POST /commercial/contacts",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"client_id\": \"\",\n  \"client_name\": \"\",\n  \"email\": \"\",\n  \"full_name\": \"\",\n  \"id\": \"\",\n  \"is_primary\": false,\n  \"job_title\": \"\",\n  \"notes\": \"\",\n  \"phone\": \"\"\n}"
            },
            "description": "**Permission:** `client:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "contacts"
              ],
              "raw": "{{base_url}}/api/v1/commercial/contacts"
            }
          }
        },
        {
          "name": "PUT /commercial/contacts/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"client_id\": \"\",\n  \"client_name\": \"\",\n  \"email\": \"\",\n  \"full_name\": \"\",\n  \"id\": \"\",\n  \"is_primary\": false,\n  \"job_title\": \"\",\n  \"notes\": \"\",\n  \"phone\": \"\"\n}"
            },
            "description": "**Permission:** `client:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "contacts",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/commercial/contacts/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /commercial/interactions",
          "request": {
            "description": "**Permission:** `client:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "interactions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "client_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                }
              ],
              "raw": "{{base_url}}/api/v1/commercial/interactions?client_id=\u0026limit=100"
            }
          }
        },
        {
          "name": "POST /commercial/interactions",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"client_id\": \"\",\n  \"contact_id\": \"\",\n  \"contact_name\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"occurred_at\": \"\",\n  \"outcome\": \"\",\n  \"recorded_by_name\": \"\",\n  \"summary\": \"\"\n}"
            },
            "description": "There is no update and no delete for these, deliberately. What somebody was told on the phone in June is not editable in July.\n\n**Permission:** `client:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "interactions"
              ],
              "raw": "{{base_url}}/api/v1/commercial/interactions"
            }
          }
        },
        {
          "name": "GET /commercial/follow-ups",
          "request": {
            "description": "**Permission:** `followup:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "follow-ups"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "client_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "overdue",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/commercial/follow-ups?client_id=\u0026limit=100\u0026overdue=\u0026status="
            }
          }
        },
        {
          "name": "POST /commercial/follow-ups",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"assigned_to_name\": \"\",\n  \"client_id\": \"\",\n  \"client_name\": \"\",\n  \"detail\": \"\",\n  \"done_on\": \"\",\n  \"due_on\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"outcome\": \"\",\n  \"overdue_days\": 0,\n  \"patient_id\": \"\",\n  \"patient_name\": \"\",\n  \"status\": \"\",\n  \"subject\": \"\"\n}"
            },
            "description": "**Permission:** `followup:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "follow-ups"
              ],
              "raw": "{{base_url}}/api/v1/commercial/follow-ups"
            }
          }
        },
        {
          "name": "POST /commercial/follow-ups/:id/close",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"outcome\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `followup:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "follow-ups",
                ":id",
                "close"
              ],
              "raw": "{{base_url}}/api/v1/commercial/follow-ups/:id/close",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /commercial/quotations",
          "request": {
            "description": "**Permission:** `quotation:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "quotations"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/commercial/quotations?limit=100\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "POST /commercial/quotations",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"client_id\": \"\",\n  \"client_name\": \"\",\n  \"discount_pct\": 0,\n  \"items\": [\n    {\n      \"code\": \"\",\n      \"description\": \"\",\n      \"product_id\": \"\",\n      \"quantity\": 0,\n      \"unit_price\": 0\n    }\n  ],\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"tax_pct\": 0,\n  \"terms\": \"\",\n  \"valid_until\": \"\"\n}"
            },
            "description": "**Permission:** `quotation:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "quotations"
              ],
              "raw": "{{base_url}}/api/v1/commercial/quotations"
            }
          }
        },
        {
          "name": "POST /commercial/quotations/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `quotation:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "quotations",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/commercial/quotations/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /commercial/quotations/:id/convert",
          "request": {
            "description": "The lines are copied, prices and all. An order that repriced itself when the quote was touched would not be the price that was agreed.\n\n**Permission:** `quotation:manage`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "quotations",
                ":id",
                "convert"
              ],
              "raw": "{{base_url}}/api/v1/commercial/quotations/:id/convert",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /commercial/orders",
          "request": {
            "description": "**Permission:** `quotation:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "orders"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/commercial/orders?limit=100\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "POST /commercial/orders",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"client_id\": \"\",\n  \"client_name\": \"\",\n  \"discount_pct\": 0,\n  \"items\": [\n    {\n      \"code\": \"\",\n      \"description\": \"\",\n      \"product_id\": \"\",\n      \"quantity\": 0,\n      \"unit_price\": 0\n    }\n  ],\n  \"notes\": \"\",\n  \"patient_id\": \"\",\n  \"required_by\": \"\",\n  \"tax_pct\": 0\n}"
            },
            "description": "**Permission:** `quotation:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "orders"
              ],
              "raw": "{{base_url}}/api/v1/commercial/orders"
            }
          }
        },
        {
          "name": "POST /commercial/orders/:id/cancel",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `quotation:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "orders",
                ":id",
                "cancel"
              ],
              "raw": "{{base_url}}/api/v1/commercial/orders/:id/cancel",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /commercial/orders/:id/lines/:line/deliver",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"batch_id\": \"\",\n  \"quantity\": 0\n}"
            },
            "description": "**Permission:** `quotation:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "orders",
                ":id",
                "lines",
                ":line",
                "deliver"
              ],
              "raw": "{{base_url}}/api/v1/commercial/orders/:id/lines/:line/deliver",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "line",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /commercial/returns",
          "request": {
            "description": "**Permission:** `salesreturn:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "returns"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/commercial/returns?limit=100\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "POST /commercial/returns",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bill_id\": \"\",\n  \"client_id\": \"\",\n  \"items\": [\n    {\n      \"description\": \"\",\n      \"product_id\": \"\",\n      \"quantity\": 0,\n      \"unit_price\": 0\n    }\n  ],\n  \"notes\": \"\",\n  \"party_name\": \"\",\n  \"patient_id\": \"\",\n  \"reason\": \"\",\n  \"reason_code\": \"\",\n  \"refund_amount\": 0,\n  \"restock\": false\n}"
            },
            "description": "**Permission:** `salesreturn:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "returns"
              ],
              "raw": "{{base_url}}/api/v1/commercial/returns"
            }
          }
        },
        {
          "name": "POST /commercial/returns/:id/decide",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"note\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "Behind its own permission: a return puts money back and stock on a shelf, and the person handing over the refund should not be the person authorising it.\n\n**Permission:** `salesreturn:decide`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "returns",
                ":id",
                "decide"
              ],
              "raw": "{{base_url}}/api/v1/commercial/returns/:id/decide",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /commercial/discount-rules",
          "request": {
            "description": "**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "discount-rules"
              ],
              "raw": "{{base_url}}/api/v1/commercial/discount-rules"
            }
          }
        },
        {
          "name": "GET /commercial/discounts-granted",
          "request": {
            "description": "Read from the bills rather than from a total kept beside the rules: what was given is a fact about a bill, and a second copy would be a second number for the same money.\n\n**Permission:** `bill:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "discounts-granted"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/commercial/discounts-granted?from=\u0026limit=100\u0026to="
            }
          }
        },
        {
          "name": "POST /commercial/discount-rules",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"applies_to\": \"\",\n  \"approval_above\": 0,\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"max_amount\": 0,\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"requires_approval\": false,\n  \"value\": 0\n}"
            },
            "description": "**Permission:** `discount:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "discount-rules"
              ],
              "raw": "{{base_url}}/api/v1/commercial/discount-rules"
            }
          }
        },
        {
          "name": "PUT /commercial/discount-rules/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"applies_to\": \"\",\n  \"approval_above\": 0,\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"max_amount\": 0,\n  \"name\": \"\",\n  \"notes\": \"\",\n  \"requires_approval\": false,\n  \"value\": 0\n}"
            },
            "description": "**Permission:** `discount:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "commercial",
                "discount-rules",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/commercial/discount-rules/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Clients and sales · Wateja na mauzo"
    },
    {
      "description": "Operations. THERE IS NO POST FOR BACKUPS. Rows are written by whatever took the backup; a button that writes \"backup succeeded\" without a backup having happened is a false assurance, and it is discovered on the day of the restore. The only write is marking one as actually restored from. AND NOTHING HERE SENDS. Queueing writes a row saying a message is waiting; whatever holds the gateway credentials moves it on and calls back on /status with what happened. Writing \"sent\" from a handler that never contacted anybody is the exact lie the log exists to prevent.",
      "item": [
        {
          "name": "GET /ops/messaging/summary",
          "request": {
            "description": "**Permission:** `communication:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "messaging",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/ops/messaging/summary"
            }
          }
        },
        {
          "name": "GET /ops/templates",
          "request": {
            "description": "**Permission:** `communication:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "templates"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "inactive",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/ops/templates?inactive="
            }
          }
        },
        {
          "name": "GET /ops/messages",
          "request": {
            "description": "**Permission:** `communication:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "messages"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "channel",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/ops/messages?channel=\u0026limit=200\u0026patient_id=\u0026status="
            }
          }
        },
        {
          "name": "POST /ops/templates",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"body\": \"\",\n  \"category\": \"\",\n  \"channel\": \"\",\n  \"code\": \"\",\n  \"id\": \"\",\n  \"name\": \"\",\n  \"placeholders\": [\n    \"\"\n  ],\n  \"subject\": \"\",\n  \"used_count\": 0\n}"
            },
            "description": "**Permission:** `communication:send`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "templates"
              ],
              "raw": "{{base_url}}/api/v1/ops/templates"
            }
          }
        },
        {
          "name": "PUT /ops/templates/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"body\": \"\",\n  \"category\": \"\",\n  \"channel\": \"\",\n  \"code\": \"\",\n  \"id\": \"\",\n  \"name\": \"\",\n  \"placeholders\": [\n    \"\"\n  ],\n  \"subject\": \"\",\n  \"used_count\": 0\n}"
            },
            "description": "**Permission:** `communication:send`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "templates",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/ops/templates/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /ops/messages",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"body\": \"\",\n  \"channel\": \"\",\n  \"patient_id\": \"\",\n  \"recipient\": \"\",\n  \"recipient_name\": \"\",\n  \"subject\": \"\",\n  \"template_id\": \"\"\n}"
            },
            "description": "IT USED TO BE QUEUED AND NOTHING ELSE. The row said QUEUED, the comment said \"whatever holds the gateway credentials moves it on\", and nothing did: the patient was never told, and the log said \"waiting\" for ever — which reads as somebody's fault rather than nobody's.\n\nIt is now written first and sent second, in that order, so a message that went out is never missing from the log. The status is what actually happened: SENT only when notification-service accepted it, FAILED with the gateway's own reason when it did not, and QUEUED when the service could not be reached at all — which the sweep every ten minutes then retries.\n\n**Permission:** `communication:send`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "messages"
              ],
              "raw": "{{base_url}}/api/v1/ops/messages"
            }
          }
        },
        {
          "name": "POST /ops/messages/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"error\": \"\",\n  \"provider_ref\": \"\",\n  \"status\": \"\"\n}"
            },
            "description": "**Permission:** `communication:send`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "messages",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/ops/messages/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /ops/surveillance/summary",
          "request": {
            "description": "**Permission:** `report:idsr`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "surveillance",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/ops/surveillance/summary"
            }
          }
        },
        {
          "name": "GET /ops/conditions",
          "request": {
            "description": "**Permission:** `report:idsr`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "conditions"
              ],
              "raw": "{{base_url}}/api/v1/ops/conditions"
            }
          }
        },
        {
          "name": "GET /ops/cases",
          "request": {
            "description": "**Permission:** `report:idsr`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "cases"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "classification",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "unnotified",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/ops/cases?classification=\u0026from=\u0026limit=200\u0026to=\u0026unnotified="
            }
          }
        },
        {
          "name": "POST /ops/conditions",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"active\": false,\n  \"case_definition\": \"\",\n  \"id\": \"\",\n  \"name\": \"\",\n  \"urgency\": \"\"\n}"
            },
            "description": "**Permission:** `idsr:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "conditions"
              ],
              "raw": "{{base_url}}/api/v1/ops/conditions"
            }
          }
        },
        {
          "name": "POST /ops/cases",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"age_years\": 0,\n  \"classification\": \"\",\n  \"condition_id\": \"\",\n  \"condition_name\": \"\",\n  \"lab_confirmed\": false,\n  \"notes\": \"\",\n  \"onset_on\": \"\",\n  \"outcome\": \"\",\n  \"patient_id\": \"\",\n  \"patient_name\": \"\",\n  \"reported_by\": \"\",\n  \"sex\": \"\",\n  \"specimen_taken\": false,\n  \"village\": \"\"\n}"
            },
            "description": "**Permission:** `idsr:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "cases"
              ],
              "raw": "{{base_url}}/api/v1/ops/cases"
            }
          }
        },
        {
          "name": "PUT /ops/cases/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"classification\": \"\",\n  \"lab_confirmed\": false,\n  \"outcome\": \"\"\n}"
            },
            "description": "A discarded case is not deleted. It stays, so the proportion of suspected cases that were confirmed can still be worked out.\n\n**Permission:** `idsr:record`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "cases",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/ops/cases/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /ops/cases/:id/notify",
          "request": {
            "description": "**Permission:** `idsr:record`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "cases",
                ":id",
                "notify"
              ],
              "raw": "{{base_url}}/api/v1/ops/cases/:id/notify",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /ops/hmis",
          "request": {
            "description": "Counted from the operational tables. Every indicator this deployment has no source for is NAMED rather than returned as nought — a zero means \"none happened\", and sending that when the truth is \"we do not collect this\" is how a facility reports something untrue to a ministry.\n\n**Permission:** `report:hmis`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "hmis"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "month",
                  "value": "0"
                },
                {
                  "disabled": true,
                  "key": "year",
                  "value": "0"
                }
              ],
              "raw": "{{base_url}}/api/v1/ops/hmis?month=0\u0026year=0"
            }
          }
        },
        {
          "name": "GET /ops/backups",
          "request": {
            "description": "There is deliberately no POST. Rows are written by the job that took the backup — a button that writes \"succeeded\" without a backup having happened is a false assurance discovered on the day of the restore.\n\n**Permission:** `backup:manage`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "backups"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                }
              ],
              "raw": "{{base_url}}/api/v1/ops/backups?limit=50"
            }
          }
        },
        {
          "name": "POST /ops/backups/:id/verify",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"notes\": \"\"\n}"
            },
            "description": "**Permission:** `backup:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "backups",
                ":id",
                "verify"
              ],
              "raw": "{{base_url}}/api/v1/ops/backups/:id/verify",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /ops/integrations",
          "request": {
            "description": "The credential VALUE is never read and never returned — only whether the named secret currently resolves to anything.\n\n**Permission:** `integration:manage`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "integrations"
              ],
              "raw": "{{base_url}}/api/v1/ops/integrations"
            }
          }
        },
        {
          "name": "POST /ops/integrations",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"credential_present\": false,\n  \"credential_ref\": \"\",\n  \"days_since_ok\": 0,\n  \"enabled\": false,\n  \"endpoint\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"last_error\": \"\",\n  \"last_error_at\": \"\",\n  \"last_ok_at\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\"\n}"
            },
            "description": "**Permission:** `integration:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "integrations"
              ],
              "raw": "{{base_url}}/api/v1/ops/integrations"
            }
          }
        },
        {
          "name": "PUT /ops/integrations/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"credential_present\": false,\n  \"credential_ref\": \"\",\n  \"days_since_ok\": 0,\n  \"enabled\": false,\n  \"endpoint\": \"\",\n  \"id\": \"\",\n  \"kind\": \"\",\n  \"last_error\": \"\",\n  \"last_error_at\": \"\",\n  \"last_ok_at\": \"\",\n  \"name\": \"\",\n  \"notes\": \"\"\n}"
            },
            "description": "**Permission:** `integration:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "integrations",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/ops/integrations/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /ops/integrations/:id/result",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"error\": \"\",\n  \"ok\": false\n}"
            },
            "description": "**Permission:** `integration:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "ops",
                "integrations",
                ":id",
                "result"
              ],
              "raw": "{{base_url}}/api/v1/ops/integrations/:id/result",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Operations and reporting · Uendeshaji na ripoti"
    },
    {
      "description": "The patient portal. EVERY ROUTE HERE RESOLVES THE PATIENT FROM THE TOKEN. Not one of them accepts a patient id as the SUBJECT of the request — where `patient_id` appears it names a dependant, and the repository checks a live, unexpired, unrevoked grant before returning anything. An endpoint that trusted the browser about whose record to serve would be a data breach with a query parameter. `portal:use` is the ONLY permission a patient account holds, and it grants nothing anywhere else in this API. A patient must not be able to reach a staff endpoint by holding the wrong role, and a member of staff reading their own record uses these same routes.",
      "item": [
        {
          "name": "GET /portal/me",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "me"
              ],
              "raw": "{{base_url}}/api/v1/portal/me"
            }
          }
        },
        {
          "name": "GET /portal/home",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "home"
              ],
              "raw": "{{base_url}}/api/v1/portal/home"
            }
          }
        },
        {
          "name": "GET /portal/appointments",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "appointments"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/portal/appointments?patient_id="
            }
          }
        },
        {
          "name": "POST /portal/appointments",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"department\": \"\",\n  \"patient_id\": \"\",\n  \"reason\": \"\",\n  \"scheduled_for\": \"\"\n}"
            },
            "description": "It is BOOKED, not confirmed. Somebody choosing a slot on their phone has not been triaged, and a clinic that treats a self-service booking as a firm commitment ends up with a list nobody has looked at.\n\n**Permission:** `portal:use`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "appointments"
              ],
              "raw": "{{base_url}}/api/v1/portal/appointments"
            }
          }
        },
        {
          "name": "POST /portal/appointments/:id/cancel",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "**Permission:** `portal:use`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "appointments",
                ":id",
                "cancel"
              ],
              "raw": "{{base_url}}/api/v1/portal/appointments/:id/cancel",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /portal/visits",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "visits"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/portal/visits?patient_id="
            }
          }
        },
        {
          "name": "GET /portal/results",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "results"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/portal/results?patient_id="
            }
          }
        },
        {
          "name": "GET /portal/prescriptions",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "prescriptions"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/portal/prescriptions?patient_id="
            }
          }
        },
        {
          "name": "GET /portal/bills",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "bills"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/portal/bills?patient_id="
            }
          }
        },
        {
          "name": "GET /portal/immunisations",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "immunisations"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "patient_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/portal/immunisations?patient_id="
            }
          }
        },
        {
          "name": "GET /portal/messages",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "messages"
              ],
              "raw": "{{base_url}}/api/v1/portal/messages"
            }
          }
        },
        {
          "name": "POST /portal/messages",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"body\": \"\",\n  \"category\": \"\",\n  \"patient_id\": \"\",\n  \"subject\": \"\"\n}"
            },
            "description": "**Permission:** `portal:use`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "messages"
              ],
              "raw": "{{base_url}}/api/v1/portal/messages"
            }
          }
        },
        {
          "name": "POST /portal/messages/:id/reply",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"body\": \"\"\n}"
            },
            "description": "**Permission:** `portal:use`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "messages",
                ":id",
                "reply"
              ],
              "raw": "{{base_url}}/api/v1/portal/messages/:id/reply",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /portal/messages/:id/read",
          "request": {
            "description": "**Permission:** `portal:use`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "portal",
                "messages",
                ":id",
                "read"
              ],
              "raw": "{{base_url}}/api/v1/portal/messages/:id/read",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Patient portal · Mlango wa mgonjwa"
    },
    {
      "description": "Administration. There is NO audit:write. Nothing outside the server writes the audit log — it is appended to as a side effect of what people do, and an endpoint that let a client post entries would let a client forge them.",
      "item": [
        {
          "name": "GET /admin/summary",
          "request": {
            "description": "**Permission:** `staff:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "summary"
              ],
              "raw": "{{base_url}}/api/v1/admin/summary"
            }
          }
        },
        {
          "name": "GET /admin/staff",
          "request": {
            "description": "**Permission:** `staff:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "staff"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "department",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "page",
                  "value": "1"
                },
                {
                  "description": "Capped at 200. `page_size` is accepted as an alias.",
                  "disabled": true,
                  "key": "per_page",
                  "value": "50"
                },
                {
                  "description": "Free-text filter.",
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/staff?department=\u0026facility_id=\u0026page=1\u0026per_page=50\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "POST /admin/staff",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bank_account\": \"\",\n  \"bank_name\": \"\",\n  \"basic_pay\": 0,\n  \"cadre\": \"\",\n  \"date_of_birth\": \"\",\n  \"department\": \"\",\n  \"email\": \"\",\n  \"employment_type\": \"\",\n  \"ended_on\": \"\",\n  \"first_name\": \"\",\n  \"gender\": \"\",\n  \"job_title\": \"\",\n  \"last_name\": \"\",\n  \"licence_body\": \"\",\n  \"licence_expiry\": \"\",\n  \"licence_no\": \"\",\n  \"next_of_kin\": \"\",\n  \"next_of_kin_phone\": \"\",\n  \"nhif_number\": \"\",\n  \"nssf_number\": \"\",\n  \"phone\": \"\",\n  \"staff_number\": \"\",\n  \"started_on\": \"\",\n  \"status\": \"\",\n  \"tin\": \"\",\n  \"user_id\": \"\"\n}"
            },
            "description": "**Permission:** `staff:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "staff"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/staff?facility_id="
            }
          }
        },
        {
          "name": "PUT /admin/staff/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"bank_account\": \"\",\n  \"bank_name\": \"\",\n  \"basic_pay\": 0,\n  \"cadre\": \"\",\n  \"date_of_birth\": \"\",\n  \"department\": \"\",\n  \"email\": \"\",\n  \"employment_type\": \"\",\n  \"ended_on\": \"\",\n  \"first_name\": \"\",\n  \"gender\": \"\",\n  \"job_title\": \"\",\n  \"last_name\": \"\",\n  \"licence_body\": \"\",\n  \"licence_expiry\": \"\",\n  \"licence_no\": \"\",\n  \"next_of_kin\": \"\",\n  \"next_of_kin_phone\": \"\",\n  \"nhif_number\": \"\",\n  \"nssf_number\": \"\",\n  \"phone\": \"\",\n  \"staff_number\": \"\",\n  \"started_on\": \"\",\n  \"status\": \"\",\n  \"tin\": \"\",\n  \"user_id\": \"\"\n}"
            },
            "description": "**Permission:** `staff:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "staff",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/staff/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /admin/audit",
          "request": {
            "description": "**Permission:** `audit:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "audit"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "action",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "entity",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "200"
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/audit?action=\u0026entity=\u0026from=\u0026limit=200"
            }
          }
        },
        {
          "name": "GET /admin/reports",
          "request": {
            "description": "Not from a summary table that something has to remember to update: a reporting table written separately from the thing it reports on is wrong by the end of the first week, and wrong in a way nobody notices, because the report is the only place anybody looks.\n\n**Permission:** `report:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "reports"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/reports?from=\u0026to="
            }
          }
        },
        {
          "name": "GET /admin/reports/export",
          "request": {
            "description": "A section is named because a period report is five different tables — a daily series, the top diagnoses, the split by department, by payer, by age — and a single CSV holding all five is a file somebody has to take apart by hand before they can use it.\n\n**From the router:** The same figures, as a file. Same permission: an export carries exactly what the screen shows, and gating one and not the other protects nothing.\n\n**Permission:** `report:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "reports",
                "export"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "format",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "from",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "section",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "to",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/reports/export?format=\u0026from=\u0026section=\u0026to="
            }
          }
        },
        {
          "name": "GET /admin/announcements",
          "request": {
            "description": "**Permission:** `announcement:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "announcements"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "drafts",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "50"
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/announcements?drafts=\u0026limit=50"
            }
          }
        },
        {
          "name": "POST /admin/announcements",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"body\": \"\",\n  \"department\": \"\",\n  \"expires_at\": \"\",\n  \"pinned\": false,\n  \"publish\": false,\n  \"title\": \"\",\n  \"urgency\": \"\"\n}"
            },
            "description": "**Permission:** `announcement:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "announcements"
              ],
              "raw": "{{base_url}}/api/v1/admin/announcements"
            }
          }
        },
        {
          "name": "DELETE /admin/announcements/:id",
          "request": {
            "description": "**Permission:** `announcement:manage`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "announcements",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/admin/announcements/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /admin/approvals",
          "request": {
            "description": "**Permission:** `approval:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "approvals"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "limit",
                  "value": "100"
                },
                {
                  "disabled": true,
                  "key": "mine",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/approvals?limit=100\u0026mine=\u0026status="
            }
          }
        },
        {
          "name": "POST /admin/approvals",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"amount\": 0,\n  \"assigned_to\": \"\",\n  \"detail\": \"\",\n  \"entity\": \"\",\n  \"entity_id\": \"\",\n  \"kind\": \"\",\n  \"title\": \"\"\n}"
            },
            "description": "**Permission:** `approval:request`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "approvals"
              ],
              "raw": "{{base_url}}/api/v1/admin/approvals"
            }
          }
        },
        {
          "name": "POST /admin/approvals/:id/decide",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"note\": \"\",\n  \"status\": \"\",\n  \"step\": \"\"\n}"
            },
            "description": "**Permission:** `approval:decide`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "approvals",
                ":id",
                "decide"
              ],
              "raw": "{{base_url}}/api/v1/admin/approvals/:id/decide",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /admin/portal/patients/:id",
          "request": {
            "description": "Gated on `portal:link` rather than `patient:read`, because the answer is not clinical: it is a list of the OTHER people who can read this patient's results. A clerk who may open a file has no business with that list.\n\n**Permission:** `portal:link`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "portal",
                "patients",
                ":id"
              ],
              "raw": "{{base_url}}/api/v1/admin/portal/patients/:id",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /admin/portal/accounts",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"patient_id\": \"\",\n  \"user_id\": \"\"\n}"
            },
            "description": "Linking an account to the wrong patient is the worst thing that can happen in this domain, so it records who did it.\n\n**Permission:** `portal:link`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "portal",
                "accounts"
              ],
              "raw": "{{base_url}}/api/v1/admin/portal/accounts"
            }
          }
        },
        {
          "name": "POST /admin/portal/dependants",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"account_id\": \"\",\n  \"can_book\": false,\n  \"can_see_bills\": false,\n  \"can_see_results\": false,\n  \"expires_on\": \"\",\n  \"patient_id\": \"\",\n  \"relationship\": \"\"\n}"
            },
            "description": "**Permission:** `portal:delegate`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "portal",
                "dependants"
              ],
              "raw": "{{base_url}}/api/v1/admin/portal/dependants"
            }
          }
        },
        {
          "name": "POST /admin/portal/dependants/:id/revoke",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"reason\": \"\"\n}"
            },
            "description": "The row stays, with a date and a reason. Deleting it would leave no record that the access ever existed, which is exactly what somebody investigating a complaint needs to see.\n\n**Permission:** `portal:delegate`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "portal",
                "dependants",
                ":id",
                "revoke"
              ],
              "raw": "{{base_url}}/api/v1/admin/portal/dependants/:id/revoke",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /admin/documents",
          "request": {
            "description": "**Permission:** `document:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "documents"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "category",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/documents?category=\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "POST /admin/documents",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"category\": \"\",\n  \"counterparty\": \"\",\n  \"department\": \"\",\n  \"expires_on\": \"\",\n  \"file_url\": \"\",\n  \"issued_on\": \"\",\n  \"location\": \"\",\n  \"notes\": \"\",\n  \"owner_name\": \"\",\n  \"reference\": \"\",\n  \"status\": \"\",\n  \"title\": \"\"\n}"
            },
            "description": "**Permission:** `document:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "documents"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/documents?facility_id="
            }
          }
        },
        {
          "name": "PUT /admin/documents/:id",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"category\": \"\",\n  \"counterparty\": \"\",\n  \"department\": \"\",\n  \"expires_on\": \"\",\n  \"file_url\": \"\",\n  \"issued_on\": \"\",\n  \"location\": \"\",\n  \"notes\": \"\",\n  \"owner_name\": \"\",\n  \"reference\": \"\",\n  \"status\": \"\",\n  \"title\": \"\"\n}"
            },
            "description": "**Permission:** `document:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "admin",
                "documents",
                ":id"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "facility_id",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/admin/documents/:id?facility_id=",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        }
      ],
      "name": "Administration · Utawala"
    },
    {
      "description": "Accounts, roles and permissions. The strictest gates in the API, and the ones that make every other permission grantable. `user:assign_role` is separate from `user:update` on purpose: somebody who can suspend a leaver's account is not thereby somebody who can make themselves an administrator.",
      "item": [
        {
          "name": "GET /access/users",
          "request": {
            "description": "**Permission:** `user:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "users"
              ],
              "query": [
                {
                  "disabled": true,
                  "key": "page",
                  "value": "1"
                },
                {
                  "disabled": true,
                  "key": "page_size",
                  "value": "20"
                },
                {
                  "disabled": true,
                  "key": "search",
                  "value": ""
                },
                {
                  "disabled": true,
                  "key": "status",
                  "value": ""
                }
              ],
              "raw": "{{base_url}}/api/v1/access/users?page=1\u0026page_size=20\u0026search=\u0026status="
            }
          }
        },
        {
          "name": "POST /access/users",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"email\": \"\",\n  \"password\": \"\",\n  \"phone\": \"\",\n  \"role_code\": \"\",\n  \"username\": \"\"\n}"
            },
            "description": "**Permission:** `user:create`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "users"
              ],
              "raw": "{{base_url}}/api/v1/access/users"
            }
          }
        },
        {
          "name": "PATCH /access/users/:id/status",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"status\": \"\"\n}"
            },
            "description": "There is no delete. An account that signed a discharge summary last year has to keep existing for the summary to still name somebody.\n\n**Permission:** `user:update`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PATCH",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "users",
                ":id",
                "status"
              ],
              "raw": "{{base_url}}/api/v1/access/users/:id/status",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /access/users/:id/password-reset",
          "request": {
            "description": "THE ADMINISTRATOR NEVER LEARNS THE PASSWORD. They start the reset; the code goes to the account's own email or phone, and only the person holding it can finish. The alternative — an administrator typing a new password for somebody — hands every administrator the ability to sign in as any clinician and leave that clinician's name on the record they write.\n\n**From the router:** Starts a reset; it does not perform one. The code goes to the account's own contact, so an administrator can unstick a locked-out nurse without ever being able to sign in as her.\n\n**Permission:** `user:update`",
            "header": [],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "users",
                ":id",
                "password-reset"
              ],
              "raw": "{{base_url}}/api/v1/access/users/:id/password-reset",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /access/users/:id/roles",
          "request": {
            "description": "**Permission:** `user:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "users",
                ":id",
                "roles"
              ],
              "raw": "{{base_url}}/api/v1/access/users/:id/roles",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "POST /access/users/:id/roles",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"role_code\": \"\"\n}"
            },
            "description": "**Permission:** `user:assign_role`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "users",
                ":id",
                "roles"
              ],
              "raw": "{{base_url}}/api/v1/access/users/:id/roles",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "DELETE /access/users/:id/roles/:code",
          "request": {
            "description": "**Permission:** `user:assign_role`",
            "header": [],
            "method": "DELETE",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "users",
                ":id",
                "roles",
                ":code"
              ],
              "raw": "{{base_url}}/api/v1/access/users/:id/roles/:code",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                },
                {
                  "description": "The id of the record.",
                  "key": "code",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /access/roles",
          "request": {
            "description": "**Permission:** `role:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "roles"
              ],
              "raw": "{{base_url}}/api/v1/access/roles"
            }
          }
        },
        {
          "name": "POST /access/roles",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"code\": \"\",\n  \"description\": \"\",\n  \"name\": \"\"\n}"
            },
            "description": "**Permission:** `role:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "POST",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "roles"
              ],
              "raw": "{{base_url}}/api/v1/access/roles"
            }
          }
        },
        {
          "name": "PUT /access/roles/:id/permissions",
          "request": {
            "body": {
              "mode": "raw",
              "options": {
                "raw": {
                  "language": "json"
                }
              },
              "raw": "{\n  \"permissions\": [\n    \"\"\n  ]\n}"
            },
            "description": "Replace, not add: an administrator unticking a box has to mean the permission goes away. Everybody holding the role is affected at once, which is what a role is for.\n\n**Permission:** `role:manage`",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "method": "PUT",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "roles",
                ":id",
                "permissions"
              ],
              "raw": "{{base_url}}/api/v1/access/roles/:id/permissions",
              "variable": [
                {
                  "description": "The id of the record.",
                  "key": "id",
                  "value": ""
                }
              ]
            }
          }
        },
        {
          "name": "GET /access/permissions",
          "request": {
            "description": "**Permission:** `role:read`",
            "header": [],
            "method": "GET",
            "url": {
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "access",
                "permissions"
              ],
              "raw": "{{base_url}}/api/v1/access/permissions"
            }
          }
        }
      ],
      "name": "Accounts, roles and permissions · Watumiaji na majukumu"
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "type": "string",
      "value": "http://localhost:4000"
    }
  ]
}
