{
  "components": {
    "schemas": {
      "CompanyDto": {
        "properties": {
          "enabled_statuses": {
            "description": "The statuses the company works with in its app, in the canonical order. All nine when the company has not restricted them.",
            "items": {
              "enum": [
                "open",
                "assigned",
                "pending",
                "fixed",
                "trade_completed",
                "ready_to_inspect",
                "outstanding",
                "closed",
                "in_dispute"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "description": "The id of the company the key belongs to.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the company the key belongs to.",
            "type": "string"
          },
          "statuses": {
            "description": "All nine statuses, in the canonical order, each with its group and the company label.",
            "items": {
              "$ref": "#/components/schemas/CompanyStatusDto"
            },
            "type": "array"
          },
          "timezone": {
            "description": "The company timezone as an IANA name, for example Australia/Sydney. Defect due dates are calendar days in this timezone.",
            "type": "string"
          },
          "type_label": {
            "description": "What the company calls the Type field on a defect. Type when it has not renamed it.",
            "type": "string"
          },
          "vocabulary": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CompanyVocabularyDto"
              }
            ],
            "description": "The wording the company uses for its defects."
          }
        },
        "required": [
          "id",
          "name",
          "timezone",
          "vocabulary",
          "enabled_statuses",
          "statuses",
          "type_label"
        ],
        "type": "object"
      },
      "CompanyStatusDto": {
        "properties": {
          "group": {
            "description": "The group this status falls into. Every defect in this status carries the same group.",
            "enum": [
              "open",
              "in_dispute",
              "pending",
              "fixed",
              "closed"
            ],
            "type": "string"
          },
          "label": {
            "description": "The words the company shows for this status in its app. For display only: branch on status, not on this.",
            "type": "string"
          },
          "status": {
            "description": "The status value a defect carries. These nine values are fixed.",
            "enum": [
              "open",
              "assigned",
              "pending",
              "fixed",
              "trade_completed",
              "ready_to_inspect",
              "outstanding",
              "closed",
              "in_dispute"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "group",
          "label"
        ],
        "type": "object"
      },
      "CompanyVocabularyDto": {
        "properties": {
          "article": {
            "description": "The article that goes before the lower case singular noun: a or an.",
            "type": "string"
          },
          "key": {
            "description": "The wording preset the company uses, for example defects or inspections.",
            "enum": [
              "defects",
              "inspections"
            ],
            "type": "string"
          },
          "plural": {
            "description": "The plural noun, capitalised, for example Defects.",
            "type": "string"
          },
          "plural_lower": {
            "description": "The plural noun in lower case, for example defects.",
            "type": "string"
          },
          "singular": {
            "description": "The singular noun, capitalised, for example Defect.",
            "type": "string"
          },
          "singular_lower": {
            "description": "The singular noun in lower case, for example defect.",
            "type": "string"
          }
        },
        "required": [
          "key",
          "singular",
          "plural",
          "singular_lower",
          "plural_lower",
          "article"
        ],
        "type": "object"
      },
      "CreateDefectBodyDto": {
        "properties": {
          "custom_type_id": {
            "description": "The id of one of the company's own Types, as shown in custom_type on a defect. Null or omitted means no custom type.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "description": {
            "description": "What is wrong, in the words the site team will read. At least one visible character and at most 10,000, or fewer if the company sets its own limit. It is stored exactly as sent.",
            "maxLength": 10000,
            "type": "string"
          },
          "due_date": {
            "description": "The fix-by day as YYYY-MM-DD. Omitted, it is three days after the defect is created. Null means the defect has no fix-by day.",
            "format": "date",
            "nullable": true,
            "type": "string"
          },
          "external_ids": {
            "description": "Your own ids for the defect, as { system, id } pairs, so you can find it again with external_system and external_id. At most 10 entries and each system once. A pair that another defect in the company already holds is refused with external_id_conflict. The defect lists them ordered by system.",
            "items": {
              "$ref": "#/components/schemas/ExternalIdInputDto"
            },
            "maxItems": 10,
            "type": "array"
          },
          "location_id": {
            "description": "The id of a location in the project, as listed by GET /v1/projects/{projectId}/locations. Omit it when the defect has no location, unless the company requires one.",
            "format": "uuid",
            "type": "string"
          },
          "priority": {
            "description": "How urgent the defect is. Omitted, it is medium.",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ],
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project to raise the defect in, as listed by GET /v1/projects. A project the key cannot see is answered exactly like one that does not exist.",
            "format": "uuid",
            "type": "string"
          },
          "type": {
            "description": "The kind of defect. Omitted, it is defect.",
            "enum": [
              "defect",
              "safety",
              "rfi",
              "general",
              "maintenance",
              "warranty",
              "incomplete_works",
              "contract_variation",
              "variation"
            ],
            "type": "string"
          }
        },
        "required": [
          "project_id",
          "description"
        ],
        "type": "object"
      },
      "CreateNoteBodyDto": {
        "properties": {
          "body": {
            "description": "The note, in the words the site team will read. At least one visible character and at most 10,000. Notes from the Public API are always staff only: only the company's own people see them, and nobody outside the company is emailed. Text such as @Jane Smith stays plain text; it does not tag or notify anyone. It is stored exactly as sent.",
            "maxLength": 10000,
            "type": "string"
          }
        },
        "required": [
          "body"
        ],
        "type": "object"
      },
      "DefectCustomTypeDto": {
        "properties": {
          "id": {
            "description": "The id of the company's own Type.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the company's own Type.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "DefectDto": {
        "properties": {
          "closed_at": {
            "description": "When the defect was closed, to the microsecond, in UTC. Null while it is not closed.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "description": "When the defect was created, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DefectPersonDto"
              }
            ],
            "description": "The person who created the defect. Null when that person is not known.",
            "nullable": true,
            "type": "object"
          },
          "custom_type": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DefectCustomTypeDto"
              }
            ],
            "description": "The company's own Type, for a company that keeps its own list. Null otherwise.",
            "nullable": true,
            "type": "object"
          },
          "deleted": {
            "description": "Always false on a defect that exists. A deleted defect is only ever shown as a deletion marker in a sync list.",
            "type": "boolean"
          },
          "description": {
            "description": "The description, exactly as it was entered.",
            "type": "string"
          },
          "due_date": {
            "description": "The day the work is due, as YYYY-MM-DD in the company's time zone (see GET /v1/company). Null when no due date is set.",
            "format": "date",
            "nullable": true,
            "type": "string"
          },
          "external_ids": {
            "description": "The ids an integrator keeps for this defect in their own systems, ordered by system. Empty when there are none.",
            "items": {
              "$ref": "#/components/schemas/DefectExternalIdDto"
            },
            "type": "array"
          },
          "id": {
            "description": "The id of the defect.",
            "format": "uuid",
            "type": "string"
          },
          "is_open": {
            "description": "True while the work is still open: every status except closed and in_dispute.",
            "type": "boolean"
          },
          "issued_to": {
            "description": "One entry per trade the defect is issued to, in the order they were issued. Empty while it is issued to no one.",
            "items": {
              "$ref": "#/components/schemas/DefectTradeLineDto"
            },
            "type": "array"
          },
          "location_id": {
            "description": "The id of the location the defect is at, as listed by GET /v1/projects/{projectId}/locations. Null when it has none.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "location_path": {
            "description": "The names of the location and everything above it, outermost first, each separated by U+203A (single right-pointing angle quotation mark) with a space either side. Null when the defect has no location.",
            "nullable": true,
            "type": "string"
          },
          "modified_at": {
            "description": "When the defect last changed in a way this API shows, to the microsecond, in UTC. A rename of a trade, a location or a person does not move it.",
            "format": "date-time",
            "type": "string"
          },
          "modified_source": {
            "description": "Where the last change came from: app (a person in the app), api (an API write) or sync (a connected system).",
            "enum": [
              "app",
              "api",
              "sync"
            ],
            "type": "string"
          },
          "number": {
            "description": "The number people quote, such as ABC-012: the project code, a dash and the number padded to three digits. Null while the defect has no number yet. It never carries any other text.",
            "nullable": true,
            "type": "string"
          },
          "priority": {
            "description": "The priority.",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ],
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project the defect is in.",
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "description": "The status. These nine values are fixed. Branch on this, not on status_label.",
            "enum": [
              "open",
              "assigned",
              "pending",
              "fixed",
              "trade_completed",
              "ready_to_inspect",
              "outstanding",
              "closed",
              "in_dispute"
            ],
            "type": "string"
          },
          "status_group": {
            "description": "The coarse group the status falls into. Two statuses can share a group, so use status when you need to tell them apart.",
            "enum": [
              "open",
              "in_dispute",
              "pending",
              "fixed",
              "closed"
            ],
            "type": "string"
          },
          "status_label": {
            "description": "The words the defect's project shows for its status: the project's own wording if it has one, else the company's, else the built-in word. For display only.",
            "type": "string"
          },
          "type": {
            "description": "The type.",
            "enum": [
              "defect",
              "safety",
              "rfi",
              "general",
              "maintenance",
              "warranty",
              "incomplete_works",
              "contract_variation",
              "variation"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "project_id",
          "location_id",
          "location_path",
          "description",
          "status",
          "status_group",
          "is_open",
          "status_label",
          "priority",
          "type",
          "custom_type",
          "due_date",
          "created_by",
          "issued_to",
          "external_ids",
          "created_at",
          "closed_at",
          "modified_at",
          "modified_source",
          "deleted"
        ],
        "type": "object"
      },
      "DefectExternalIdDto": {
        "properties": {
          "id": {
            "description": "The id of this defect in that system.",
            "type": "string"
          },
          "system": {
            "description": "The short lower case name the integrator chose for their own system.",
            "type": "string"
          }
        },
        "required": [
          "system",
          "id"
        ],
        "type": "object"
      },
      "DefectListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk. Use it as the updated_since of your next sync.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The defects on this page. Each is the same defect that GET /v1/defects/{defectId} returns, with deleted false. In a list with updated_since a deleted defect appears as a deletion marker with deleted true and only five keys: id, project_id, deleted, deleted_at and modified_at. Branch on deleted.",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/DefectDto"
                },
                {
                  "$ref": "#/components/schemas/DefectTombstoneDto"
                }
              ]
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "DefectPersonDto": {
        "properties": {
          "id": {
            "description": "The id of the person.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the person.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "DefectTombstoneDto": {
        "properties": {
          "deleted": {
            "description": "Always true on a deletion marker. A defect that exists carries deleted false.",
            "enum": [
              true
            ],
            "type": "boolean"
          },
          "deleted_at": {
            "description": "When the defect was deleted, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The id of the deleted defect.",
            "format": "uuid",
            "type": "string"
          },
          "modified_at": {
            "description": "When the deletion was recorded for sync, to the microsecond, in UTC. This is the value updated_since compares with.",
            "format": "date-time",
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project the defect was in.",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "deleted",
          "deleted_at",
          "modified_at"
        ],
        "type": "object"
      },
      "DefectTradeLineDto": {
        "properties": {
          "closed_at": {
            "description": "When this line was closed, to the microsecond, in UTC. Null while it is not closed.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "issued_at": {
            "description": "When the defect was issued to this trade, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "Where this line stands. A line is tracked separately from the defect as a whole.",
            "enum": [
              "open",
              "pending",
              "fixed",
              "closed",
              "in_dispute",
              "trade_completed"
            ],
            "type": "string"
          },
          "trade_id": {
            "description": "The id of the trade, as listed by GET /v1/trades.",
            "format": "uuid",
            "type": "string"
          },
          "trade_name": {
            "description": "The name of the trade.",
            "type": "string"
          }
        },
        "required": [
          "trade_id",
          "trade_name",
          "status",
          "issued_at",
          "closed_at"
        ],
        "type": "object"
      },
      "DiaryDelayDto": {
        "properties": {
          "description": {
            "description": "A description of the delay. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "finish_time": {
            "description": "The local site time the delay ended, HH:MM. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The id of the line.",
            "format": "uuid",
            "type": "string"
          },
          "reason": {
            "description": "The reason for the delay. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "start_time": {
            "description": "The local site time the delay started, HH:MM. Null when not recorded.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "reason",
          "description",
          "start_time",
          "finish_time"
        ],
        "type": "object"
      },
      "DiaryEntryDto": {
        "properties": {
          "accidents": {
            "description": "Accidents recorded for the day. Null when none are recorded.",
            "nullable": true,
            "type": "string"
          },
          "backcharges": {
            "description": "Backcharges recorded for the day. Null when none are recorded.",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "description": "When the entry was created, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "delays": {
            "description": "The delays of the day, oldest line first.",
            "items": {
              "$ref": "#/components/schemas/DiaryDelayDto"
            },
            "type": "array"
          },
          "delays_summary": {
            "description": "The summary of the day's delays. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "deleted": {
            "description": "Always false on an entry returned here. Branch on this key if your code also handles deletion markers.",
            "enum": [
              false
            ],
            "type": "boolean"
          },
          "entry_date": {
            "description": "The calendar day the entry is for, as YYYY-MM-DD.",
            "format": "date",
            "type": "string"
          },
          "id": {
            "description": "The id of the diary entry.",
            "format": "uuid",
            "type": "string"
          },
          "labour": {
            "description": "The labour on site, oldest line first.",
            "items": {
              "$ref": "#/components/schemas/DiaryLabourDto"
            },
            "type": "array"
          },
          "lost_time": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DiaryLostTimeDto"
              }
            ],
            "description": "Time lost on the day."
          },
          "modified_at": {
            "description": "When the entry, or anything under it, last changed, to the microsecond, in UTC. A change to a section line moves it too. Use it to sync.",
            "format": "date-time",
            "type": "string"
          },
          "notes": {
            "description": "The day's notes. Null when there are none.",
            "nullable": true,
            "type": "string"
          },
          "plant": {
            "description": "The plant and equipment on site, oldest line first.",
            "items": {
              "$ref": "#/components/schemas/DiaryPlantDto"
            },
            "type": "array"
          },
          "project_id": {
            "description": "The id of the project the entry is for.",
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "description": "draft while the day is still being written, submitted once it is signed off. Drafts are returned. A submitted entry can still change, because site gate sign-ins and approved timesheets write into it, so a sync reads modified_at, not the status.",
            "enum": [
              "draft",
              "submitted"
            ],
            "type": "string"
          },
          "subcontractors": {
            "description": "The subcontractors on site, oldest line first.",
            "items": {
              "$ref": "#/components/schemas/DiarySubcontractorDto"
            },
            "type": "array"
          },
          "submitted_at": {
            "description": "When the entry was submitted, to the microsecond, in UTC. Null while it is a draft.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "submitted_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DiaryPersonDto"
              }
            ],
            "description": "The person who submitted the entry. Null while it is a draft.",
            "nullable": true,
            "type": "object"
          },
          "total_staff_count": {
            "description": "The total number of staff on site. Null when not recorded.",
            "nullable": true,
            "type": "integer"
          },
          "visitors": {
            "description": "The visitors to site, oldest line first.",
            "items": {
              "$ref": "#/components/schemas/DiaryVisitorDto"
            },
            "type": "array"
          },
          "weather": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DiaryWeatherDto"
              }
            ],
            "description": "The day's weather."
          }
        },
        "required": [
          "id",
          "project_id",
          "entry_date",
          "status",
          "weather",
          "notes",
          "delays_summary",
          "accidents",
          "backcharges",
          "total_staff_count",
          "lost_time",
          "submitted_by",
          "submitted_at",
          "created_at",
          "modified_at",
          "deleted",
          "subcontractors",
          "labour",
          "delays",
          "plant",
          "visitors"
        ],
        "type": "object"
      },
      "DiaryEntryListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The entries on this page, oldest created first. Each is the same entry GET /v1/diary-entries/{entryId} returns, with its five sections and deleted false. In a list with updated_since a deleted entry appears as a deletion marker with deleted true and only five keys: id, project_id, deleted, deleted_at and modified_at. Branch on deleted.",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/DiaryEntryDto"
                },
                {
                  "$ref": "#/components/schemas/DiaryEntryTombstoneDto"
                }
              ]
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "DiaryEntryTombstoneDto": {
        "properties": {
          "deleted": {
            "description": "Always true on a deletion marker. An entry that exists carries deleted false.",
            "enum": [
              true
            ],
            "type": "boolean"
          },
          "deleted_at": {
            "description": "When the entry was deleted, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The id of the deleted diary entry.",
            "format": "uuid",
            "type": "string"
          },
          "modified_at": {
            "description": "When the deletion was recorded for sync, to the microsecond, in UTC. This is the value updated_since compares with.",
            "format": "date-time",
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project the entry was for.",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "deleted",
          "deleted_at",
          "modified_at"
        ],
        "type": "object"
      },
      "DiaryLabourDto": {
        "properties": {
          "activity": {
            "description": "What the person did on the day. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "finish_time": {
            "description": "The local site time they finished, HH:MM. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "hours_type": {
            "description": "The type of hours, such as ordinary or overtime. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The id of the line.",
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "description": "Whether the person is on the company's own staff (staff) or hired through a labour hire company (labour_hire).",
            "enum": [
              "staff",
              "labour_hire"
            ],
            "type": "string"
          },
          "meal_minutes": {
            "description": "The unpaid meal break in minutes. Null when not recorded.",
            "nullable": true,
            "type": "integer"
          },
          "name": {
            "description": "The name written on the line. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "role_label": {
            "description": "The person's role, such as Earthworks Operator. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "start_time": {
            "description": "The local site time they started, HH:MM. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "worked_minutes": {
            "description": "The minutes worked: finish minus start minus the meal break, as the app works it out. A finish before the start is taken as an overnight shift. Null when the line has no start or no finish.",
            "nullable": true,
            "type": "integer"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "role_label",
          "activity",
          "start_time",
          "finish_time",
          "meal_minutes",
          "hours_type",
          "worked_minutes"
        ],
        "type": "object"
      },
      "DiaryLostTimeDto": {
        "properties": {
          "hours": {
            "description": "The hours lost, as a number such as 1.5. Null when none is recorded.",
            "nullable": true,
            "type": "number"
          },
          "industrial": {
            "description": "True when time was lost to industrial action.",
            "type": "boolean"
          },
          "safety": {
            "description": "True when time was lost to a safety matter.",
            "type": "boolean"
          },
          "weather": {
            "description": "True when time was lost to weather.",
            "type": "boolean"
          }
        },
        "required": [
          "weather",
          "safety",
          "industrial",
          "hours"
        ],
        "type": "object"
      },
      "DiaryPersonDto": {
        "properties": {
          "id": {
            "description": "The id of the person.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the person. \"Unknown\" when the person no longer has a readable name.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "DiaryPlantDto": {
        "properties": {
          "company": {
            "description": "The company the plant belongs to. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "description": {
            "description": "A description of the plant or equipment. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The id of the line.",
            "format": "uuid",
            "type": "string"
          },
          "notes": {
            "description": "Notes on the plant. Null when there are none.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "company",
          "description",
          "notes"
        ],
        "type": "object"
      },
      "DiarySubcontractorDto": {
        "properties": {
          "activity": {
            "description": "What the company did on the day. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "company_name": {
            "description": "The company name written on the line. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "finish_time": {
            "description": "The local site time they finished, HH:MM. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The id of the line.",
            "format": "uuid",
            "type": "string"
          },
          "staff_count": {
            "description": "How many people the company had on site. Null when not recorded.",
            "nullable": true,
            "type": "integer"
          },
          "start_time": {
            "description": "The local site time they started, HH:MM. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "trade": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DiaryTradeRefDto"
              }
            ],
            "description": "The trade this line is for. Null when the line names a company only by its text.",
            "nullable": true,
            "type": "object"
          }
        },
        "required": [
          "id",
          "trade",
          "company_name",
          "staff_count",
          "activity",
          "start_time",
          "finish_time"
        ],
        "type": "object"
      },
      "DiaryTradeRefDto": {
        "properties": {
          "id": {
            "description": "The id of the trade (the same id GET /v1/trades lists).",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the trade. \"Unknown\" when it is not readable.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "DiaryVisitorDto": {
        "properties": {
          "company_name": {
            "description": "The visitor's company. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The id of the line.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The visitor's name. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "reason_for_visit": {
            "description": "Why they visited. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "time_in": {
            "description": "The local site time they arrived, HH:MM. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "time_out": {
            "description": "The local site time they left, HH:MM. Null when not recorded.",
            "nullable": true,
            "type": "string"
          },
          "visitor_type": {
            "description": "The kind of visitor. Null when not recorded.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "visitor_type",
          "name",
          "company_name",
          "reason_for_visit",
          "time_in",
          "time_out"
        ],
        "type": "object"
      },
      "DiaryWeatherDto": {
        "properties": {
          "conditions": {
            "description": "The weather in words, such as Sunny or Showers PM. Null when none is recorded.",
            "nullable": true,
            "type": "string"
          },
          "notes": {
            "description": "The free text note about the weather. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "temperature_max_c": {
            "description": "The day's highest temperature in degrees Celsius. Null when none is recorded.",
            "nullable": true,
            "type": "integer"
          },
          "temperature_min_c": {
            "description": "The day's lowest temperature in degrees Celsius. Null when none is recorded.",
            "nullable": true,
            "type": "integer"
          }
        },
        "required": [
          "temperature_min_c",
          "temperature_max_c",
          "conditions",
          "notes"
        ],
        "type": "object"
      },
      "EmptyBodyDto": {
        "properties": {},
        "type": "object"
      },
      "ErrorBodyDto": {
        "properties": {
          "code": {
            "description": "A fixed code for the failure. Branch on this, never on the message.",
            "enum": [
              "unauthorized",
              "api_not_enabled",
              "forbidden",
              "not_found",
              "route_not_found",
              "credential_in_query",
              "invalid_request",
              "validation_failed",
              "sync_window_expired",
              "payload_too_large",
              "rate_limited",
              "create_not_available",
              "action_not_available",
              "upload_missing",
              "upload_rejected",
              "external_id_conflict",
              "precondition_failed",
              "idempotency_key_reused",
              "idempotency_in_progress",
              "temporarily_unavailable",
              "internal_error"
            ],
            "type": "string"
          },
          "details": {
            "description": "One entry for each field with a problem. Left out when there are none.",
            "items": {
              "$ref": "#/components/schemas/ErrorDetailDto"
            },
            "type": "array"
          },
          "message": {
            "description": "A short sentence about the failure. It may be reworded.",
            "type": "string"
          },
          "request_id": {
            "description": "The id of this request, the same as the X-Request-Id header. Quote it if you contact support.",
            "type": "string"
          }
        },
        "required": [
          "code",
          "message",
          "request_id"
        ],
        "type": "object"
      },
      "ErrorDetailDto": {
        "properties": {
          "code": {
            "description": "A fixed code for the problem. Branch on this, never on the message.",
            "enum": [
              "required",
              "invalid_type",
              "invalid_format",
              "invalid_value",
              "out_of_range",
              "unknown_field",
              "fenced_project",
              "outbound_org",
              "aconex_create",
              "raised_rule_outside",
              "issued_to_limit_reached",
              "upload_limit_reached",
              "size_mismatch",
              "too_large",
              "type_mismatch",
              "content_mismatch",
              "root_cause_required"
            ],
            "type": "string"
          },
          "field": {
            "description": "The name of the field the problem is about, as sent in the request.",
            "type": "string"
          },
          "message": {
            "description": "A short sentence about the problem. It may be reworded.",
            "type": "string"
          }
        },
        "required": [
          "field",
          "code",
          "message"
        ],
        "type": "object"
      },
      "ErrorEnvelopeDto": {
        "properties": {
          "error": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ErrorBodyDto"
              }
            ],
            "description": "What went wrong."
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "ExternalIdInputDto": {
        "properties": {
          "id": {
            "description": "Your own id for the defect in that system, 1 to 200 characters with no control characters.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
          },
          "system": {
            "description": "A short lower case name you choose for your own system, 1 to 40 characters of a to z, 0 to 9, underscore and hyphen, starting with a letter or digit. Each system appears once in a request.",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
            "type": "string"
          }
        },
        "required": [
          "system",
          "id"
        ],
        "type": "object"
      },
      "ExternalIdPatchDto": {
        "properties": {
          "id": {
            "description": "Your id for the defect in that system, 1 to 200 characters with no control characters. It replaces the id the defect holds for the system now. Null removes the system from the defect.",
            "maxLength": 200,
            "minLength": 1,
            "nullable": true,
            "type": "string"
          },
          "system": {
            "description": "The short lower case name of your own system, 1 to 40 characters of a to z, 0 to 9, underscore and hyphen, starting with a letter or digit. Each system appears once in a request.",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
            "type": "string"
          }
        },
        "required": [
          "system",
          "id"
        ],
        "type": "object"
      },
      "FormDto": {
        "properties": {
          "archived": {
            "description": "True when the company has retired the form. An archived form is offered to nobody new, but the forms already filed from it can still be read. Only a key that covers all projects sees archived forms.",
            "type": "boolean"
          },
          "current_version": {
            "description": "The number of the form's latest published version. A new published version shows here as a higher number. Read GET /v1/forms/{formId}/versions/{version} for its questions.",
            "minimum": 1,
            "type": "integer"
          },
          "id": {
            "description": "The id of the form.",
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "description": "Which kind of form this is: \"incident\" is an incident report form, \"general\" is any other company form.",
            "enum": [
              "incident",
              "general"
            ],
            "type": "string"
          },
          "name": {
            "description": "The name of the form, as the company calls it.",
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project the form belongs to. Null for a company form, which any project can use. A project form is offered on that one project only.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "kind",
          "project_id",
          "archived",
          "current_version"
        ],
        "type": "object"
      },
      "FormListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The published forms on this page, oldest first. A form that was never published is not listed.",
            "items": {
              "$ref": "#/components/schemas/FormDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "FormQuestionDto": {
        "properties": {
          "body": {
            "description": "The text of an info block. Null on every other type. Images embedded in an info block are not part of the document.",
            "nullable": true,
            "type": "string"
          },
          "help_text": {
            "description": "The help text shown under the question. Null when it has none.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The id of the question, the same id a filed form's answers are keyed by.",
            "type": "string"
          },
          "multiple": {
            "description": "True when the question takes more than one value. False when it does not say.",
            "type": "boolean"
          },
          "options": {
            "description": "The choices of a single_select or multi_select question, in the order shown. Empty for every other type.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "required": {
            "description": "True when the form cannot be filed without an answer to this question.",
            "type": "boolean"
          },
          "section": {
            "description": "The heading the question is grouped under. Null when it has none.",
            "nullable": true,
            "type": "string"
          },
          "text": {
            "description": "The text of the question.",
            "type": "string"
          },
          "type": {
            "description": "What the question takes as an answer. \"info\" is a block of text with no answer. The pickers (worker_picker, asset_picker, contractor_picker) choose one of the company's own records.",
            "enum": [
              "short_text",
              "long_text",
              "yes_no",
              "single_select",
              "multi_select",
              "date",
              "time",
              "number",
              "photo",
              "signature",
              "worker_picker",
              "asset_picker",
              "contractor_picker",
              "info"
            ],
            "type": "string"
          },
          "visible_when": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormVisibleWhenDto"
              }
            ],
            "description": "The condition that decides whether the question is shown. Null when the question is always shown. A question that is hidden is not answered.",
            "nullable": true,
            "type": "object"
          }
        },
        "required": [
          "id",
          "type",
          "text",
          "section",
          "help_text",
          "options",
          "required",
          "multiple",
          "visible_when",
          "body"
        ],
        "type": "object"
      },
      "FormSubmissionAnswerDto": {
        "properties": {
          "question_id": {
            "description": "The id of the question, as in the questions of the form version.",
            "type": "string"
          },
          "type": {
            "description": "The type of the question, so that value can be read without fetching the form version.",
            "enum": [
              "short_text",
              "long_text",
              "yes_no",
              "single_select",
              "multi_select",
              "date",
              "time",
              "number",
              "photo",
              "signature",
              "worker_picker",
              "asset_picker",
              "contractor_picker",
              "info"
            ],
            "type": "string"
          },
          "value": {
            "description": "The answer, encoded by the type of the question. A string for short_text, long_text, single_select, date (YYYY-MM-DD) and time (HH:MM); \"yes\" or \"no\" for yes_no; an array of strings for multi_select; a number for number; an array of photo ids for photo (download them from the photos of the submission); an array of objects with signer_name and signed_at for signature; an array of objects with id and name for worker_picker, asset_picker and contractor_picker. Null when the question was not answered, and null when the form hides the question because of another answer. Arrays are never empty: an answer with nothing chosen is null.",
            "nullable": true,
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "number"
              },
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/FormSubmissionSignatureValueDto"
                },
                "type": "array"
              },
              {
                "items": {
                  "$ref": "#/components/schemas/FormSubmissionLinkRefDto"
                },
                "type": "array"
              }
            ]
          }
        },
        "required": [
          "question_id",
          "type",
          "value"
        ],
        "type": "object"
      },
      "FormSubmissionDto": {
        "properties": {
          "answers": {
            "description": "One entry for every question of the version the form was filled against, in question order, except information blocks, which take no answer.",
            "items": {
              "$ref": "#/components/schemas/FormSubmissionAnswerDto"
            },
            "type": "array"
          },
          "asset": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormSubmissionLinkRefDto"
              }
            ],
            "description": "The asset the form is about. Null when none was chosen.",
            "nullable": true,
            "type": "object"
          },
          "close_note": {
            "description": "The note written when it was closed. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "closed_at": {
            "description": "When it was closed. Null while it is not closed.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "closed_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormSubmissionPersonDto"
              }
            ],
            "description": "The person who closed it. Null while it is not closed.",
            "nullable": true,
            "type": "object"
          },
          "form_id": {
            "description": "The id of the form this was filled in from. Read it at GET /v1/forms/{formId}.",
            "format": "uuid",
            "type": "string"
          },
          "geo": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormSubmissionGeoDto"
              }
            ],
            "description": "The phone's own reading when the form was filed, not a verified position. Null when no reading was asked for.",
            "nullable": true,
            "type": "object"
          },
          "id": {
            "description": "The id of the filed form.",
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "description": "Which kind of form this is: \"incident\" is an incident report, \"general\" is any other company form.",
            "enum": [
              "incident",
              "general"
            ],
            "type": "string"
          },
          "location_id": {
            "description": "The id of the location it was filed against. Null when none was chosen.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "location_path": {
            "description": "The location written as its path from the top, with the names separated by a single right angle quotation mark. Null when there is no location.",
            "nullable": true,
            "type": "string"
          },
          "modified_at": {
            "description": "The time the filed form last changed in a way this summary or the full submission shows: it was submitted, closed, reopened, or its contractor was merged into another. It is the value updated_since compares.",
            "format": "date-time",
            "type": "string"
          },
          "number": {
            "description": "The number the company shows for this filed form, such as the one printed on its report. Each kind of form has its own series.",
            "nullable": true,
            "type": "string"
          },
          "occurred_at": {
            "description": "When the thing it records happened, as the person entered it. Null when none was entered.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project it was filed on. Null when it was filed with no project.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "schema_version": {
            "description": "The version of the form this was filled in against. Read that version's questions at GET /v1/forms/{formId}/versions/{version}.",
            "minimum": 1,
            "type": "integer"
          },
          "severity": {
            "description": "How serious it was marked. Null when no severity was chosen, as with most general forms.",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ],
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "\"submitted\" when it has been filed, \"closed\" when a reviewer has dealt with it. A draft is never listed.",
            "enum": [
              "submitted",
              "closed"
            ],
            "type": "string"
          },
          "submitted_at": {
            "description": "When it was submitted. The plain list is ordered by this, oldest first.",
            "format": "date-time",
            "type": "string"
          },
          "submitted_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormSubmissionPersonDto"
              }
            ],
            "description": "The person who filled in and submitted it."
          },
          "title": {
            "description": "The one line summary the person wrote. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "trade": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormSubmissionLinkRefDto"
              }
            ],
            "description": "The company (trade) the form is about. Null when none was chosen.",
            "nullable": true,
            "type": "object"
          },
          "worker": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormSubmissionLinkRefDto"
              }
            ],
            "description": "The worker the form is about. Null when none was chosen.",
            "nullable": true,
            "type": "object"
          }
        },
        "required": [
          "id",
          "number",
          "kind",
          "form_id",
          "schema_version",
          "project_id",
          "location_id",
          "location_path",
          "status",
          "title",
          "severity",
          "occurred_at",
          "submitted_by",
          "submitted_at",
          "closed_by",
          "closed_at",
          "modified_at",
          "asset",
          "worker",
          "trade",
          "close_note",
          "geo",
          "answers"
        ],
        "type": "object"
      },
      "FormSubmissionGeoDto": {
        "properties": {
          "accuracy_m": {
            "description": "How accurate the reading says it is, in metres. Null unless the status is captured, and null when the phone gave no accuracy.",
            "nullable": true,
            "type": "number"
          },
          "captured_at": {
            "description": "When the phone took the reading. Null unless the status is captured.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "latitude": {
            "description": "Latitude in degrees. Null unless the status is captured.",
            "nullable": true,
            "type": "number"
          },
          "longitude": {
            "description": "Longitude in degrees. Null unless the status is captured.",
            "nullable": true,
            "type": "number"
          },
          "status": {
            "description": "\"captured\" when the phone gave a position, otherwise why it did not: \"denied\" (the person refused), \"unavailable\" (the phone had no position) or \"timeout\" (the phone took too long).",
            "enum": [
              "captured",
              "denied",
              "unavailable",
              "timeout"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "latitude",
          "longitude",
          "accuracy_m",
          "captured_at"
        ],
        "type": "object"
      },
      "FormSubmissionLinkRefDto": {
        "properties": {
          "id": {
            "description": "The id of the asset, worker or company.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name it had when the form was last saved or submitted. \"Unknown\" when no name was kept.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "FormSubmissionListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The filed forms on this page. The list carries no question responses: read each changed submission by id to get them. Drafts are never listed. A filed form is never deleted, so there are no deletion markers.",
            "items": {
              "$ref": "#/components/schemas/FormSubmissionSummaryDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "FormSubmissionPersonDto": {
        "properties": {
          "id": {
            "description": "The id of the person.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the person. \"Unknown\" when the person no longer has a readable name.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "FormSubmissionPhotoDto": {
        "properties": {
          "content_type": {
            "description": "The media type of the file, such as image/jpeg.",
            "type": "string"
          },
          "file_name": {
            "description": "The name of the file as it was uploaded.",
            "type": "string"
          },
          "id": {
            "description": "The id of the photo, as it appears in the photo answer.",
            "format": "uuid",
            "type": "string"
          },
          "size_bytes": {
            "description": "The size of the file in bytes. Null when it was not recorded.",
            "nullable": true,
            "type": "integer"
          },
          "submission_id": {
            "description": "The id of the filed form the photo is on.",
            "format": "uuid",
            "type": "string"
          },
          "thumbnail_url": {
            "description": "A link that downloads a small version of the photo, valid until url_expires_at. Null until the small version has been made, so a photo that was just uploaded has none for a short while.",
            "format": "uri",
            "nullable": true,
            "type": "string"
          },
          "uploaded_at": {
            "description": "When the photo was uploaded, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "A link that downloads the photo. It is made for this request and stops working at url_expires_at, one hour after the request. Do not store it: ask again when you need the photo.",
            "format": "uri",
            "type": "string"
          },
          "url_expires_at": {
            "description": "When url and thumbnail_url stop working, to the microsecond, in UTC. One hour after the request.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "submission_id",
          "file_name",
          "content_type",
          "size_bytes",
          "uploaded_at",
          "url",
          "thumbnail_url",
          "url_expires_at"
        ],
        "type": "object"
      },
      "FormSubmissionPhotoListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk. The download links are not part of the walk: each page signs its own.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The photos on this page, oldest upload first.",
            "items": {
              "$ref": "#/components/schemas/FormSubmissionPhotoDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "FormSubmissionSignatureValueDto": {
        "properties": {
          "signed_at": {
            "description": "When the signature was made.",
            "format": "date-time",
            "type": "string"
          },
          "signer_name": {
            "description": "The name the signer typed.",
            "type": "string"
          }
        },
        "required": [
          "signer_name",
          "signed_at"
        ],
        "type": "object"
      },
      "FormSubmissionSummaryDto": {
        "properties": {
          "closed_at": {
            "description": "When it was closed. Null while it is not closed.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "closed_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormSubmissionPersonDto"
              }
            ],
            "description": "The person who closed it. Null while it is not closed.",
            "nullable": true,
            "type": "object"
          },
          "form_id": {
            "description": "The id of the form this was filled in from. Read it at GET /v1/forms/{formId}.",
            "format": "uuid",
            "type": "string"
          },
          "id": {
            "description": "The id of the filed form.",
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "description": "Which kind of form this is: \"incident\" is an incident report, \"general\" is any other company form.",
            "enum": [
              "incident",
              "general"
            ],
            "type": "string"
          },
          "location_id": {
            "description": "The id of the location it was filed against. Null when none was chosen.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "location_path": {
            "description": "The location written as its path from the top, with the names separated by a single right angle quotation mark. Null when there is no location.",
            "nullable": true,
            "type": "string"
          },
          "modified_at": {
            "description": "The time the filed form last changed in a way this summary or the full submission shows: it was submitted, closed, reopened, or its contractor was merged into another. It is the value updated_since compares.",
            "format": "date-time",
            "type": "string"
          },
          "number": {
            "description": "The number the company shows for this filed form, such as the one printed on its report. Each kind of form has its own series.",
            "nullable": true,
            "type": "string"
          },
          "occurred_at": {
            "description": "When the thing it records happened, as the person entered it. Null when none was entered.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project it was filed on. Null when it was filed with no project.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "schema_version": {
            "description": "The version of the form this was filled in against. Read that version's questions at GET /v1/forms/{formId}/versions/{version}.",
            "minimum": 1,
            "type": "integer"
          },
          "severity": {
            "description": "How serious it was marked. Null when no severity was chosen, as with most general forms.",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ],
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "\"submitted\" when it has been filed, \"closed\" when a reviewer has dealt with it. A draft is never listed.",
            "enum": [
              "submitted",
              "closed"
            ],
            "type": "string"
          },
          "submitted_at": {
            "description": "When it was submitted. The plain list is ordered by this, oldest first.",
            "format": "date-time",
            "type": "string"
          },
          "submitted_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/FormSubmissionPersonDto"
              }
            ],
            "description": "The person who filled in and submitted it."
          },
          "title": {
            "description": "The one line summary the person wrote. Null when there is none.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "kind",
          "form_id",
          "schema_version",
          "project_id",
          "location_id",
          "location_path",
          "status",
          "title",
          "severity",
          "occurred_at",
          "submitted_by",
          "submitted_at",
          "closed_by",
          "closed_at",
          "modified_at"
        ],
        "type": "object"
      },
      "FormVersionDto": {
        "properties": {
          "form_id": {
            "description": "The id of the form this is a version of.",
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "description": "Which kind of form this is: \"incident\" is an incident report form, \"general\" is any other company form.",
            "enum": [
              "incident",
              "general"
            ],
            "type": "string"
          },
          "name": {
            "description": "The name of the form as it was in this version.",
            "type": "string"
          },
          "published_at": {
            "description": "When this version was published, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "questions": {
            "description": "The questions of this version, in the order the form shows them.",
            "items": {
              "$ref": "#/components/schemas/FormQuestionDto"
            },
            "type": "array"
          },
          "schema_version": {
            "description": "The number of this version of the form, the same number as the version in the path. It is the number a filed form's schema_version names.",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "form_id",
          "schema_version",
          "name",
          "kind",
          "published_at",
          "questions"
        ],
        "type": "object"
      },
      "FormVisibleWhenDto": {
        "properties": {
          "any_of": {
            "description": "This question is shown when the answer to question_id is one of these values. When that question is itself hidden, this one is hidden too.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "question_id": {
            "description": "The id of the question whose answer decides whether this question is shown.",
            "type": "string"
          }
        },
        "required": [
          "question_id",
          "any_of"
        ],
        "type": "object"
      },
      "IssueToTradeBodyDto": {
        "properties": {
          "due_date": {
            "description": "The day this trade should fix the defect by, as YYYY-MM-DD. Omitted, it is three days after the defect was created, as in the app. Null means this line has no fix-by day.",
            "format": "date",
            "nullable": true,
            "type": "string"
          },
          "notify_trade": {
            "description": "Send false to issue the defect without emailing the trade; your own staff are still notified as usual. Omitted or true, the trade is emailed unless the project's own settings hold the email back.",
            "type": "boolean"
          },
          "trade_id": {
            "description": "The id of the trade to issue the defect to, as listed by GET /v1/trades. A trade the list does not show, from another company or otherwise, is refused.",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "trade_id"
        ],
        "type": "object"
      },
      "JobTaskAssigneeDto": {
        "properties": {
          "id": {
            "description": "The id of the person, or of the trade (the same id GET /v1/trades lists).",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the person or the trade. \"Unknown\" when it is not readable.",
            "type": "string"
          },
          "type": {
            "description": "Who the task is for: \"user\" is a person on the company's own team, \"trade\" is one of the company's trades.",
            "enum": [
              "user",
              "trade"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "id",
          "name"
        ],
        "type": "object"
      },
      "JobTaskDto": {
        "properties": {
          "assignee": {
            "allOf": [
              {
                "$ref": "#/components/schemas/JobTaskAssigneeDto"
              }
            ],
            "description": "The person or trade the task is for. Null when it is not assigned.",
            "nullable": true,
            "type": "object"
          },
          "booked_date": {
            "description": "The calendar day the work is booked in for, as YYYY-MM-DD. Null when no day is booked.",
            "format": "date",
            "nullable": true,
            "type": "string"
          },
          "comment": {
            "description": "The comment on the task. Null when there is none.",
            "nullable": true,
            "type": "string"
          },
          "completed_at": {
            "description": "When the task was marked done, to the microsecond, in UTC. Null when the task is not done.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "completed_by": {
            "allOf": [
              {
                "$ref": "#/components/schemas/JobTaskPersonDto"
              }
            ],
            "description": "The person who marked the task done. Null when the task is not done.",
            "nullable": true,
            "type": "object"
          },
          "created_at": {
            "description": "When the task was created, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The id of the task.",
            "format": "uuid",
            "type": "string"
          },
          "if_applicable": {
            "description": "True when the task only applies to some jobs and may be marked not applicable.",
            "type": "boolean"
          },
          "name": {
            "description": "The name of the task.",
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project whose checklist the task is on.",
            "format": "uuid",
            "type": "string"
          },
          "sort_order": {
            "description": "The position of the task inside its stage. Lower comes first.",
            "type": "integer"
          },
          "stage": {
            "description": "The name of the stage the task is grouped under.",
            "type": "string"
          },
          "stage_order": {
            "description": "The position of the stage in the checklist. Sort by stage_order, then sort_order, to show the checklist as the app does.",
            "type": "integer"
          },
          "status": {
            "description": "Where the task is: \"open\" is still to do, \"done\" is finished, \"na\" is marked not applicable.",
            "enum": [
              "open",
              "done",
              "na"
            ],
            "type": "string"
          },
          "updated_at": {
            "description": "When the task last changed, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "project_id",
          "stage",
          "stage_order",
          "sort_order",
          "name",
          "if_applicable",
          "status",
          "booked_date",
          "assignee",
          "completed_by",
          "completed_at",
          "comment",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "JobTaskListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The tasks on this page, oldest first. Sort by stage_order, then sort_order, to show them as the app does.",
            "items": {
              "$ref": "#/components/schemas/JobTaskDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "JobTaskPersonDto": {
        "properties": {
          "id": {
            "description": "The id of the person.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the person. \"Unknown\" when the person no longer has a readable name.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "LocationDto": {
        "properties": {
          "id": {
            "description": "The id of the location.",
            "format": "uuid",
            "type": "string"
          },
          "is_room": {
            "description": "True when the location is a room inside a property rather than a property or a level.",
            "type": "boolean"
          },
          "name": {
            "description": "The name of the location.",
            "type": "string"
          },
          "parent_id": {
            "description": "The id of the location this one sits inside. Null for a top-level location.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project the location is in.",
            "format": "uuid",
            "type": "string"
          },
          "sort_order": {
            "description": "The position among its siblings the company has given it. Lower comes first.",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "project_id",
          "parent_id",
          "name",
          "is_room",
          "sort_order"
        ],
        "type": "object"
      },
      "LocationListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The locations on this page, oldest first.",
            "items": {
              "$ref": "#/components/schemas/LocationDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "NoteAuthorDto": {
        "properties": {
          "id": {
            "description": "The id of the user who wrote the note. Null when the author is not a user: a trade contact or reporter replying from an emailed link, or a person whose note was imported from another system.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "description": "The name of the author, as the app shows it. Unknown when the note has no author name on record.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "NoteDto": {
        "properties": {
          "audience": {
            "description": "Who can read the note in the app: staff (only the company's own people), trade (the trade it was issued to), tenant (the tenant), client (the client) or everyone. A key reads notes of every audience, including staff.",
            "enum": [
              "staff",
              "trade",
              "tenant",
              "everyone",
              "client"
            ],
            "type": "string"
          },
          "author": {
            "allOf": [
              {
                "$ref": "#/components/schemas/NoteAuthorDto"
              }
            ],
            "description": "Who wrote the note."
          },
          "body": {
            "description": "The text of the note, exactly as stored. An @mention is plain text such as @First Last.",
            "type": "string"
          },
          "created_at": {
            "description": "When the note was written, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "defect_id": {
            "description": "The id of the defect the note is on.",
            "format": "uuid",
            "type": "string"
          },
          "edited_at": {
            "description": "When the note was last edited, to the microsecond, in UTC. Null for a note never edited.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The id of the note.",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "defect_id",
          "audience",
          "body",
          "author",
          "created_at",
          "edited_at"
        ],
        "type": "object"
      },
      "NoteListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The notes on this page, oldest first.",
            "items": {
              "$ref": "#/components/schemas/NoteDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "PhotoDto": {
        "properties": {
          "content_type": {
            "description": "The media type of the file, such as image/jpeg.",
            "type": "string"
          },
          "defect_id": {
            "description": "The id of the defect the photo is on.",
            "format": "uuid",
            "type": "string"
          },
          "file_name": {
            "description": "The name of the file as it was uploaded.",
            "type": "string"
          },
          "id": {
            "description": "The id of the photo.",
            "format": "uuid",
            "type": "string"
          },
          "size_bytes": {
            "description": "The size of the file in bytes. Null when it was not recorded.",
            "nullable": true,
            "type": "integer"
          },
          "thumbnail_url": {
            "description": "A link that downloads a small version of the photo, valid until url_expires_at. Null until the small version has been made, so a photo that was just uploaded has none for a short while.",
            "format": "uri",
            "nullable": true,
            "type": "string"
          },
          "uploaded_at": {
            "description": "When the photo was uploaded, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "url": {
            "description": "A link that downloads the photo. It is made for this request and stops working at url_expires_at, one hour after the request. Do not store it: ask again when you need the photo.",
            "format": "uri",
            "type": "string"
          },
          "url_expires_at": {
            "description": "When url and thumbnail_url stop working, to the microsecond, in UTC. One hour after the request.",
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "defect_id",
          "file_name",
          "content_type",
          "size_bytes",
          "uploaded_at",
          "url",
          "thumbnail_url",
          "url_expires_at"
        ],
        "type": "object"
      },
      "PhotoListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk. The download links are not part of the walk: each page signs its own.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The photos on this page, oldest upload first.",
            "items": {
              "$ref": "#/components/schemas/PhotoDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "PhotoUploadHeadersDto": {
        "properties": {
          "Content-Type": {
            "description": "The value of the Content-Type header to send with the upload, verbatim. The key of this property is the header name, spelt exactly as shown. A different value is refused when you upload.",
            "type": "string"
          }
        },
        "required": [
          "Content-Type"
        ],
        "type": "object"
      },
      "PhotoUploadRequestBodyDto": {
        "properties": {
          "captured_at": {
            "description": "When the photo was taken, as an ISO 8601 timestamp with a time zone, such as 2026-11-10T09:30:00+11:00. Leave it out when you do not know.",
            "format": "date-time",
            "type": "string"
          },
          "content_type": {
            "description": "The media type of the file: image/jpeg, image/png, image/webp, image/heic or image/heif. Send the same value as the Content-Type header when you upload the bytes.",
            "enum": [
              "image/jpeg",
              "image/png",
              "image/webp",
              "image/heic",
              "image/heif"
            ],
            "type": "string"
          },
          "file_name": {
            "description": "The name of the file, 1 to 150 characters. It cannot contain a slash, a backslash or a control character, and cannot start with a dot. It is stored and listed as sent.",
            "maxLength": 150,
            "minLength": 1,
            "type": "string"
          },
          "size_bytes": {
            "description": "The exact size of the file in bytes, from 1 up to 26,214,400 (25 MB). The upload link accepts a file of exactly this many bytes and no other size.",
            "maximum": 26214400,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "file_name",
          "content_type",
          "size_bytes"
        ],
        "type": "object"
      },
      "PhotoUploadTicketDto": {
        "properties": {
          "photo_id": {
            "description": "The id of the photo that will exist once the upload is confirmed. Keep it for the confirm step.",
            "format": "uuid",
            "type": "string"
          },
          "upload_expires_at": {
            "description": "When upload_url stops working, 15 minutes after it was made, in UTC. Finish the upload before this time, or ask for a new upload.",
            "format": "date-time",
            "type": "string"
          },
          "upload_headers": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PhotoUploadHeadersDto"
              }
            ],
            "description": "The headers the upload must carry. Send each one exactly as given."
          },
          "upload_method": {
            "description": "The HTTP method to use on upload_url. Always PUT, with the file as the body and no other encoding.",
            "enum": [
              "PUT"
            ],
            "type": "string"
          },
          "upload_url": {
            "description": "The link to send the file to. It works for one upload of the declared type and size until upload_expires_at. Do not store it: it is not a link to view the photo.",
            "format": "uri",
            "type": "string"
          }
        },
        "required": [
          "photo_id",
          "upload_url",
          "upload_method",
          "upload_headers",
          "upload_expires_at"
        ],
        "type": "object"
      },
      "ProjectDto": {
        "properties": {
          "archived": {
            "description": "True when the project has been archived. Archived projects are still listed.",
            "type": "boolean"
          },
          "code": {
            "description": "The short project code that appears inside defect numbers. Null when the project has none.",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "description": "When the project was created, to the microsecond, in UTC.",
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "description": "The id of the project.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the project.",
            "type": "string"
          },
          "status_labels": {
            "description": "All nine statuses, in the canonical order, each with the words this project shows for it.",
            "items": {
              "$ref": "#/components/schemas/ProjectStatusLabelDto"
            },
            "type": "array"
          }
        },
        "required": [
          "id",
          "name",
          "code",
          "archived",
          "created_at",
          "status_labels"
        ],
        "type": "object"
      },
      "ProjectListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The projects on this page, oldest first.",
            "items": {
              "$ref": "#/components/schemas/ProjectDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "ProjectStatusLabelDto": {
        "properties": {
          "label": {
            "description": "The words this project shows for the status: the project's own wording if it has one, else the company's, else the built-in word. For display only: branch on status, not on this.",
            "type": "string"
          },
          "status": {
            "description": "The status value a defect carries. These nine values are fixed.",
            "enum": [
              "open",
              "assigned",
              "pending",
              "fixed",
              "trade_completed",
              "ready_to_inspect",
              "outstanding",
              "closed",
              "in_dispute"
            ],
            "type": "string"
          }
        },
        "required": [
          "status",
          "label"
        ],
        "type": "object"
      },
      "PublicApiMeActorDto": {
        "properties": {
          "id": {
            "description": "The id of the API user that changes made with this key are recorded against.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the API user that changes made with this key are recorded against.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "PublicApiMeCompanyDto": {
        "properties": {
          "id": {
            "description": "The id of the company the key belongs to.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "description": "The name of the company the key belongs to.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "type": "object"
      },
      "PublicApiMeKeyDto": {
        "properties": {
          "access": {
            "description": "Whether the key can only read, or can also write.",
            "enum": [
              "read",
              "read_write"
            ],
            "type": "string"
          },
          "name": {
            "description": "The name given to this key when it was created.",
            "type": "string"
          },
          "prefix": {
            "description": "The first characters of the key, safe to show. The rest of the key is never returned.",
            "type": "string"
          },
          "project_ids": {
            "description": "The ids of the projects the key can reach. Empty when the key reaches every project in the company.",
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "type": "array"
          },
          "project_scope": {
            "description": "Whether the key reaches every project in the company, or only the projects listed.",
            "enum": [
              "all",
              "list"
            ],
            "type": "string"
          }
        },
        "required": [
          "name",
          "prefix",
          "access",
          "project_scope",
          "project_ids"
        ],
        "type": "object"
      },
      "PublicApiMeRateLimitsDto": {
        "properties": {
          "reads_per_minute": {
            "description": "How many read requests this key may make each minute.",
            "type": "number"
          },
          "writes_per_minute": {
            "description": "How many write requests this key may make each minute.",
            "type": "number"
          }
        },
        "required": [
          "reads_per_minute",
          "writes_per_minute"
        ],
        "type": "object"
      },
      "PublicApiMeResponse": {
        "properties": {
          "actor": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PublicApiMeActorDto"
              }
            ],
            "description": "The API user that changes made with this key are recorded against."
          },
          "company": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PublicApiMeCompanyDto"
              }
            ],
            "description": "The company the key belongs to."
          },
          "key": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PublicApiMeKeyDto"
              }
            ],
            "description": "The key that made this request."
          },
          "rate_limits": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PublicApiMeRateLimitsDto"
              }
            ],
            "description": "What the Public API enforces for this key, per minute."
          }
        },
        "required": [
          "key",
          "company",
          "actor",
          "rate_limits"
        ],
        "type": "object"
      },
      "TradeDto": {
        "properties": {
          "id": {
            "description": "The id of the trade.",
            "format": "uuid",
            "type": "string"
          },
          "is_internal": {
            "description": "True when the trade is the company's own team rather than an outside business.",
            "type": "boolean"
          },
          "name": {
            "description": "The name of the trade company.",
            "type": "string"
          },
          "trade": {
            "description": "The kind of work the company does, for example Plumbing. Null when none is set.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "trade",
          "is_internal"
        ],
        "type": "object"
      },
      "TradeListDto": {
        "properties": {
          "as_of": {
            "description": "The moment this walk of the list was bounded at, to the microsecond. It is the same on every page of one walk.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "description": "The trades on this page, oldest first.",
            "items": {
              "$ref": "#/components/schemas/TradeDto"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass this as cursor to get the next page. Null when this is the last page.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "data",
          "next_cursor",
          "as_of"
        ],
        "type": "object"
      },
      "UpdateDefectBodyDto": {
        "properties": {
          "custom_type_id": {
            "description": "The id of one of the company's own Types, as shown in custom_type on a defect. Null removes the defect's custom type.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "description": {
            "description": "What is wrong, in the words the site team will read. At least one visible character and at most 10,000, or fewer if the company sets its own limit. It is stored exactly as sent. It cannot be null.",
            "maxLength": 10000,
            "type": "string"
          },
          "due_date": {
            "description": "The fix-by day as YYYY-MM-DD. Null removes the fix-by day.",
            "format": "date",
            "nullable": true,
            "type": "string"
          },
          "external_ids": {
            "description": "Changes to your own ids for the defect, merged system by system: a system with an id sets or replaces that system, a system with id null removes it, and a system you do not list is kept. At most 10 entries and each system once; the defect can hold at most 10 systems. An id another defect in the company already holds for the same system is refused with external_id_conflict. An empty list changes nothing.",
            "items": {
              "$ref": "#/components/schemas/ExternalIdPatchDto"
            },
            "maxItems": 10,
            "type": "array"
          },
          "location_id": {
            "description": "The id of a location in the defect's own project, as listed by GET /v1/projects/{projectId}/locations. It cannot be null: a defect that has a location keeps one.",
            "format": "uuid",
            "type": "string"
          },
          "priority": {
            "description": "How urgent the defect is. It cannot be null.",
            "enum": [
              "low",
              "medium",
              "high",
              "critical"
            ],
            "type": "string"
          },
          "type": {
            "description": "The kind of defect. It cannot be null.",
            "enum": [
              "defect",
              "safety",
              "rfi",
              "general",
              "maintenance",
              "warranty",
              "incomplete_works",
              "contract_variation",
              "variation"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "WebhookActorDto": {
        "properties": {
          "id": {
            "description": "The id of the user, or of the API user behind the key. Null when the system made the change.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "type": {
            "description": "Who made the change: user (a person using the app), api (an API key) or system (the platform itself, for example a sync).",
            "enum": [
              "user",
              "api",
              "system"
            ],
            "type": "string"
          }
        },
        "required": [
          "type",
          "id"
        ],
        "type": "object"
      },
      "WebhookDefectEventDataDto": {
        "properties": {
          "actor": {
            "allOf": [
              {
                "$ref": "#/components/schemas/WebhookActorDto"
              }
            ],
            "description": "Who made the change."
          },
          "audience": {
            "description": "Who can read the note in the app: staff, trade, tenant, client or everyone. Set on note.added, null on every other event.",
            "enum": [
              "staff",
              "trade",
              "tenant",
              "everyone",
              "client"
            ],
            "nullable": true,
            "type": "string"
          },
          "changed_fields": {
            "description": "The names of the fields that changed, sorted. Set on defect.updated, null on every other event. Read the defect to get the new values.",
            "items": {
              "enum": [
                "closed_at",
                "custom_type",
                "description",
                "due_date",
                "external_ids",
                "issued_to",
                "location_id",
                "notes",
                "number",
                "photos",
                "priority",
                "project_id",
                "raised_by",
                "type"
              ],
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "defect_id": {
            "description": "The id of the defect the event is about.",
            "format": "uuid",
            "type": "string"
          },
          "deleted_at": {
            "description": "When the defect was deleted, to the microsecond, in UTC. Set on defect.deleted, null on every other event.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "modified_at": {
            "description": "When the defect was last modified, to the microsecond, in UTC. Deliveries to one subscription are unordered: if you see a modified_at older than one you already applied for the same defect, you can drop the event.",
            "format": "date-time",
            "type": "string"
          },
          "note_id": {
            "description": "The id of the note. Set on note.added, null on every other event.",
            "format": "uuid",
            "nullable": true,
            "type": "string"
          },
          "previous_status": {
            "description": "The status the defect had before the change. Set on defect.status_changed and defect.closed, null on every other event.",
            "enum": [
              "open",
              "assigned",
              "pending",
              "fixed",
              "trade_completed",
              "ready_to_inspect",
              "outstanding",
              "closed",
              "in_dispute"
            ],
            "nullable": true,
            "type": "string"
          },
          "project_id": {
            "description": "The id of the project the defect belongs to.",
            "format": "uuid",
            "type": "string"
          },
          "resource_type": {
            "description": "The kind of record the event is about. Always defect, including for note.added, which is a note on a defect.",
            "enum": [
              "defect"
            ],
            "type": "string"
          },
          "source": {
            "description": "Where the change came from: app, api or sync.",
            "enum": [
              "app",
              "api",
              "sync"
            ],
            "type": "string"
          },
          "status": {
            "description": "The status of the defect after the change.",
            "enum": [
              "open",
              "assigned",
              "pending",
              "fixed",
              "trade_completed",
              "ready_to_inspect",
              "outstanding",
              "closed",
              "in_dispute"
            ],
            "type": "string"
          },
          "status_group": {
            "description": "The coarse group the status falls into, the same five groups the app shows.",
            "enum": [
              "open",
              "in_dispute",
              "pending",
              "fixed",
              "closed"
            ],
            "type": "string"
          }
        },
        "required": [
          "resource_type",
          "defect_id",
          "project_id",
          "status",
          "previous_status",
          "status_group",
          "changed_fields",
          "modified_at",
          "actor",
          "source",
          "note_id",
          "audience",
          "deleted_at"
        ],
        "type": "object"
      },
      "WebhookEnvelopeDto": {
        "description": "One webhook delivery. Deliveries are at least once and unordered. Dedupe on the webhook-id header, which is the event id. Compare data.modified_at and drop an event older than one you already applied for the same defect. Treat an event as a hint to read the record, not as the record.",
        "properties": {
          "api_version": {
            "description": "The version of the Public API that shaped this body.",
            "enum": [
              "v1"
            ],
            "type": "string"
          },
          "data": {
            "description": "The event. The envelope of a webhook.test event carries the test data, every other event carries the defect data.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/WebhookDefectEventDataDto"
              },
              {
                "$ref": "#/components/schemas/WebhookTestEventDataDto"
              }
            ]
          },
          "id": {
            "description": "The id of the event: evt_ and 32 lowercase hex digits. It is also sent as the webhook-id header and is the same on every retry.",
            "pattern": "^evt_[0-9a-f]{32}$",
            "type": "string"
          },
          "occurred_at": {
            "description": "When the change was made, to the microsecond, in UTC. It is not the time of delivery.",
            "format": "date-time",
            "type": "string"
          },
          "type": {
            "description": "What happened. webhook.test is sent only by the Send test event action and cannot be subscribed to.",
            "enum": [
              "defect.created",
              "defect.updated",
              "defect.status_changed",
              "defect.closed",
              "defect.deleted",
              "note.added",
              "webhook.test"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "occurred_at",
          "api_version",
          "data"
        ],
        "type": "object"
      },
      "WebhookTestEventDataDto": {
        "properties": {
          "message": {
            "description": "A fixed sentence that says this is a test event.",
            "type": "string"
          },
          "subscription_id": {
            "description": "The id of the subscription the test event was sent to.",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "subscription_id",
          "message"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "bearerFormat": "API key",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "contact": {},
    "description": "Read and write a company's data in IssuesID over HTTPS with an API key.",
    "title": "IssuesID Public API",
    "version": "1.0.0"
  },
  "openapi": "3.0.0",
  "paths": {
    "/v1/company": {
      "get": {
        "operationId": "getCompany",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyDto"
                }
              }
            },
            "description": "The company, with the nine statuses in the canonical order, each with its group and the label the company shows.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read the company the key belongs to: its wording, timezone, statuses, status labels and Type label.",
        "tags": [
          "reference"
        ]
      }
    },
    "/v1/defects": {
      "get": {
        "description": "Without updated_since the list is every defect the key can see, ordered by when it was created. With updated_since it is a sync: only defects that changed at or after that moment, ordered by when they last changed, with each deleted defect as a deletion marker of five keys. A walk is bounded by the as_of returned on its first page, so it always ends; a change made while you walk is returned by your next sync, which should start from that as_of. An updated_since older than 90 days is refused with the error code sync_window_expired: run a full resync without updated_since.",
        "operationId": "listDefects",
        "parameters": [
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          },
          {
            "description": "Only the defects of this project. A project the key cannot see, or that does not exist, is answered exactly as GET /v1/projects/{projectId} answers it: not_found.",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Only defects in this status. Repeat the parameter for several, as status=open&status=fixed. Naming a status twice is the same as naming it once. Deletion markers in a sync list are not filtered by status.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "items": {
                "enum": [
                  "open",
                  "assigned",
                  "pending",
                  "fixed",
                  "trade_completed",
                  "ready_to_inspect",
                  "outstanding",
                  "closed",
                  "in_dispute"
                ],
                "type": "string"
              },
              "type": "array"
            }
          },
          {
            "description": "The short lower case name you chose for your own system. Send it with external_id, never alone. Finds the defect that carries your id for it.",
            "in": "query",
            "name": "external_system",
            "required": false,
            "schema": {
              "pattern": "^[a-z0-9][a-z0-9_-]{0,39}$",
              "type": "string"
            }
          },
          {
            "description": "Your own id for the defect, one to 200 characters with no control characters. Send it with external_system, never alone.",
            "in": "query",
            "name": "external_id",
            "required": false,
            "schema": {
              "maxLength": 200,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "Return only defects that changed at or after this moment, with deletions as markers (a sync). It must end in Z or an offset such as +10:00 (percent-encode the plus sign), and may carry up to six fractional digits. A value older than 90 days is refused with sync_window_expired: run a full resync without it. Start each sync a few minutes before the as_of of the last one.",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefectListDto"
                }
              }
            },
            "description": "One page of defects, with the cursor for the next page and the as_of of the walk. A project-list key sees only the defects of its own projects.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. sync_window_expired: The updated_since value is older than the 90 days of changes the Public API keeps. Run a full resync without updated_since.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List the defects the key can see, oldest first, a page at a time.",
        "tags": [
          "defects"
        ]
      },
      "post": {
        "description": "Raises a defect in a project the key can see, exactly as a person raising it in the app would. Only project_id and description are required. Omitted, the priority is medium, the type is defect and the fix-by day (due_date) is three days after creation; send due_date as null for no fix-by day. If the company requires a location on every new defect, location_id is required too. The defect is numbered like any other, is created by the API user named after the key, and reads modified_source api. The response is the defect exactly as GET /v1/defects/{defectId} returns it, and the Location header holds its address. Send external_ids to keep your own ids on the defect: each is a system name you choose and your id in it, and GET /v1/defects?external_system=&external_id= finds the defect by any of them. An id another defect in the company already holds for the same system is refused with external_id_conflict, so a retry that is unsure whether the first call worked can look the defect up by its id.",
        "operationId": "createDefect",
        "parameters": [
          {
            "description": "A key of 1 to 255 printable ASCII characters that you choose for this request. Send the same key and the same request again, for example after a timeout, and you get the first answer back with Idempotent-Replayed: true instead of a second defect. The same key with a different request is refused. Keys are kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDefectBodyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefectDto"
                }
              }
            },
            "description": "The defect that was created.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and true when this answer is the stored outcome of an earlier request that used the same Idempotency-Key. The write was not run again.",
                "schema": {
                  "type": "string"
                }
              },
              "Location": {
                "description": "The address of the defect just created.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "create_not_available: This company or project does not take new defects through the Public API. The detail code says why. external_id_conflict: Another defect in this company already has this id for that system. Look it up with external_system and external_id. idempotency_in_progress: A request with this Idempotency-Key is still being handled. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. idempotency_key_reused: This Idempotency-Key was already used for a different request. Send a new key with a new request.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "temporarily_unavailable: The Public API could not check this request just now. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Create a defect.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/defects/{defectId}": {
      "get": {
        "operationId": "getDefect",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefectDto"
                }
              }
            },
            "description": "The defect, with its number, status, location, Issued To lines and your own external ids. A defect the key cannot see is answered exactly like one that does not exist.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read one defect.",
        "tags": [
          "defects"
        ]
      },
      "patch": {
        "description": "Changes only the fields you send; every field you leave out keeps its value. You can change description, priority, type, custom_type_id, due_date, location_id and external_ids. Send due_date or custom_type_id as null to clear it; description, priority, type and location_id cannot be null. An empty object changes nothing. A request that asks for what the defect already is changes nothing and notifies no one, and the answer carries the same ETag. external_ids is merged system by system: a system with an id sets or replaces it, a system with id null removes it, and a system you do not list is kept. The response is the defect exactly as GET /v1/defects/{defectId} returns it. A key limited to some projects can change only the defects its own API user raised; a key for all projects can change any defect it can see. Send the ETag you last read in If-Match to change the defect only if nobody else has: if it changed since, nothing is written and the answer is 412 precondition_failed carrying the current ETag. If-Match also accepts *, and a list of ETags.",
        "operationId": "updateDefect",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The ETag you last read for this defect, as sent in the ETag header of a read or a write, for example \"abc\". The change is made only if the defect still has that ETag; otherwise nothing is written and the answer is 412 with the current ETag. * means any current version, and a comma-separated list of ETags is accepted.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDefectBodyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefectDto"
                }
              }
            },
            "description": "The defect after the change, or as it already was when nothing changed.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "412": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "precondition_failed: The defect changed after you read it. Read it again and send its new ETag in If-Match.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "temporarily_unavailable: The Public API could not check this request just now. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Change a defect.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/defects/{defectId}/close": {
      "post": {
        "description": "Closes the defect exactly as a manager pressing Close in the app would: every Issued To line the defect has is closed with it, and the defect reads closed with closed_at set. Closing a defect that is already closed changes nothing. Only a key for all projects can close a defect; a key limited to some projects is refused with 403 forbidden whatever the defect. The request takes no body fields. If the company requires a root cause before a defect is closed and this defect has none, the answer is 409 action_not_available with the detail code root_cause_required, because the Public API cannot set a root cause yet. The response is the defect exactly as GET /v1/defects/{defectId} returns it.",
        "operationId": "closeDefect",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The ETag you last read for this defect, as sent in the ETag header of a read or a write, for example \"abc\". The change is made only if the defect still has that ETag; otherwise nothing is written and the answer is 412 with the current ETag. * means any current version, and a comma-separated list of ETags is accepted.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A key of 1 to 255 printable ASCII characters that you choose for this request. Send the same key and the same request again, for example after a timeout, and you get the first answer back with Idempotent-Replayed: true instead of a second defect. The same key with a different request is refused. Keys are kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBodyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefectDto"
                }
              }
            },
            "description": "The defect after it was closed, or as it already was when it was already closed.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and true when this answer is the stored outcome of an earlier request that used the same Idempotency-Key. The write was not run again.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "action_not_available: This action is not available for this defect right now. The detail code says why. idempotency_in_progress: A request with this Idempotency-Key is still being handled. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "412": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "precondition_failed: The defect changed after you read it. Read it again and send its new ETag in If-Match.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. idempotency_key_reused: This Idempotency-Key was already used for a different request. Send a new key with a new request.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "temporarily_unavailable: The Public API could not check this request just now. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Close a defect.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/defects/{defectId}/issued-to": {
      "post": {
        "description": "Issues the defect to one of the company's trades, exactly as a person adding the trade under Issued To in the app would: the defect gets a new Issued To line for that trade, and the defect's status follows from its lines as it does in the app. Send trade_id from GET /v1/trades. due_date is the day this trade should fix the defect by; left out, it is three days after the defect was created, and null means no fix-by day for this line. Send notify_trade as false to issue the defect without emailing the trade; your own staff are still told. Issuing a trade that already has an open or pending line on the defect changes nothing. A defect can be issued to at most 11 trades. A key limited to some projects can issue trades only on the defects its own API user raised. The response is the defect exactly as GET /v1/defects/{defectId} returns it.",
        "operationId": "issueToTrade",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The ETag you last read for this defect, as sent in the ETag header of a read or a write, for example \"abc\". The change is made only if the defect still has that ETag; otherwise nothing is written and the answer is 412 with the current ETag. * means any current version, and a comma-separated list of ETags is accepted.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A key of 1 to 255 printable ASCII characters that you choose for this request. Send the same key and the same request again, for example after a timeout, and you get the first answer back with Idempotent-Replayed: true instead of a second defect. The same key with a different request is refused. Keys are kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IssueToTradeBodyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefectDto"
                }
              }
            },
            "description": "The defect after it was issued, or as it already was when the trade already had an open line.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and true when this answer is the stored outcome of an earlier request that used the same Idempotency-Key. The write was not run again.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "action_not_available: This action is not available for this defect right now. The detail code says why. idempotency_in_progress: A request with this Idempotency-Key is still being handled. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "412": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "precondition_failed: The defect changed after you read it. Read it again and send its new ETag in If-Match.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. idempotency_key_reused: This Idempotency-Key was already used for a different request. Send a new key with a new request.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "temporarily_unavailable: The Public API could not check this request just now. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Issue a defect to a trade.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/defects/{defectId}/issued-to/{tradeId}": {
      "delete": {
        "description": "Removes the trade from the defect's Issued To, exactly as a person removing it in the app would: every line the defect has for that trade is removed, and the defect's status follows from the lines that are left. Removing a trade that has no line on the defect changes nothing. A key limited to some projects can remove trades only on the defects its own API user raised. The response is the defect exactly as GET /v1/defects/{defectId} returns it.",
        "operationId": "removeTrade",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "tradeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The ETag you last read for this defect, as sent in the ETag header of a read or a write, for example \"abc\". The change is made only if the defect still has that ETag; otherwise nothing is written and the answer is 412 with the current ETag. * means any current version, and a comma-separated list of ETags is accepted.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefectDto"
                }
              }
            },
            "description": "The defect after the trade was removed, or as it already was when the trade had no line.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "412": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "precondition_failed: The defect changed after you read it. Read it again and send its new ETag in If-Match.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "temporarily_unavailable: The Public API could not check this request just now. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Take a defect off a trade.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/defects/{defectId}/notes": {
      "get": {
        "description": "The live notes of the defect, each with its audience: staff (only the company's own people), trade, tenant, client or everyone. A key reads notes of every audience, so check the audience before showing a note to anyone outside the company. Deleted notes are never returned. Reading notes through the API changes nothing in IssuesID: it is not counted as someone having read the conversation.",
        "operationId": "listNotes",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteListDto"
                }
              }
            },
            "description": "One page of notes, with the cursor for the next page and the as_of of the walk. A defect the key cannot see is answered exactly like one that does not exist.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List a defect's notes, oldest first, a page at a time.",
        "tags": [
          "defects"
        ]
      },
      "post": {
        "description": "Adds a note to the defect's conversation, exactly as a staff member adding a note in the app would, with one difference: a note added through the Public API is always staff only. Only the company's own people see it, and nobody outside the company is emailed or told about it, so there is no audience field and any other key in the body is refused with 422 unknown_field. Send body as plain text of at least one visible character and at most 10,000; it is stored and returned exactly as sent. Text such as @Jane Smith stays plain text: it does not tag anyone, give anyone access to the defect or send a mention notification, though the company's staff are told about the note as they are for a note added in the app. The note is written by the API user named after the key, and the defect's modified_at and ETag move. A key limited to some projects can add a note to any defect it can see, including one it did not raise. The response is the note exactly as GET /v1/defects/{defectId}/notes lists it.",
        "operationId": "addNote",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A key of 1 to 255 printable ASCII characters that you choose for this request. Send the same key and the same request again, for example after a timeout, and you get the first answer back with Idempotent-Replayed: true instead of a second defect. The same key with a different request is refused. Keys are kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateNoteBodyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NoteDto"
                }
              }
            },
            "description": "The note that was added.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "Present and true when this answer is the stored outcome of an earlier request that used the same Idempotency-Key. The write was not run again.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "idempotency_in_progress: A request with this Idempotency-Key is still being handled. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. idempotency_key_reused: This Idempotency-Key was already used for a different request. Send a new key with a new request.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Add a staff note to a defect.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/defects/{defectId}/photos": {
      "get": {
        "description": "The confirmed photos of the defect. Each photo has a download link (url) and, once the small version has been made, a thumbnail link (thumbnail_url). The links are made for the request and stop working at url_expires_at, one hour later; the response must not be cached, so ask again when you need a photo rather than keeping a link. Other files attached to the defect, such as PDFs, are not listed, and neither is who took a photo or where.",
        "operationId": "listPhotos",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhotoListDto"
                }
              }
            },
            "description": "One page of photos, with the cursor for the next page and the as_of of the walk. A defect the key cannot see is answered exactly like one that does not exist.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List a defect's photos, oldest upload first, a page at a time.",
        "tags": [
          "defects"
        ]
      },
      "post": {
        "description": "The first of three steps to add a photo to a defect. 1. Send file_name, content_type (image/jpeg, image/png, image/webp, image/heic or image/heif) and size_bytes (1 to 26,214,400, the exact size of the file). The answer holds a photo_id and an upload_url. 2. Send the file's bytes to upload_url with the HTTP method in upload_method, the headers in upload_headers exactly as given and exactly size_bytes bytes as the body, before upload_expires_at, 15 minutes after the answer. The link accepts only that type and that size. 3. Confirm the upload with the photo_id; until then the photo does not exist: it is not listed by GET /v1/defects/{defectId}/photos and does not appear on the defect. Send captured_at when you know when the photo was taken. A key limited to some projects can add a photo to any defect it can see. The answer must not be cached. A repeated request with the same Idempotency-Key and body returns the same photo_id with a freshly signed upload_url and the header Idempotent-Replayed: true, and makes no second upload.",
        "operationId": "requestPhotoUpload",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A key of 1 to 255 printable ASCII characters that you choose for this request. Send the same key and the same request again, for example after a timeout, and you get the first answer back with Idempotent-Replayed: true instead of a second defect. The same key with a different request is refused. Keys are kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PhotoUploadRequestBodyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhotoUploadTicketDto"
                }
              }
            },
            "description": "Where to send the file, how, and the id the photo will have.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "Present and true when this answer is the stored outcome of an earlier request that used the same Idempotency-Key. The write was not run again.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "action_not_available: This action is not available for this defect right now. The detail code says why. idempotency_in_progress: A request with this Idempotency-Key is still being handled. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. idempotency_key_reused: This Idempotency-Key was already used for a different request. Send a new key with a new request.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Start a photo upload on a defect.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/defects/{defectId}/photos/{photoId}/confirm": {
      "post": {
        "description": "The third step to add a photo to a defect, after the file was sent to the upload_url of POST /v1/defects/{defectId}/photos. The photo_id is the one that answer gave. The file is checked first: it must have arrived, be exactly the size_bytes and content_type that were declared, and start with the bytes of that image format. If it has not arrived yet the answer is 409 upload_missing and nothing changes: finish the upload, then confirm again. If it arrived but is not what was declared the answer is 422 upload_rejected with one detail naming the reason (size_mismatch, too_large, type_mismatch or content_mismatch), the file and its upload record are removed, and you start again from POST /v1/defects/{defectId}/photos. Only a file that passes is confirmed; it is listed by GET /v1/defects/{defectId}/photos from then on, moves the defect modified_at and ETag once, and gets a thumbnail shortly after. The response is the photo exactly as that list returns it. Confirming a photo that is already confirmed changes nothing and answers the same, so a retry is safe. The check of the type, the size and the first bytes of the file runs once, at confirm, and is a best effort check of the file as it is then. The upload link itself stays writable until it expires, 15 minutes after it was issued, so confirm only after the upload has finished. The answer must not be cached.",
        "operationId": "confirmPhoto",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "photoId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A key of 1 to 255 printable ASCII characters that you choose for this request. Send the same key and the same request again, for example after a timeout, and you get the first answer back with Idempotent-Replayed: true instead of a second defect. The same key with a different request is refused. Keys are kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PhotoDto"
                }
              }
            },
            "description": "The confirmed photo.",
            "headers": {
              "Idempotent-Replayed": {
                "description": "Present and true when this answer is the stored outcome of an earlier request that used the same Idempotency-Key. The write was not run again.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "upload_missing: The file has not arrived yet. Upload it to upload_url, then confirm again. idempotency_in_progress: A request with this Idempotency-Key is still being handled. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. idempotency_key_reused: This Idempotency-Key was already used for a different request. Send a new key with a new request. upload_rejected: The uploaded file does not match what was declared, so it was removed. Ask for a new upload.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Confirm a photo upload.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/defects/{defectId}/reopen": {
      "post": {
        "description": "Reopens a closed defect exactly as a manager pressing Reopen in the app would: its Issued To lines are opened again and the defect's status follows from them. Reopening a defect that is not closed changes nothing, and in particular never resets the progress a trade has recorded on its lines. Only a key for all projects can reopen a defect; a key limited to some projects is refused with 403 forbidden whatever the defect. The request takes no body fields. The response is the defect exactly as GET /v1/defects/{defectId} returns it.",
        "operationId": "reopenDefect",
        "parameters": [
          {
            "in": "path",
            "name": "defectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The ETag you last read for this defect, as sent in the ETag header of a read or a write, for example \"abc\". The change is made only if the defect still has that ETag; otherwise nothing is written and the answer is 412 with the current ETag. * means any current version, and a comma-separated list of ETags is accepted.",
            "in": "header",
            "name": "If-Match",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A key of 1 to 255 printable ASCII characters that you choose for this request. Send the same key and the same request again, for example after a timeout, and you get the first answer back with Idempotent-Replayed: true instead of a second defect. The same key with a different request is refused. Keys are kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "maxLength": 255,
              "minLength": 1,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmptyBodyDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefectDto"
                }
              }
            },
            "description": "The defect after it was reopened, or as it already was when it was not closed.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "Idempotent-Replayed": {
                "description": "Present and true when this answer is the stored outcome of an earlier request that used the same Idempotency-Key. The write was not run again.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "idempotency_in_progress: A request with this Idempotency-Key is still being handled. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "412": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "precondition_failed: The defect changed after you read it. Read it again and send its new ETag in If-Match.",
            "headers": {
              "ETag": {
                "description": "The version of this defect. Send it back in If-Match to change the defect only if nobody else has.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. idempotency_key_reused: This Idempotency-Key was already used for a different request. Send a new key with a new request.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "temporarily_unavailable: The Public API could not check this request just now. Try again after the time in the Retry-After header.",
            "headers": {
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Reopen a closed defect.",
        "tags": [
          "defects"
        ]
      }
    },
    "/v1/diary-entries": {
      "get": {
        "description": "Every entry the key can see, ordered by when it was created, each with its subcontractors, labour, delays, plant and visitors. Drafts are included, with status draft. Filter by project_id, by from and to (inclusive bounds on entry_date) and by status. A walk is bounded by the as_of returned on its first page, so it always ends. A submitted entry can still change, because site gate sign-ins and approved timesheets write into it, so read modified_at to see whether your copy is current.",
        "operationId": "listEntries",
        "parameters": [
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          },
          {
            "description": "Only the entries of this project. A project the key cannot see, or that does not exist, is answered exactly as GET /v1/projects/{projectId} answers it: not_found.",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Only entries on or after this day, as YYYY-MM-DD. It is an inclusive bound on entry_date. It must be a real calendar day.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "Only entries on or before this day, as YYYY-MM-DD. It is an inclusive bound on entry_date. It must be a real calendar day and not before from.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date",
              "type": "string"
            }
          },
          {
            "description": "Only entries in this status: draft or submitted.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "draft",
                "submitted"
              ],
              "type": "string"
            }
          },
          {
            "description": "Return only entries that changed at or after this moment, with deletions as markers (a sync). An entry changes when its header, its status or any section line under it changes. It must end in Z or an offset such as +10:00 (percent-encode the plus sign), and may carry up to six fractional digits. A value older than 90 days is refused with sync_window_expired: run a full resync without it. The status, from and to filters do not remove deletion markers; project_id does. Start each sync a few minutes before the as_of of the last one.",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiaryEntryListDto"
                }
              }
            },
            "description": "One page of diary entries, with the cursor for the next page and the as_of of the walk. A key limited to some projects sees only the entries of those projects.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. sync_window_expired: The updated_since value is older than the 90 days of changes the Public API keeps. Run a full resync without updated_since.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List the diary entries the key can see, oldest first, a page at a time.",
        "tags": [
          "diary"
        ]
      }
    },
    "/v1/diary-entries/{entryId}": {
      "get": {
        "description": "The entry carries its subcontractors, labour, delays, plant and visitors. Drafts are returned with status draft. A submitted entry can still change, because site gate sign-ins and approved timesheets write into it, so read modified_at to see whether your copy is current. An entry the key cannot see is answered exactly like one that does not exist.",
        "operationId": "getEntry",
        "parameters": [
          {
            "in": "path",
            "name": "entryId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DiaryEntryDto"
                }
              }
            },
            "description": "The diary entry with its five sections, times as local site times written HH:MM. A key limited to some projects reads only the entries of those projects.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read one diary entry with its day sections.",
        "tags": [
          "diary"
        ]
      }
    },
    "/v1/form-submissions": {
      "get": {
        "description": "Each item is a lean summary of one submitted or closed form of either kind: who filed it, when, from which form and version, on which project and location, its status, title and severity, and when it last changed. It carries no question responses and no location reading from the phone: read each changed submission by id for those. Drafts are never listed, and a filed form is never deleted, so there are no deletion markers. A key that covers all projects sees every filed form of the company, including those filed with no project, except those on a deleted project. A key limited to some projects is refused with 403 forbidden, because the app shows that kind of user only the forms they filed themselves and the API user files none. Pass updated_since to read only the filed forms that changed since your last sync, then read each changed submission by id. A project_id the key cannot see is answered as not found, and a form_id the key cannot see returns an empty list.",
        "operationId": "listFormSubmissions",
        "parameters": [
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          },
          {
            "description": "Only the filed forms of this project. A project the key cannot see, or that does not exist, is answered exactly as GET /v1/projects/{projectId} answers it: not_found.",
            "in": "query",
            "name": "project_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Only the forms filed from this form. A form id the key cannot see, or that does not exist, returns an empty list.",
            "in": "query",
            "name": "form_id",
            "required": false,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          },
          {
            "description": "Only filed forms of this kind: incident or general.",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "incident",
                "general"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only filed forms in this status: submitted or closed.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "submitted",
                "closed"
              ],
              "type": "string"
            }
          },
          {
            "description": "Return only filed forms that changed at or after this moment, ordered by when they changed (a sync). A filed form changes when it is submitted, closed or reopened, or when its contractor is merged into another. There are no deletion markers because a filed form is never deleted. It must end in Z or an offset such as +10:00 (percent-encode the plus sign), and may carry up to six fractional digits. A value older than 90 days is refused with sync_window_expired: run a full resync without it. Start each sync a few minutes before the as_of of the last one.",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormSubmissionListDto"
                }
              }
            },
            "description": "One page of filed form summaries, with the cursor for the next page and the as_of of the walk.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields. sync_window_expired: The updated_since value is older than the 90 days of changes the Public API keeps. Run a full resync without updated_since.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List the filed forms of the company, oldest submitted first, a page at a time.",
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/form-submissions/{submissionId}": {
      "get": {
        "description": "Every key of the list item, plus the asset, worker and trade the form is about (each an id and a name, or null), the close note, the phone's own position when the form was filed (geo, a reading and not a verified position, null when none was asked for) and the answers. The answers hold one entry for every question of the version the form was filled against, in question order, information blocks excepted: the question id, its type and a value encoded by the type, or null when the question was not answered or the form hides it because of another answer. Photo answers list photo ids, which download from the photos of the submission. A signature answer lists who signed and when; the drawn image, the address and the device are never included. A draft, a form on a deleted project, another company's form and an id that does not exist all answer with the same not found error. A key limited to some projects is refused with 403 forbidden, whatever the id.",
        "operationId": "getFormSubmission",
        "parameters": [
          {
            "in": "path",
            "name": "submissionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormSubmissionDto"
                }
              }
            },
            "description": "The filed form with its answers, as the app shows it to the person the key acts as.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read one filed form with its answers.",
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/form-submissions/{submissionId}/photos": {
      "get": {
        "description": "The confirmed photos that the answers of the filed form name, for the questions the form shows. A photo of a question the form hides because of another answer is not listed, and neither is an upload that was never finished. Each photo has a download link (url) and, once the small version has been made, a thumbnail link (thumbnail_url). The links are made for the request and stop working at url_expires_at, one hour later; the response must not be cached, so ask again when you need a photo rather than keeping a link. Who took a photo and where are not listed. A draft, a form on a deleted project, another company's form and an id that does not exist all answer with the same not found error as the filed form itself. A key limited to some projects is refused with 403 forbidden, whatever the id.",
        "operationId": "listFormSubmissionPhotos",
        "parameters": [
          {
            "in": "path",
            "name": "submissionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormSubmissionPhotoListDto"
                }
              }
            },
            "description": "One page of photos, with the cursor for the next page and the as_of of the walk. A filed form the key cannot see is answered exactly like one that does not exist.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List a filed form's photos, oldest upload first, a page at a time.",
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms": {
      "get": {
        "description": "Each form is a company form that has been published, with its name, kind, project and the number of its latest published version. A draft that was never published is never listed. A new published version of a form shows as a higher current_version. A key that covers all projects sees every published form of both kinds, retired ones included with archived true. A key limited to some projects sees every published company form and the project forms of its own projects, and no archived form. There is no updated_since: this is a small list, so read it again to see changes. A company that has never opened its forms in the app may show no starter incident forms yet, because the Public API never creates anything when it reads.",
        "operationId": "listForms",
        "parameters": [
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormListDto"
                }
              }
            },
            "description": "One page of form definitions, with the cursor for the next page and the as_of of the walk.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List the published form definitions the key can see, oldest first, a page at a time.",
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/{formId}": {
      "get": {
        "description": "The same object the list returns. A form the key cannot see, a form that was never published and a form that does not exist all answer with the same not found error.",
        "operationId": "getForm",
        "parameters": [
          {
            "in": "path",
            "name": "formId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormDto"
                }
              }
            },
            "description": "The form definition: its id, name, kind, project, whether it is archived and its latest published version.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read one published form definition.",
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/forms/{formId}/versions/{version}": {
      "get": {
        "description": "A published version never changes, so you can keep it. A filed form names the version it was filled against in its schema_version, and this route returns that version's questions. Questions that depend on another answer say so in visible_when. Defect-raising rules, embedded images and the form designer's settings are never included. A version number that is not a positive whole number is refused. A form the key cannot see answers with the not found error of a form, and a version the form does not have answers with the not found error of a form version.",
        "operationId": "getFormVersion",
        "parameters": [
          {
            "in": "path",
            "name": "formId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "version",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FormVersionDto"
                }
              }
            },
            "description": "The form id, version number, name, kind, publish time and questions of that version.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read the questions of one published version of a form.",
        "tags": [
          "forms"
        ]
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "me",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicApiMeResponse"
                }
              }
            },
            "description": "The key, the company, the API user and the limits for this request.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Show which key, company and projects this request is for.",
        "tags": [
          "me"
        ]
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "listProjects",
        "parameters": [
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectListDto"
                }
              }
            },
            "description": "One page of projects. A project-list key sees exactly its own projects, an all-projects key every project of the company. Archived projects are listed with archived true; deleted projects are never listed.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List the projects the key can see, oldest first, a page at a time.",
        "tags": [
          "reference"
        ]
      }
    },
    "/v1/projects/{projectId}": {
      "get": {
        "operationId": "getProject",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectDto"
                }
              }
            },
            "description": "The project, with the nine statuses and the words it shows for them. A project the key cannot see is answered exactly like one that does not exist.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read one project.",
        "tags": [
          "reference"
        ]
      }
    },
    "/v1/projects/{projectId}/job-checklist-tasks": {
      "get": {
        "description": "Only a key that covers all projects can read job checklists. A key limited to some projects is refused with the error code forbidden, on a project it can see. A project the key cannot see at all is answered exactly like one that does not exist. Sort the tasks by stage_order, then sort_order, to show the checklist as the app does. There is no updated_since: a task removed in the app is deleted outright and leaves no marker, so to keep a copy in step, read each project's checklist again.",
        "operationId": "listTasks",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobTaskListDto"
                }
              }
            },
            "description": "One page of the project's tasks, with the cursor for the next page and the as_of of the walk. A project with no checklist returns an empty page. An archived project's tasks can be read.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List a project's job checklist tasks, oldest first, a page at a time.",
        "tags": [
          "job-checklists"
        ]
      }
    },
    "/v1/projects/{projectId}/locations": {
      "get": {
        "operationId": "listProjectLocations",
        "parameters": [
          {
            "in": "path",
            "name": "projectId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationListDto"
                }
              }
            },
            "description": "One page of the project's locations. Each names its parent so the tree can be rebuilt; a location with no parent in this project has a null parent_id. A project the key cannot see is answered exactly like one that does not exist.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "not_found: No record with that id.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List a project's locations as a flat list, oldest first, a page at a time.",
        "tags": [
          "reference"
        ]
      }
    },
    "/v1/trades": {
      "get": {
        "operationId": "listTrades",
        "parameters": [
          {
            "description": "How many rows to return. The most allowed is 200; a larger value is refused, not reduced.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The next_cursor from the previous page of this list. Leave it out for the first page. It only works with the same list and the same filters.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "maxLength": 1024,
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TradeListDto"
                }
              }
            },
            "description": "One page of trades, with the cursor for the next page and the as_of of the walk.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "credential_in_query: Send the API key in the Authorization header, never in the query string. invalid_request: The request could not be read.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "unauthorized: The API key is missing, malformed, unknown, expired or revoked.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "api_not_enabled: The Public API is not enabled for this company. forbidden: This API key is not allowed to do that.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "validation_failed: The request has invalid fields.",
            "headers": {
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorEnvelopeDto"
                }
              }
            },
            "description": "rate_limited: Too many requests. Wait for the time in the Retry-After header.",
            "headers": {
              "RateLimit-Limit": {
                "description": "The most requests this key may make each minute under the limit that applies.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Remaining": {
                "description": "Whole requests left before the limit is reached.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Reset": {
                "description": "Whole seconds until the limit is full again.",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Whole seconds to wait before trying again.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The id of this request. Quote it if you contact support.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List the trades defects can be issued to, oldest first, a page at a time.",
        "tags": [
          "reference"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api.issuesid.com"
    }
  ],
  "tags": []
}
