{
    "openapi": "3.1.2",
    "info": {
        "title": "PestLove API",
        "version": "1.0.0",
        "description": "PestLove REST API v1. Authenticate with a personal access token (POST \/api\/v1\/auth\/token) sent as `Authorization: Bearer <token>`. Every tenant endpoint requires the `X-Organization` header with the organization public id (see GET \/api\/v1\/me). Mutations accept an `Idempotency-Key` header: a retried request returns the stored response (`Idempotent-Replayed: true`). Errors use one shape: `{message, code, errors?, details?}`; `409 stale_record` means the record changed (send `lock_version` to detect it)."
    },
    "servers": [
        {
            "url": "https:\/\/www.pestlove.com\/api"
        }
    ],
    "security": [
        {
            "http": []
        }
    ],
    "paths": {
        "\/v1\/services\/{service}\/audit": {
            "get": {
                "operationId": "v1.services.audit.show",
                "tags": [
                    "Audit"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audit": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                },
                                                                "version": {
                                                                    "type": "integer"
                                                                },
                                                                "scoring_formula": {
                                                                    "type": "string"
                                                                },
                                                                "summary": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "lock_version": {
                                                                    "type": "integer"
                                                                },
                                                                "preview": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "score": {
                                                                            "type": [
                                                                                "number",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "reason": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ],
                                                                            "enum": [
                                                                                "nothing_evaluated",
                                                                                null
                                                                            ]
                                                                        },
                                                                        "counts": {
                                                                            "type": "array",
                                                                            "items": {}
                                                                        },
                                                                        "evaluated_weight": {
                                                                            "type": "number",
                                                                            "const": 0
                                                                        },
                                                                        "coverage": {
                                                                            "type": [
                                                                                "number",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "critical_noncompliance": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "formula": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "score",
                                                                        "reason",
                                                                        "counts",
                                                                        "evaluated_weight",
                                                                        "coverage",
                                                                        "critical_noncompliance",
                                                                        "formula"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "template",
                                                                "version",
                                                                "scoring_formula",
                                                                "summary",
                                                                "lock_version",
                                                                "preview"
                                                            ]
                                                        },
                                                        "editable": {
                                                            "type": "string"
                                                        },
                                                        "results": {
                                                            "type": "array",
                                                            "prefixItems": [
                                                                {
                                                                    "type": "string",
                                                                    "const": "compliant"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "const": "noncompliant"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "const": "improvement_required"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "const": "not_applicable"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "const": "not_evaluated"
                                                                }
                                                            ],
                                                            "minItems": 5,
                                                            "maxItems": 5
                                                        },
                                                        "sections": {
                                                            "type": "string"
                                                        },
                                                        "answers": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "required": [
                                                        "audit",
                                                        "editable",
                                                        "results",
                                                        "sections",
                                                        "answers"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audit": {
                                                            "type": "null"
                                                        },
                                                        "editable": {
                                                            "type": "string"
                                                        },
                                                        "templates": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "required": [
                                                        "audit",
                                                        "editable",
                                                        "templates"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/audit\/template": {
            "post": {
                "operationId": "v1.services.audit.template",
                "summary": "Pick the template before the first answer (when the organization has no default)",
                "tags": [
                    "Audit"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "version_id": {
                                        "type": "integer"
                                    }
                                },
                                "required": [
                                    "version_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audit": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "string"
                                                                },
                                                                "template": {
                                                                    "type": "string"
                                                                },
                                                                "version": {
                                                                    "type": "integer"
                                                                },
                                                                "scoring_formula": {
                                                                    "type": "string"
                                                                },
                                                                "summary": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "lock_version": {
                                                                    "type": "integer"
                                                                },
                                                                "preview": {
                                                                    "type": "object",
                                                                    "properties": {
                                                                        "score": {
                                                                            "type": [
                                                                                "number",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "reason": {
                                                                            "type": [
                                                                                "string",
                                                                                "null"
                                                                            ],
                                                                            "enum": [
                                                                                "nothing_evaluated",
                                                                                null
                                                                            ]
                                                                        },
                                                                        "counts": {
                                                                            "type": "array",
                                                                            "items": {}
                                                                        },
                                                                        "evaluated_weight": {
                                                                            "type": "number",
                                                                            "const": 0
                                                                        },
                                                                        "coverage": {
                                                                            "type": [
                                                                                "number",
                                                                                "null"
                                                                            ]
                                                                        },
                                                                        "critical_noncompliance": {
                                                                            "type": "boolean"
                                                                        },
                                                                        "formula": {
                                                                            "type": "string"
                                                                        }
                                                                    },
                                                                    "required": [
                                                                        "score",
                                                                        "reason",
                                                                        "counts",
                                                                        "evaluated_weight",
                                                                        "coverage",
                                                                        "critical_noncompliance",
                                                                        "formula"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "template",
                                                                "version",
                                                                "scoring_formula",
                                                                "summary",
                                                                "lock_version",
                                                                "preview"
                                                            ]
                                                        },
                                                        "editable": {
                                                            "type": "string"
                                                        },
                                                        "results": {
                                                            "type": "array",
                                                            "prefixItems": [
                                                                {
                                                                    "type": "string",
                                                                    "const": "compliant"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "const": "noncompliant"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "const": "improvement_required"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "const": "not_applicable"
                                                                },
                                                                {
                                                                    "type": "string",
                                                                    "const": "not_evaluated"
                                                                }
                                                            ],
                                                            "minItems": 5,
                                                            "maxItems": 5
                                                        },
                                                        "sections": {
                                                            "type": "string"
                                                        },
                                                        "answers": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "required": [
                                                        "audit",
                                                        "editable",
                                                        "results",
                                                        "sections",
                                                        "answers"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "data": {
                                                    "type": "object",
                                                    "properties": {
                                                        "audit": {
                                                            "type": "null"
                                                        },
                                                        "editable": {
                                                            "type": "string"
                                                        },
                                                        "templates": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        }
                                                    },
                                                    "required": [
                                                        "audit",
                                                        "editable",
                                                        "templates"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "data"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/audit\/answers\/{question}": {
            "put": {
                "operationId": "v1.services.audit.answer",
                "summary": "Save one answer. Send the answer's lock_version when changing an existing one",
                "tags": [
                    "Audit"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "question",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "result": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "compliant",
                                            "noncompliant",
                                            "improvement_required",
                                            "not_applicable",
                                            "not_evaluated",
                                            null
                                        ]
                                    },
                                    "comment": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "lock_version": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "question": {
                                                    "type": "string"
                                                },
                                                "result": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "comment": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "lock_version": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "question",
                                                "result",
                                                "comment",
                                                "lock_version"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/audit\/summary": {
            "put": {
                "operationId": "v1.services.audit.summary",
                "tags": [
                    "Audit"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "summary": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "summary": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "lock_version": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "summary",
                                                "lock_version"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/auth\/token": {
            "post": {
                "operationId": "v1.auth.token",
                "summary": "Issue a token",
                "tags": [
                    "Auth"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "format": "email"
                                    },
                                    "password": {
                                        "type": "string"
                                    },
                                    "device_name": {
                                        "type": "string",
                                        "maxLength": 100
                                    },
                                    "code": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 32
                                    }
                                },
                                "required": [
                                    "email",
                                    "password",
                                    "device_name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "token": {
                                            "type": "string"
                                        },
                                        "token_type": {
                                            "type": "string",
                                            "const": "Bearer"
                                        },
                                        "expires_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "token",
                                        "token_type",
                                        "expires_at"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                },
                "security": []
            },
            "delete": {
                "operationId": "v1.auth.revoke",
                "summary": "Revoke the token used for this request",
                "tags": [
                    "Auth"
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/corrective-actions": {
            "get": {
                "operationId": "v1.corrective-actions.index",
                "summary": "Corrective actions of the organization (filter by status, facility, overdue)",
                "tags": [
                    "CorrectiveAction"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    {
                        "name": "facility_id",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    {
                        "name": "overdue",
                        "in": "query",
                        "schema": {
                            "type": [
                                "boolean",
                                "null"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "title": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "kind": {
                                                        "type": "string"
                                                    },
                                                    "priority": {
                                                        "type": "string"
                                                    },
                                                    "owner_party": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "due_date": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "resolution": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "facility": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "name"
                                                        ]
                                                    },
                                                    "lock_version": {
                                                        "type": "integer"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "title",
                                                    "description",
                                                    "kind",
                                                    "priority",
                                                    "owner_party",
                                                    "status",
                                                    "due_date",
                                                    "resolution",
                                                    "facility",
                                                    "lock_version"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "per_page",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/corrective-actions": {
            "post": {
                "operationId": "v1.services.corrective-actions.store",
                "summary": "Raise an action from a service in the field (finding, defect, recommendation). Allowed to\nwhoever can work on the service, or to action managers. client_uuid makes retries safe",
                "tags": [
                    "CorrectiveAction"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "title": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "kind": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "corrective",
                                            "preventive",
                                            "recommendation",
                                            "follow_up",
                                            null
                                        ]
                                    },
                                    "priority": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "low",
                                            "medium",
                                            "high",
                                            "critical",
                                            null
                                        ]
                                    },
                                    "owner_party": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "provider",
                                            "customer",
                                            null
                                        ]
                                    },
                                    "due_date": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "title",
                                    "client_uuid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "423": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/corrective-actions\/{action}": {
            "get": {
                "operationId": "v1.corrective-actions.show",
                "summary": "One corrective action, within the member's facilities (anything else is not found)",
                "tags": [
                    "CorrectiveAction"
                ],
                "parameters": [
                    {
                        "name": "action",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "priority": {
                                                    "type": "string"
                                                },
                                                "owner_party": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "due_date": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "resolution": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "facility": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                },
                                                "lock_version": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "title",
                                                "description",
                                                "kind",
                                                "priority",
                                                "owner_party",
                                                "status",
                                                "due_date",
                                                "resolution",
                                                "facility",
                                                "lock_version"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/corrective-actions\/{action}\/transition": {
            "post": {
                "operationId": "v1.corrective-actions.transition",
                "summary": "Move an action through its lifecycle (open \u2192 in_progress \u2192 done \u2192 verified)",
                "tags": [
                    "CorrectiveAction"
                ],
                "parameters": [
                    {
                        "name": "action",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "to": {
                                        "type": "string",
                                        "enum": [
                                            "open",
                                            "in_progress",
                                            "done",
                                            "verified",
                                            "cancelled"
                                        ]
                                    },
                                    "resolution": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "lock_version": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "to"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "kind": {
                                                    "type": "string"
                                                },
                                                "priority": {
                                                    "type": "string"
                                                },
                                                "owner_party": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "due_date": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "resolution": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "facility": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                },
                                                "lock_version": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "title",
                                                "description",
                                                "kind",
                                                "priority",
                                                "owner_party",
                                                "status",
                                                "due_date",
                                                "resolution",
                                                "facility",
                                                "lock_version"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/customers": {
            "get": {
                "operationId": "v1.customers.index",
                "summary": "List customers (search by name, tax id or email)",
                "tags": [
                    "Customer"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `CustomerResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/CustomerResource"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.customers.store",
                "summary": "Create a customer. An existing customer with the same tax id is returned instead of a duplicate",
                "tags": [
                    "Customer"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "kind": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "enum": [
                                            "company",
                                            "individual",
                                            null
                                        ]
                                    },
                                    "tax_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "email",
                                        "maxLength": 255
                                    },
                                    "phone": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "country_code": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "minLength": 2,
                                        "maxLength": 2
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`CustomerResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/CustomerResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/customers\/{customer}": {
            "get": {
                "operationId": "v1.customers.show",
                "tags": [
                    "Customer"
                ],
                "parameters": [
                    {
                        "name": "customer",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`CustomerResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#\/components\/schemas\/CustomerResource"
                                                },
                                                {
                                                    "type": "object",
                                                    "required": [
                                                        "facilities"
                                                    ]
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/devices": {
            "post": {
                "operationId": "v1.devices.store",
                "tags": [
                    "Device"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "token": {
                                        "type": "string",
                                        "pattern": "^(ExponentPushToken|ExpoPushToken)\\[[A-Za-z0-9_-]+\\]$",
                                        "maxLength": 255
                                    },
                                    "platform": {
                                        "type": "string",
                                        "enum": [
                                            "ios",
                                            "android"
                                        ]
                                    },
                                    "locale": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10
                                    }
                                },
                                "required": [
                                    "token",
                                    "platform"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "v1.devices.destroy",
                "summary": "Stop notifications on this device (sign-out)",
                "tags": [
                    "Device"
                ],
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 255
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/expenses": {
            "get": {
                "operationId": "v1.services.expenses.index",
                "tags": [
                    "Expense"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.services.expenses.store",
                "summary": "Record an expense (multipart when a receipt photo is attached). client_uuid makes retries safe",
                "tags": [
                    "Expense"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart\/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "category": {
                                        "type": "string",
                                        "enum": [
                                            "travel",
                                            "parking",
                                            "tolls",
                                            "materials",
                                            "subcontractor",
                                            "accommodation",
                                            "meals",
                                            "other"
                                        ]
                                    },
                                    "description": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "amount": {
                                        "type": "number",
                                        "maximum": 100000
                                    },
                                    "incurred_on": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "billable": {
                                        "type": [
                                            "boolean",
                                            "null"
                                        ]
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "maxLength": 64
                                    },
                                    "receipt": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "binary",
                                        "contentMediaType": "application\/octet-stream",
                                        "description": "Maximum file size: 5120 kilobytes."
                                    }
                                },
                                "required": [
                                    "category",
                                    "description",
                                    "amount",
                                    "incurred_on",
                                    "client_uuid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/expenses\/{expense}\/decide": {
            "post": {
                "operationId": "v1.expenses.decide",
                "summary": "Approve or reject (with a reason). Nobody decides on their own expense",
                "tags": [
                    "Expense"
                ],
                "parameters": [
                    {
                        "name": "expense",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "approve": {
                                        "type": "boolean"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    }
                                },
                                "required": [
                                    "approve"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "category": {
                                                    "type": "string"
                                                },
                                                "description": {
                                                    "type": "string"
                                                },
                                                "amount_cents": {
                                                    "type": "integer"
                                                },
                                                "currency": {
                                                    "type": "string"
                                                },
                                                "incurred_on": {
                                                    "type": "string"
                                                },
                                                "billable": {
                                                    "type": "boolean"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "decision_note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "has_receipt": {
                                                    "type": "boolean"
                                                },
                                                "mine": {
                                                    "type": "boolean"
                                                },
                                                "client_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "category",
                                                "description",
                                                "amount_cents",
                                                "currency",
                                                "incurred_on",
                                                "billable",
                                                "status",
                                                "decision_note",
                                                "has_receipt",
                                                "mine",
                                                "client_uuid"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/facilities": {
            "get": {
                "operationId": "v1.facilities.index",
                "summary": "Own facilities the member may access, plus facilities shared with the organization",
                "tags": [
                    "Facility"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `FacilityResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/FacilityResource"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/facilities\/{facility}": {
            "get": {
                "operationId": "v1.facilities.show",
                "tags": [
                    "Facility"
                ],
                "parameters": [
                    {
                        "name": "facility",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`FacilityResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/FacilityResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/haccp\/facilities": {
            "get": {
                "operationId": "v1.haccp.facilities",
                "summary": "Facilities where the member records HACCP checks: the organization's own (within the member's\nrestrictions) and those shared with it for record keeping. Unlike \/facilities this needs only\nhaccp.records.create, so kitchen staff can find their checks",
                "tags": [
                    "HaccpRecord"
                ],
                "responses": {
                    "200": {
                        "description": "Paginated set of `FacilityResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/FacilityResource"
                                            }
                                        },
                                        "links": {
                                            "type": "object",
                                            "properties": {
                                                "first": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "last": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prev": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "next": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "first",
                                                "last",
                                                "prev",
                                                "next"
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "from": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "minimum": 1
                                                },
                                                "last_page": {
                                                    "type": "integer",
                                                    "minimum": 1
                                                },
                                                "links": {
                                                    "type": "array",
                                                    "description": "Generated paginator links.",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "url": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "label": {
                                                                "type": "string"
                                                            },
                                                            "active": {
                                                                "type": "boolean"
                                                            }
                                                        },
                                                        "required": [
                                                            "url",
                                                            "label",
                                                            "active"
                                                        ]
                                                    }
                                                },
                                                "path": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "Base path for paginator generated URLs."
                                                },
                                                "per_page": {
                                                    "type": "integer",
                                                    "description": "Number of items shown per page.",
                                                    "minimum": 0
                                                },
                                                "to": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ],
                                                    "description": "Number of the last item in the slice.",
                                                    "minimum": 1
                                                },
                                                "total": {
                                                    "type": "integer",
                                                    "description": "Total number of items being paginated.",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "from",
                                                "last_page",
                                                "links",
                                                "path",
                                                "per_page",
                                                "to",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "links",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/facilities\/{facility}\/daily-checks": {
            "get": {
                "operationId": "v1.facilities.daily",
                "summary": "Today's checks for a facility (in the facility's time zone), with what is done and overdue",
                "tags": [
                    "HaccpRecord"
                ],
                "parameters": [
                    {
                        "name": "facility",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "schedule": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "frequency": {
                                                                "type": "string"
                                                            },
                                                            "record_type": {
                                                                "type": "string"
                                                            },
                                                            "fields": {
                                                                "type": "array",
                                                                "items": {
                                                                    "type": "array",
                                                                    "items": {}
                                                                }
                                                            },
                                                            "approved_limits": {
                                                                "type": [
                                                                    "array",
                                                                    "null"
                                                                ],
                                                                "items": {}
                                                            },
                                                            "equipment": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "name",
                                                            "frequency",
                                                            "record_type",
                                                            "fields",
                                                            "approved_limits",
                                                            "equipment"
                                                        ]
                                                    },
                                                    "slot_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "overdue": {
                                                        "type": "string"
                                                    },
                                                    "record": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string"
                                                            },
                                                            "values": {
                                                                "type": [
                                                                    "array",
                                                                    "null"
                                                                ],
                                                                "items": {}
                                                            },
                                                            "out_of_limits": {
                                                                "type": "boolean"
                                                            },
                                                            "deviations": {
                                                                "type": [
                                                                    "array",
                                                                    "null"
                                                                ],
                                                                "items": {}
                                                            },
                                                            "remarks": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "slot_at": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "recorded_at": {
                                                                "type": "string"
                                                            },
                                                            "client_uuid": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "status",
                                                            "values",
                                                            "out_of_limits",
                                                            "deviations",
                                                            "remarks",
                                                            "slot_at",
                                                            "recorded_at",
                                                            "client_uuid"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "schedule",
                                                    "slot_at",
                                                    "overdue",
                                                    "record"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "timezone": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "timezone"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/facilities\/{facility}\/records": {
            "post": {
                "operationId": "v1.facilities.records.store",
                "summary": "Save a record. Send a client_uuid generated on the device: retries return the same record.\nValues outside the approved limits require remarks and open a corrective action",
                "tags": [
                    "HaccpRecord"
                ],
                "parameters": [
                    {
                        "name": "facility",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "schedule_id": {
                                        "type": "string"
                                    },
                                    "slot_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "values": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "minItems": 1
                                    },
                                    "remarks": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "schedule_id",
                                    "values",
                                    "client_uuid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/samples": {
            "get": {
                "operationId": "v1.services.samples.index",
                "tags": [
                    "Lab"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "editable": {
                                                    "type": "string"
                                                },
                                                "types": {
                                                    "type": "array",
                                                    "prefixItems": [
                                                        {
                                                            "type": "string",
                                                            "const": "food"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "surface"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "water"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "air"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "other"
                                                        }
                                                    ],
                                                    "minItems": 5,
                                                    "maxItems": 5
                                                },
                                                "custody_events": {
                                                    "type": "array",
                                                    "prefixItems": [
                                                        {
                                                            "type": "string",
                                                            "const": "collected"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "sealed"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "dispatched"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "received"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "transferred"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "analysis_started"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "results_issued"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "disposed"
                                                        }
                                                    ],
                                                    "minItems": 8,
                                                    "maxItems": 8
                                                },
                                                "samples": {
                                                    "anyOf": [
                                                        {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object",
                                                                "properties": {
                                                                    "id": {
                                                                        "type": "string"
                                                                    },
                                                                    "code": {
                                                                        "type": "string"
                                                                    },
                                                                    "sample_type": {
                                                                        "type": "string"
                                                                    },
                                                                    "matrix": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "description": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "sampling_location": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "status": {
                                                                        "type": "string"
                                                                    },
                                                                    "collected_at": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "temperature_at_collection": {
                                                                        "type": [
                                                                            "number",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "laboratory_name": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "client_uuid": {
                                                                        "type": [
                                                                            "string",
                                                                            "null"
                                                                        ]
                                                                    },
                                                                    "custody": {
                                                                        "type": "array",
                                                                        "items": {
                                                                            "type": "string"
                                                                        }
                                                                    }
                                                                },
                                                                "required": [
                                                                    "id",
                                                                    "code",
                                                                    "sample_type",
                                                                    "matrix",
                                                                    "description",
                                                                    "sampling_location",
                                                                    "status",
                                                                    "collected_at",
                                                                    "temperature_at_collection",
                                                                    "laboratory_name",
                                                                    "client_uuid",
                                                                    "custody"
                                                                ]
                                                            }
                                                        }
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "editable",
                                                "types",
                                                "custody_events",
                                                "samples"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.services.samples.store",
                "summary": "Register a collected sample. client_uuid makes retries safe",
                "tags": [
                    "Lab"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "sample_type": {
                                        "type": "string",
                                        "enum": [
                                            "food",
                                            "surface",
                                            "water",
                                            "air",
                                            "other"
                                        ]
                                    },
                                    "matrix": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "description": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "sampling_location": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "collection_method": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "quantity": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": 0
                                    },
                                    "unit": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 16
                                    },
                                    "temperature_at_collection": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": -80,
                                        "maximum": 100
                                    },
                                    "laboratory_name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "collected_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "sample_type",
                                    "client_uuid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/lab\/samples\/{sample}\/custody": {
            "post": {
                "operationId": "v1.lab.samples.custody",
                "summary": "Append a chain-of-custody event (sealed, dispatched, received, \u2026). client_uuid makes retries safe",
                "tags": [
                    "Lab"
                ],
                "parameters": [
                    {
                        "name": "sample",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "event": {
                                        "type": "string",
                                        "enum": [
                                            "collected",
                                            "sealed",
                                            "dispatched",
                                            "received",
                                            "transferred",
                                            "analysis_started",
                                            "results_issued",
                                            "disposed"
                                        ]
                                    },
                                    "occurred_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "from_party": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "to_party": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "temperature": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": -80,
                                        "maximum": 100
                                    },
                                    "seal_number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "notes": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "client_uuid": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "event"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/inventory\/items": {
            "get": {
                "operationId": "v1.inventory.items",
                "summary": "Active catalogue items (no costs: valuation is internal)",
                "tags": [
                    "Materials"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/inventory\/locations": {
            "get": {
                "operationId": "v1.inventory.locations",
                "summary": "Stock locations the member may take from: their vehicle, warehouses, or all for managers",
                "tags": [
                    "Materials"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/inventory\/locations\/{location}\/levels": {
            "get": {
                "operationId": "v1.inventory.levels",
                "summary": "Quantities at one allowed location",
                "tags": [
                    "Materials"
                ],
                "parameters": [
                    {
                        "name": "location",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/materials": {
            "get": {
                "operationId": "v1.services.materials.index",
                "summary": "Materials consumed on a service, with returns",
                "tags": [
                    "Materials"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.services.materials.store",
                "summary": "Record a consumption. client_uuid makes device retries safe",
                "tags": [
                    "Materials"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "item_id": {
                                        "type": "string"
                                    },
                                    "location_id": {
                                        "type": "string"
                                    },
                                    "quantity": {
                                        "type": "number",
                                        "maximum": 1000000
                                    },
                                    "batch": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "item_id",
                                    "location_id",
                                    "quantity",
                                    "client_uuid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/materials\/{movement}\/return": {
            "post": {
                "operationId": "v1.services.materials.return",
                "summary": "Undo a consumption (returns the material to where it came from)",
                "tags": [
                    "Materials"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "movement",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "item": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "unit": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name",
                                                        "unit"
                                                    ]
                                                },
                                                "location": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "name"
                                                    ]
                                                },
                                                "quantity": {
                                                    "type": "number"
                                                },
                                                "batch": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "returned": {
                                                    "type": "boolean"
                                                },
                                                "client_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "occurred_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "item",
                                                "location",
                                                "quantity",
                                                "batch",
                                                "returned",
                                                "client_uuid",
                                                "occurred_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/me": {
            "get": {
                "operationId": "v1.me",
                "summary": "The authenticated user and the organizations they can act in",
                "tags": [
                    "Me"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "locale": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "description": "A stored pilot language no longer applies once the pilot is switched off."
                                                },
                                                "interface_locales": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "code": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            },
                                                            "status": {
                                                                "type": "string",
                                                                "enum": [
                                                                    "complete",
                                                                    "pilot",
                                                                    "prepared"
                                                                ]
                                                            },
                                                            "rtl": {
                                                                "type": "boolean"
                                                            },
                                                            "notice": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ],
                                                                "description": "Pilot languages are partial and unreviewed for safety-critical instructions."
                                                            }
                                                        },
                                                        "required": [
                                                            "code",
                                                            "name",
                                                            "status",
                                                            "rtl",
                                                            "notice"
                                                        ]
                                                    }
                                                },
                                                "uploads": {
                                                    "type": "object",
                                                    "properties": {
                                                        "photo_max_kb": {
                                                            "type": "integer"
                                                        },
                                                        "video_max_kb": {
                                                            "type": "integer"
                                                        },
                                                        "video_max_seconds": {
                                                            "type": "integer"
                                                        }
                                                    },
                                                    "required": [
                                                        "photo_max_kb",
                                                        "video_max_kb",
                                                        "video_max_seconds"
                                                    ]
                                                },
                                                "organizations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "email",
                                                "timezone",
                                                "locale",
                                                "interface_locales",
                                                "uploads",
                                                "organizations"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/me\/locale": {
            "put": {
                "operationId": "v1.me.locale",
                "summary": "Save the user's interface language (shared by the web app and the mobile app)",
                "tags": [
                    "Me"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "locale": {
                                        "type": "string",
                                        "enum": [
                                            "en",
                                            "pt_PT",
                                            "es",
                                            "de",
                                            "nb",
                                            "sv",
                                            "fi",
                                            "da",
                                            "pt_BR",
                                            "fr",
                                            "ar"
                                        ]
                                    }
                                },
                                "required": [
                                    "locale"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "locale": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "locale"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/notifications": {
            "get": {
                "operationId": "v1.notifications.index",
                "tags": [
                    "Notification"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "type": {
                                                        "type": "string"
                                                    },
                                                    "message": {
                                                        "type": "string"
                                                    },
                                                    "target": {},
                                                    "read_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "type",
                                                    "message",
                                                    "target",
                                                    "read_at",
                                                    "created_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "unread": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "per_page",
                                                "total",
                                                "unread"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/notifications\/read-all": {
            "post": {
                "operationId": "v1.notifications.read-all",
                "tags": [
                    "Notification"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "updated": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "updated"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/notifications\/{notification}\/read": {
            "post": {
                "operationId": "v1.notifications.read",
                "tags": [
                    "Notification"
                ],
                "parameters": [
                    {
                        "name": "notification",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "read_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "read_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/facilities\/{facility}\/monitoring-points": {
            "get": {
                "operationId": "v1.facilities.points",
                "summary": "Active monitoring points this organization maintains at a facility, with their device type metrics",
                "tags": [
                    "Pest"
                ],
                "parameters": [
                    {
                        "name": "facility",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/readings\/{point}": {
            "put": {
                "operationId": "v1.services.readings.update",
                "summary": "Record or update the reading of one point during a pest control service.\nSend the reading's lock_version when updating an existing reading",
                "tags": [
                    "Pest"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "point",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "ok",
                                            "activity",
                                            "damaged",
                                            "missing",
                                            "inaccessible",
                                            "replaced",
                                            "not_checked"
                                        ]
                                    },
                                    "values": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    },
                                    "pest_counts": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "integer",
                                            "minimum": 0,
                                            "maximum": 100000
                                        }
                                    },
                                    "notes": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "lock_version": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "monitoring_point_id": {
                                                    "type": "string"
                                                },
                                                "status": {
                                                    "type": "string"
                                                },
                                                "values": {
                                                    "type": [
                                                        "array",
                                                        "null"
                                                    ],
                                                    "items": {}
                                                },
                                                "capture_total": {
                                                    "type": "integer"
                                                },
                                                "notes": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "lock_version": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "monitoring_point_id",
                                                "status",
                                                "values",
                                                "capture_total",
                                                "notes",
                                                "lock_version"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/reports": {
            "get": {
                "operationId": "v1.reports.index",
                "summary": "Approved reports visible to the member: issued by the organization or shared with it",
                "tags": [
                    "Report"
                ],
                "parameters": [
                    {
                        "name": "facility_id",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 48
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {},
                                                "per_page": {},
                                                "total": {
                                                    "type": "integer",
                                                    "minimum": 0
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "per_page",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/reports\/{report}": {
            "get": {
                "operationId": "v1.reports.show",
                "tags": [
                    "Report"
                ],
                "parameters": [
                    {
                        "name": "report",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/reports\/{report}\/pdf": {
            "get": {
                "operationId": "v1.reports.pdf",
                "summary": "PDF of the current revision (or ?revision=N). Never a public URL: streamed after authorization",
                "tags": [
                    "Report"
                ],
                "parameters": [
                    {
                        "name": "report",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/octet-stream": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        },
                        "headers": {
                            "Transfer-Encoding": {
                                "required": true,
                                "schema": {
                                    "type": "string",
                                    "enum": [
                                        "chunked"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/requisitions": {
            "get": {
                "operationId": "v1.requisitions.index",
                "tags": [
                    "Requisition"
                ],
                "parameters": [
                    {
                        "name": "filter",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "mine",
                                "pending",
                                "to_issue",
                                "all",
                                null
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "needed_by": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "requester": {
                                                        "type": "string"
                                                    },
                                                    "mine": {
                                                        "type": "boolean"
                                                    },
                                                    "destination": {
                                                        "type": "object",
                                                        "properties": {
                                                            "id": {
                                                                "type": "string"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "name"
                                                        ]
                                                    },
                                                    "lines_count": {
                                                        "anyOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "integer",
                                                                "minimum": 0
                                                            }
                                                        ]
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "number",
                                                    "status",
                                                    "needed_by",
                                                    "requester",
                                                    "mine",
                                                    "destination",
                                                    "lines_count",
                                                    "created_at"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                },
                                                "filter": {
                                                    "type": [
                                                        "string",
                                                        "array",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "per_page",
                                                "total",
                                                "filter"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.requisitions.store",
                "summary": "Submit a requisition. Send a client_uuid (and an Idempotency-Key): a retry returns the same requisition",
                "tags": [
                    "Requisition"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "destination_id": {
                                        "type": "string"
                                    },
                                    "needed_by": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "notes": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    },
                                    "client_uuid": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    },
                                    "lines": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "item_id": {
                                                    "type": "string"
                                                },
                                                "quantity": {
                                                    "type": "number",
                                                    "maximum": 1000000
                                                }
                                            },
                                            "required": [
                                                "item_id",
                                                "quantity"
                                            ]
                                        },
                                        "minItems": 1,
                                        "maxItems": 100
                                    }
                                },
                                "required": [
                                    "destination_id",
                                    "lines"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/requisitions\/locations": {
            "get": {
                "operationId": "v1.requisitions.locations",
                "summary": "Destinations the member may request for, and warehouses to issue from",
                "tags": [
                    "Requisition"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "destinations": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "sources": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "destinations",
                                                "sources"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/requisitions\/{requisition}": {
            "get": {
                "operationId": "v1.requisitions.show",
                "tags": [
                    "Requisition"
                ],
                "parameters": [
                    {
                        "name": "requisition",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/requisitions\/{requisition}\/decide": {
            "post": {
                "operationId": "v1.requisitions.decide",
                "summary": "Approve (optionally with changed quantities per item) or reject with a reason",
                "tags": [
                    "Requisition"
                ],
                "parameters": [
                    {
                        "name": "requisition",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "approve": {
                                        "type": "boolean"
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 500
                                    },
                                    "quantities": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "number",
                                            "minimum": 0,
                                            "maximum": 1000000
                                        }
                                    }
                                },
                                "required": [
                                    "approve"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/requisitions\/{requisition}\/issue": {
            "post": {
                "operationId": "v1.requisitions.issue",
                "tags": [
                    "Requisition"
                ],
                "parameters": [
                    {
                        "name": "requisition",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "source_id": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "source_id"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/requisitions\/{requisition}\/deliver": {
            "post": {
                "operationId": "v1.requisitions.deliver",
                "tags": [
                    "Requisition"
                ],
                "parameters": [
                    {
                        "name": "requisition",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/requisitions\/{requisition}\/cancel": {
            "post": {
                "operationId": "v1.requisitions.cancel",
                "tags": [
                    "Requisition"
                ],
                "parameters": [
                    {
                        "name": "requisition",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/scan\/{code}": {
            "get": {
                "operationId": "v1.scan",
                "summary": "Resolve a scanned QR code (the token, or the full label URL) to what it identifies, plus the\ncaller's pest control service in progress at that facility, if any. Codes the member may not\nwork on are reported as not found, exactly like unknown codes",
                "tags": [
                    "Scan"
                ],
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string",
                                                    "const": "monitoring_point"
                                                },
                                                "monitoring_point": {
                                                    "type": "object",
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "code": {
                                                            "type": "string"
                                                        },
                                                        "location": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "is_outdoor": {
                                                            "type": "boolean"
                                                        },
                                                        "area": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "device_type": {
                                                            "type": "object",
                                                            "properties": {
                                                                "code": {
                                                                    "type": "string"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                },
                                                                "metrics": {
                                                                    "type": "array",
                                                                    "items": {}
                                                                }
                                                            },
                                                            "required": [
                                                                "code",
                                                                "name",
                                                                "metrics"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "code",
                                                        "location",
                                                        "is_outdoor",
                                                        "area",
                                                        "device_type"
                                                    ]
                                                },
                                                "facility": {
                                                    "$ref": "#\/components\/schemas\/FacilityResource"
                                                },
                                                "service_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "monitoring_point",
                                                "facility",
                                                "service_id"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#\/components\/responses\/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/my-work": {
            "get": {
                "operationId": "v1.my-work",
                "summary": "Services assigned to the authenticated professional between two dates (default: today)",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Array of `ServiceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#\/components\/schemas\/ServiceResource"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services": {
            "get": {
                "operationId": "v1.services.index",
                "summary": "Services of the organization for reviewers and managers (filter by status, facility, date),\nwithin the member's facilities. Technicians use \/my-work",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "maxLength": 200
                        }
                    },
                    {
                        "name": "facility_id",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {}
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "per_page",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}": {
            "get": {
                "operationId": "v1.services.show",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ServiceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ServiceResource"
                                        },
                                        "meta": {
                                            "anyOf": [
                                                {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "minItems": 0,
                                                    "maxItems": 0
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "pest_inspection": {
                                                            "type": "object",
                                                            "properties": {
                                                                "lock_version": {
                                                                    "type": "integer"
                                                                },
                                                                "readings": {
                                                                    "type": "array",
                                                                    "items": {
                                                                        "type": "string"
                                                                    }
                                                                }
                                                            },
                                                            "required": [
                                                                "lock_version",
                                                                "readings"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "pest_inspection"
                                                    ]
                                                },
                                                {
                                                    "type": "object"
                                                }
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/start": {
            "post": {
                "operationId": "v1.services.start",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ServiceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ServiceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/finish": {
            "post": {
                "operationId": "v1.services.finish",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "summary": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 20000
                                    },
                                    "lock_version": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ServiceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ServiceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/approve": {
            "post": {
                "operationId": "v1.services.approve",
                "summary": "Approve a finished service (reviewers). The report is issued as on the web",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`ServiceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ServiceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/return": {
            "post": {
                "operationId": "v1.services.return",
                "summary": "Return a finished service to the professional for correction, with the reason",
                "tags": [
                    "Service"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "lock_version": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "reason"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`ServiceResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/ServiceResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/evidence": {
            "get": {
                "operationId": "v1.services.evidence.index",
                "summary": "Photos and videos the server has stored for a service (the app shows them as confirmed)",
                "tags": [
                    "ServiceEvidence"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "v1.services.evidence.store",
                "summary": "Attach a photo or a short video to a service (multipart: photo or video, client_uuid,\noptional caption). Clients compress on the device; the server caps the size (see \/me\nuploads). The client_uuid makes retries safe: the same uuid returns the file already\nstored (200) instead of storing it twice",
                "tags": [
                    "ServiceEvidence"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart\/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "photo": {
                                        "type": "string",
                                        "format": "binary",
                                        "contentMediaType": "application\/octet-stream",
                                        "description": "Maximum file size: 5120 kilobytes."
                                    },
                                    "video": {
                                        "type": "string",
                                        "format": "binary",
                                        "contentMediaType": "application\/octet-stream",
                                        "description": "Maximum file size: 51200 kilobytes."
                                    },
                                    "client_uuid": {
                                        "type": "string",
                                        "maxLength": 64
                                    },
                                    "caption": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    }
                                },
                                "required": [
                                    "client_uuid"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "category": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "mime_type": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "size_bytes": {
                                                    "type": "integer"
                                                },
                                                "sha256": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "client_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "category",
                                                "title",
                                                "mime_type",
                                                "size_bytes",
                                                "sha256",
                                                "client_uuid",
                                                "created_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "category": {
                                                    "type": "string"
                                                },
                                                "title": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "mime_type": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "size_bytes": {
                                                    "type": "integer"
                                                },
                                                "sha256": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "client_uuid": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "created_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "category",
                                                "title",
                                                "mime_type",
                                                "size_bytes",
                                                "sha256",
                                                "client_uuid",
                                                "created_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/signatures": {
            "post": {
                "operationId": "v1.services.signatures.store",
                "summary": "Sign a service (technician or customer) with a PNG data URL. Signatures are stored on their\nown and never change the service data. Allowed while the service can be edited, and on\nfinished services waiting for review (customer sign-off after the work)",
                "tags": [
                    "ServiceEvidence"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "role": {
                                        "type": "string",
                                        "enum": [
                                            "technician",
                                            "customer"
                                        ]
                                    },
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "data": {
                                        "type": "string",
                                        "maxLength": 800000
                                    }
                                },
                                "required": [
                                    "role",
                                    "name",
                                    "data"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "role": {
                                                    "type": "string"
                                                },
                                                "signer_name": {
                                                    "type": "string"
                                                },
                                                "signed_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "role",
                                                "signer_name",
                                                "signed_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "$ref": "#\/components\/responses\/AuthorizationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/training": {
            "get": {
                "operationId": "v1.services.training.show",
                "tags": [
                    "Training"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "course_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "language": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "notes": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "actual_start": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "actual_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "editable": {
                                                    "type": "string"
                                                },
                                                "courses": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "attendance_values": {
                                                    "type": "array",
                                                    "prefixItems": [
                                                        {
                                                            "type": "string",
                                                            "const": "registered"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "present"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "partial"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "absent"
                                                        }
                                                    ],
                                                    "minItems": 4,
                                                    "maxItems": 4
                                                },
                                                "participants": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "course_id",
                                                "location",
                                                "language",
                                                "notes",
                                                "timezone",
                                                "actual_start",
                                                "actual_end",
                                                "editable",
                                                "courses",
                                                "attendance_values",
                                                "participants"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "v1.services.training.update",
                "summary": "Course, location, notes and actual start \/ end (facility local time or ISO 8601)",
                "tags": [
                    "Training"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "course_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "location": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "language": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10
                                    },
                                    "notes": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 5000
                                    },
                                    "actual_start": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "actual_end": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "course_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "location": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "language": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "notes": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "timezone": {
                                                    "type": "string"
                                                },
                                                "actual_start": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "actual_end": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "editable": {
                                                    "type": "string"
                                                },
                                                "courses": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "attendance_values": {
                                                    "type": "array",
                                                    "prefixItems": [
                                                        {
                                                            "type": "string",
                                                            "const": "registered"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "present"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "partial"
                                                        },
                                                        {
                                                            "type": "string",
                                                            "const": "absent"
                                                        }
                                                    ],
                                                    "minItems": 4,
                                                    "maxItems": 4
                                                },
                                                "participants": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "course_id",
                                                "location",
                                                "language",
                                                "notes",
                                                "timezone",
                                                "actual_start",
                                                "actual_end",
                                                "editable",
                                                "courses",
                                                "attendance_values",
                                                "participants"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/services\/{service}\/training\/participants": {
            "post": {
                "operationId": "v1.services.training.participants.store",
                "summary": "Add a participant. Adding the same person again returns the existing row",
                "tags": [
                    "Training"
                ],
                "parameters": [
                    {
                        "name": "service",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 255
                                    },
                                    "email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "email",
                                        "maxLength": 255
                                    },
                                    "job_title": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "employee_reference": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 64
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/training\/participants\/{participant}\/attendance": {
            "put": {
                "operationId": "v1.training.participants.attendance",
                "summary": "Attendance, minutes and assessment score. Send lock_version to detect a concurrent change",
                "tags": [
                    "Training"
                ],
                "parameters": [
                    {
                        "name": "participant",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "attendance": {
                                        "type": "string",
                                        "enum": [
                                            "registered",
                                            "present",
                                            "partial",
                                            "absent"
                                        ]
                                    },
                                    "minutes": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 1440
                                    },
                                    "score": {
                                        "type": [
                                            "number",
                                            "null"
                                        ],
                                        "minimum": 0,
                                        "maximum": 100
                                    },
                                    "lock_version": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "attendance"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "job_title": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "employee_reference": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "attendance": {
                                                    "type": "string"
                                                },
                                                "minutes": {
                                                    "type": [
                                                        "integer",
                                                        "null"
                                                    ]
                                                },
                                                "score": {
                                                    "type": [
                                                        "number",
                                                        "null"
                                                    ]
                                                },
                                                "signed": {
                                                    "type": "null"
                                                },
                                                "lock_version": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "email",
                                                "job_title",
                                                "employee_reference",
                                                "attendance",
                                                "minutes",
                                                "score",
                                                "signed",
                                                "lock_version"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/v1\/training\/participants\/{participant}\/signature": {
            "post": {
                "operationId": "v1.training.participants.sign",
                "summary": "Participant signature (PNG data URL), allowed during the session and while it awaits review",
                "tags": [
                    "Training"
                ],
                "parameters": [
                    {
                        "name": "participant",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "data": {
                                        "type": "string",
                                        "maxLength": 800000
                                    }
                                },
                                "required": [
                                    "data"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "role": {
                                                    "type": "string",
                                                    "const": "participant"
                                                },
                                                "signer_name": {
                                                    "type": "string"
                                                },
                                                "signed_at": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "role",
                                                "signer_name",
                                                "signed_at"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "An error",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "description": "Error overview.",
                                            "examples": [
                                                ""
                                            ]
                                        }
                                    },
                                    "required": [
                                        "message"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "http": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "CustomerResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "kind": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "tax_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "phone": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "country_code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string"
                    },
                    "facilities": {
                        "type": "array",
                        "items": {
                            "$ref": "#\/components\/schemas\/FacilityResource"
                        }
                    },
                    "updated_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "kind",
                    "name",
                    "tax_id",
                    "email",
                    "phone",
                    "country_code",
                    "status",
                    "updated_at"
                ],
                "title": "CustomerResource"
            },
            "FacilityResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "code": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "type": {
                        "type": "string"
                    },
                    "address": {
                        "type": "string",
                        "description": "Always a JSON object (never [] when every part is empty), as clients expect."
                    },
                    "timezone": {
                        "type": "string"
                    },
                    "is_active": {
                        "type": "boolean"
                    },
                    "shared_with_us": {
                        "type": "boolean"
                    },
                    "customer_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Collaborators never see the owner's customer or access notes."
                    },
                    "access_notes": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "contact": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {}
                    }
                },
                "required": [
                    "id",
                    "name",
                    "code",
                    "type",
                    "address",
                    "timezone",
                    "is_active",
                    "shared_with_us",
                    "customer_id",
                    "access_notes",
                    "contact"
                ],
                "title": "FacilityResource"
            },
            "ServiceResource": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "service_type": {
                        "type": "string"
                    },
                    "title": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "origin": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "lock_version": {
                        "type": "integer"
                    },
                    "facility": {
                        "$ref": "#\/components\/schemas\/FacilityResource"
                    },
                    "visit": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "status": {
                                "type": "string"
                            },
                            "starts_at": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "ends_at": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "timezone": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "id",
                            "status",
                            "starts_at",
                            "ends_at",
                            "timezone"
                        ]
                    },
                    "responsible_user_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "summary": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "return_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "started_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "completed_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "approved_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    }
                },
                "required": [
                    "id",
                    "service_type",
                    "title",
                    "origin",
                    "status",
                    "lock_version",
                    "facility",
                    "visit",
                    "responsible_user_id",
                    "summary",
                    "return_reason",
                    "started_at",
                    "completed_at",
                    "approved_at"
                ],
                "title": "ServiceResource"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "AuthenticationException": {
                "description": "Unauthenticated",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "AuthorizationException": {
                "description": "Authorization error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}