{
  "openapi": "3.1.0",
  "info": {
    "title": "SealDrop API",
    "version": "v1",
    "description": "Send secure document requests, pull documents and answers, and read the audit trail from your own systems. Data stays in Canada."
  },
  "servers": [
    {
      "url": "https://api.sealdrop.ca"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key: `sd_live_…` or `sd_test_…`."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A stable, machine-readable code (see Errors)."
              },
              "message": {
                "type": "string",
                "description": "A human-readable explanation. Never contains submitted values."
              },
              "requestId": {
                "type": "string",
                "description": "Quote this when contacting SealDrop."
              },
              "contactId": {
                "description": "With duplicate_email, duplicate_phone or duplicate_idNumber: the existing contact.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "requestId"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "Me": {
        "type": "object",
        "properties": {
          "organization": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The organization's id."
              },
              "name": {
                "type": "string",
                "description": "Its name, as its clients see it."
              },
              "timeZone": {
                "type": "string",
                "description": "IANA time zone, e.g. America/Toronto. All API times are UTC; use this to show them."
              }
            },
            "required": [
              "id",
              "name",
              "timeZone"
            ],
            "additionalProperties": false
          },
          "key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The key's id (it appears in the organization's audit log)."
              },
              "name": {
                "type": "string",
                "description": "The name the admin gave the key."
              },
              "mode": {
                "type": "string",
                "enum": [
                  "live",
                  "test"
                ],
                "description": "`test` keys never email or text a real person."
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "requests:read",
                    "files:read",
                    "answers:read",
                    "requests:write",
                    "audit:read",
                    "contacts:read",
                    "contacts:write",
                    "sends:write",
                    "forms:read",
                    "forms:write"
                  ]
                },
                "description": "What this key may do."
              },
              "expiresAt": {
                "type": "string",
                "description": "When the key stops working. ISO 8601, UTC."
              }
            },
            "required": [
              "id",
              "name",
              "mode",
              "scopes",
              "expiresAt"
            ],
            "additionalProperties": false
          },
          "limits": {
            "type": "object",
            "properties": {
              "perMinute": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Calls per minute for this key."
              },
              "perDay": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991,
                "description": "Calls per day for the whole organization."
              }
            },
            "required": [
              "perMinute",
              "perDay"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "organization",
          "key",
          "limits"
        ],
        "additionalProperties": false
      },
      "RequestPage": {
        "type": "object",
        "properties": {
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Request"
            }
          },
          "nextCursor": {
            "description": "Pass as `cursor` for the next page; null on the last.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "requests",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "Request": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "reference": {
            "type": "string",
            "description": "The SealDrop reference (SD-…) people see. Never put it in a URL."
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "received",
              "downloaded",
              "filed",
              "expired",
              "cancelled"
            ],
            "description": "sent → received (the person submitted) → downloaded → filed. Or expired / cancelled."
          },
          "test": {
            "type": "boolean",
            "description": "Made with a test key. Test keys see only test requests; live keys never see them."
          },
          "person": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mobile": {
                "description": "E.164, e.g. +16045550123.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "name",
              "email",
              "mobile"
            ],
            "additionalProperties": false,
            "description": "Who it was sent to, as entered (for an open link, as the person typed it)."
          },
          "source": {
            "type": "string",
            "enum": [
              "app",
              "api",
              "open_link",
              "group_send",
              "recurring"
            ],
            "description": "Where it came from: sent in the app, through the API, started by the person on an open link, part of a group send, or a recurring request."
          },
          "openLinkId": {
            "description": "For `open_link`: which open link.",
            "type": [
              "string",
              "null"
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "email",
                "sms"
              ]
            }
          },
          "note": {
            "description": "The note shown to the person.",
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "description": "The person's reply message, when replies were allowed.",
            "type": [
              "string",
              "null"
            ]
          },
          "questionnaire": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "filesRequired": {
            "type": "boolean"
          },
          "fileCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Files the person uploaded (not counting the answers PDF)."
          },
          "blockedFiles": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Files deleted by the malware scan."
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "submittedAt": {
            "description": "ISO 8601, UTC, or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "linkExpiresAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "deleteAt": {
            "description": "When SealDrop deletes the files, if nobody does sooner.",
            "type": [
              "string",
              "null"
            ]
          },
          "filesDeletedAt": {
            "description": "ISO 8601, UTC, or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "importedAt": {
            "description": "When a system confirmed it imported the documents (POST …/imported).",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "reference",
          "status",
          "test",
          "person",
          "source",
          "openLinkId",
          "channels",
          "note",
          "message",
          "questionnaire",
          "filesRequired",
          "fileCount",
          "blockedFiles",
          "createdAt",
          "submittedAt",
          "linkExpiresAt",
          "deleteAt",
          "filesDeletedAt",
          "importedAt"
        ],
        "additionalProperties": false
      },
      "RequestDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "reference": {
            "type": "string",
            "description": "The SealDrop reference (SD-…) people see. Never put it in a URL."
          },
          "status": {
            "type": "string",
            "enum": [
              "sent",
              "received",
              "downloaded",
              "filed",
              "expired",
              "cancelled"
            ],
            "description": "sent → received (the person submitted) → downloaded → filed. Or expired / cancelled."
          },
          "test": {
            "type": "boolean",
            "description": "Made with a test key. Test keys see only test requests; live keys never see them."
          },
          "person": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "mobile": {
                "description": "E.164, e.g. +16045550123.",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "name",
              "email",
              "mobile"
            ],
            "additionalProperties": false,
            "description": "Who it was sent to, as entered (for an open link, as the person typed it)."
          },
          "source": {
            "type": "string",
            "enum": [
              "app",
              "api",
              "open_link",
              "group_send",
              "recurring"
            ],
            "description": "Where it came from: sent in the app, through the API, started by the person on an open link, part of a group send, or a recurring request."
          },
          "openLinkId": {
            "description": "For `open_link`: which open link.",
            "type": [
              "string",
              "null"
            ]
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "email",
                "sms"
              ]
            }
          },
          "note": {
            "description": "The note shown to the person.",
            "type": [
              "string",
              "null"
            ]
          },
          "message": {
            "description": "The person's reply message, when replies were allowed.",
            "type": [
              "string",
              "null"
            ]
          },
          "questionnaire": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "filesRequired": {
            "type": "boolean"
          },
          "fileCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Files the person uploaded (not counting the answers PDF)."
          },
          "blockedFiles": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Files deleted by the malware scan."
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "submittedAt": {
            "description": "ISO 8601, UTC, or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "linkExpiresAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "deleteAt": {
            "description": "When SealDrop deletes the files, if nobody does sooner.",
            "type": [
              "string",
              "null"
            ]
          },
          "filesDeletedAt": {
            "description": "ISO 8601, UTC, or null.",
            "type": [
              "string",
              "null"
            ]
          },
          "importedAt": {
            "description": "When a system confirmed it imported the documents (POST …/imported).",
            "type": [
              "string",
              "null"
            ]
          },
          "files": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/File"
            }
          }
        },
        "required": [
          "id",
          "reference",
          "status",
          "test",
          "person",
          "source",
          "openLinkId",
          "channels",
          "note",
          "message",
          "questionnaire",
          "filesRequired",
          "fileCount",
          "blockedFiles",
          "createdAt",
          "submittedAt",
          "linkExpiresAt",
          "deleteAt",
          "filesDeletedAt",
          "importedAt",
          "files"
        ],
        "additionalProperties": false
      },
      "File": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "The file name, as the download will be named."
          },
          "contentType": {
            "type": "string",
            "description": "application/pdf, image/jpeg, image/png or image/heic."
          },
          "size": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Bytes."
          },
          "kind": {
            "type": "string",
            "enum": [
              "upload",
              "answers"
            ],
            "description": "`answers` is the questionnaire answers PDF SealDrop made; `upload` a file the person sent."
          },
          "scan": {
            "type": "string",
            "enum": [
              "pending",
              "clean",
              "infected",
              "unscannable"
            ],
            "description": "Only `clean` files can be downloaded. Infected or unscannable files are deleted and never served."
          },
          "deleted": {
            "type": "boolean",
            "description": "The file is gone (filed, imported, or its deletion date passed)."
          },
          "uploadedAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "downloadedAt": {
            "description": "First time anyone downloaded it (staff or API), or null.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "name",
          "contentType",
          "size",
          "kind",
          "scan",
          "deleted",
          "uploadedAt",
          "downloadedAt"
        ],
        "additionalProperties": false
      },
      "Download": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "A link to the clean copy. GET it within 5 minutes; no Authorization header."
          },
          "expiresAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          }
        },
        "required": [
          "url",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "Answers": {
        "type": "object",
        "properties": {
          "questionnaire": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "submittedAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "answers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Never changes: `dateOfBirth` (and `idNumber`, when asked) for the fixed fields; the organization’s own questions `q1`, `q2`… — kept when questions are moved or reworded, never reused for another question."
                },
                "title": {
                  "type": "string",
                  "description": "The question as the person saw it."
                },
                "type": {
                  "type": "string",
                  "description": "text, comment, radiogroup, dropdown, checkbox, boolean, signaturepad or matrix (a rating grid)."
                },
                "value": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ],
                  "description": "Choices as their visible text; null when unanswered; a signature is in the answers PDF (`signed`); a rating grid is one `Item: Choice` line per item answered."
                }
              },
              "required": [
                "name",
                "title",
                "type",
                "value"
              ],
              "additionalProperties": false
            }
          },
          "pdfFileId": {
            "description": "The answers PDF among the request’s files.",
            "type": [
              "string",
              "null"
            ]
          },
          "scores": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "value": {
                  "type": "number"
                },
                "band": {
                  "description": "The band the organization defined for this value, if any.",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "name",
                "value",
                "band"
              ],
              "additionalProperties": false
            },
            "description": "The questionnaire’s own scores, worked out by SealDrop on submit (empty when it has none)."
          },
          "calculations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "value": {
                  "type": "number"
                }
              },
              "required": [
                "name",
                "value"
              ],
              "additionalProperties": false
            },
            "description": "The questionnaire’s calculations that have a value (ages, totals, formulas)."
          },
          "flags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why the request needs review: the organization’s own reasons, from its flag rules."
          }
        },
        "required": [
          "questionnaire",
          "submittedAt",
          "answers",
          "pdfFileId",
          "scores",
          "calculations",
          "flags"
        ],
        "additionalProperties": false
      },
      "Imported": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "deleted",
              "kept"
            ],
            "description": "`deleted`: SealDrop is deleting its copy now (the organization’s default). `kept`: staff review it first, then it is deleted on the usual schedule."
          },
          "request": {
            "$ref": "#/components/schemas/Request"
          }
        },
        "required": [
          "action",
          "request"
        ],
        "additionalProperties": false
      },
      "AuditPage": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "at": {
                  "type": "string",
                  "description": "ISO 8601, UTC."
                },
                "action": {
                  "type": "string",
                  "description": "e.g. request.created, person.uploaded, person.submitted, file.downloaded, request.filed."
                },
                "actor": {
                  "type": "string",
                  "description": "staff:{id}, apikey:{id}, person (who the request went to), system or operator:{id}."
                },
                "actorName": {
                  "description": "A staff member's work email or an API key's name.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "ip": {
                  "type": "string"
                },
                "requestId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fileId": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "at",
                "action",
                "actor",
                "actorName",
                "ip",
                "requestId",
                "fileId"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "events",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "EventPage": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "evt_… — unique; use it to skip duplicates."
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "request.sent",
                    "request.received",
                    "request.file_scanned",
                    "request.files_blocked",
                    "request.downloaded",
                    "request.imported",
                    "request.filed",
                    "request.expired",
                    "request.cancelled",
                    "request.files_deleted",
                    "request.email_bounced",
                    "batch.finished",
                    "contact.created",
                    "contact.unsubscribed"
                  ]
                },
                "at": {
                  "type": "string",
                  "description": "ISO 8601, UTC."
                },
                "requestId": {
                  "description": "For request.* events.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "fileId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "batchId": {
                  "description": "For batch.finished (a group send).",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "contactId": {
                  "description": "For contact.created and contact.unsubscribed.",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "type",
                "at",
                "requestId",
                "fileId",
                "batchId",
                "contactId"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "description": "Pass as `after` next time; it is returned even on the last page, so you can keep polling from it.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "events",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "NewRequest": {
        "type": "object",
        "properties": {
          "person": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "description": "Who the request is for, as your staff would write it."
              },
              "email": {
                "description": "Needed when channels include email (the default).",
                "type": "string",
                "maxLength": 254
              },
              "mobile": {
                "description": "Needed when channels include sms. Any North American format.",
                "type": "string",
                "maxLength": 30
              },
              "firstName": {
                "description": "Used only if the organization allows first names in emails; defaults to the first word of name.",
                "type": "string",
                "maxLength": 60
              }
            },
            "required": [
              "name"
            ],
            "additionalProperties": false
          },
          "channels": {
            "description": "Default [\"email\"]. Text messages need texts on the organization’s plan.",
            "minItems": 1,
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "email",
                "sms"
              ]
            }
          },
          "note": {
            "description": "Shown to the person on the upload page.",
            "type": "string",
            "maxLength": 1000
          },
          "questionnaireId": {
            "description": "From GET /v1/questionnaires. A copy is frozen into the request.",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "filesRequired": {
            "description": "At least one document before they can submit. Default: required unless there is a questionnaire.",
            "type": "boolean"
          },
          "allowReply": {
            "description": "Let the person write back once, with their upload.",
            "type": "boolean"
          },
          "emailDesignId": {
            "description": "From GET /v1/email-designs; \"plain\" for the plain wording; default: the organization’s default design.",
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "string",
                "const": "plain"
              }
            ]
          },
          "contactId": {
            "description": "An existing contact of the organization; the request is linked to it.",
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": [
          "person"
        ],
        "additionalProperties": false
      },
      "Sent": {
        "type": "object",
        "properties": {
          "request": {
            "$ref": "#/components/schemas/Request"
          },
          "delivery": {
            "type": "object",
            "properties": {
              "email": {
                "type": "string",
                "enum": [
                  "sent",
                  "sent_to_test_recipient",
                  "daily_limit",
                  "failed"
                ]
              },
              "sms": {
                "type": "string",
                "enum": [
                  "sent",
                  "not_sent_test",
                  "not_verified",
                  "opted_out",
                  "sms_off",
                  "daily_text_limit",
                  "number_limit",
                  "failed"
                ]
              }
            },
            "additionalProperties": false,
            "description": "Per channel. With a test key: the email goes only to the admin who created the key, and no text is sent."
          }
        },
        "required": [
          "request",
          "delivery"
        ],
        "additionalProperties": false
      },
      "RequestResult": {
        "type": "object",
        "properties": {
          "request": {
            "$ref": "#/components/schemas/Request"
          }
        },
        "required": [
          "request"
        ],
        "additionalProperties": false
      },
      "Questionnaires": {
        "type": "object",
        "properties": {
          "questionnaires": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "questionCount": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "id",
                "name",
                "questionCount"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "questionnaires"
        ],
        "additionalProperties": false
      },
      "EmailDesigns": {
        "type": "object",
        "properties": {
          "designs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "isDefault": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "isDefault"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "designs"
        ],
        "additionalProperties": false
      },
      "ContactPage": {
        "type": "object",
        "properties": {
          "contacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          },
          "deleted": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "With updatedSince: ids deleted since then."
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "asOf": {
            "type": "string",
            "description": "Pass as updatedSince next time to get only what changed."
          }
        },
        "required": [
          "contacts",
          "deleted",
          "nextCursor",
          "asOf"
        ],
        "additionalProperties": false
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "mobile": {
            "description": "E.164, e.g. +16045550123.",
            "type": [
              "string",
              "null"
            ]
          },
          "dateOfBirth": {
            "description": "YYYY-MM-DD, when known: entered by staff, given on a sign-up page or an open link’s questionnaire, or set through the API.",
            "type": [
              "string",
              "null"
            ]
          },
          "idNumber": {
            "description": "The organization’s client ID (a government-issued number or its own, as set in Settings), whole; null when the client has none. Staff see it masked in the app.",
            "type": [
              "string",
              "null"
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "app",
              "api",
              "import",
              "signup_page",
              "open_link"
            ],
            "description": "How they were added."
          },
          "sourceId": {
            "description": "For `signup_page` and `open_link`: which page or link.",
            "type": [
              "string",
              "null"
            ]
          },
          "signup": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "pageId": {
                    "type": "string"
                  },
                  "pageName": {
                    "type": "string"
                  },
                  "at": {
                    "type": "string",
                    "description": "ISO 8601, UTC."
                  },
                  "answers": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "label": {
                          "type": "string"
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "sensitive": {
                          "description": "A question the organization marked Sensitive: masked for its staff in the app, whole here.",
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "label",
                        "value"
                      ],
                      "additionalProperties": false
                    },
                    "description": "Each question as it was asked, and the answer (choices as their text)."
                  }
                },
                "required": [
                  "pageId",
                  "pageName",
                  "at",
                  "answers"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "What they answered on a sign-up page — their latest sign-up."
          },
          "groupIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "doNotContact": {
            "type": "boolean",
            "description": "They unsubscribed or staff marked them: no bulk requests."
          },
          "emailStatus": {
            "type": "string",
            "enum": [
              "ok",
              "bounced",
              "complained"
            ]
          },
          "lastActivityAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "deleteOn": {
            "type": "string",
            "description": "YYYY-MM-DD: deleted automatically after 24 months without activity."
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "updatedAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "mobile",
          "dateOfBirth",
          "idNumber",
          "source",
          "sourceId",
          "signup",
          "groupIds",
          "doNotContact",
          "emailStatus",
          "lastActivityAt",
          "deleteOn",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "NewContact": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "maxLength": 320
          },
          "mobile": {
            "type": "string",
            "maxLength": 40
          },
          "dateOfBirth": {
            "description": "YYYY-MM-DD; an empty string clears it.",
            "type": "string",
            "maxLength": 10
          },
          "idNumber": {
            "description": "The organization’s client ID, checked by its rules (`invalid:idNumber`), one client per ID (`duplicate_idNumber`); an empty string clears it. `no_client_id` when the organization hasn’t set one.",
            "type": "string",
            "maxLength": 60
          },
          "groupIds": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "consent": {
            "type": "object",
            "properties": {
              "confirmed": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "confirmed"
            ],
            "additionalProperties": false,
            "description": "Required: you confirm the person agreed to be contacted by the organization. Recorded with your key and the admin who created it."
          }
        },
        "required": [
          "name",
          "consent"
        ],
        "additionalProperties": false
      },
      "BulkContacts": {
        "type": "object",
        "properties": {
          "contacts": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "email": {
                  "type": "string",
                  "maxLength": 320
                },
                "mobile": {
                  "type": "string",
                  "maxLength": 40
                },
                "dateOfBirth": {
                  "description": "YYYY-MM-DD; an empty string clears it.",
                  "type": "string",
                  "maxLength": 10
                },
                "idNumber": {
                  "description": "The organization’s client ID, checked by its rules (`invalid:idNumber`), one client per ID (`duplicate_idNumber`); an empty string clears it. `no_client_id` when the organization hasn’t set one.",
                  "type": "string",
                  "maxLength": 60
                },
                "groupIds": {
                  "maxItems": 20,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  }
                }
              },
              "required": [
                "name"
              ],
              "additionalProperties": false
            }
          },
          "consent": {
            "type": "object",
            "properties": {
              "confirmed": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "confirmed"
            ],
            "additionalProperties": false,
            "description": "Required: you confirm the person agreed to be contacted by the organization. Recorded with your key and the admin who created it."
          }
        },
        "required": [
          "contacts",
          "consent"
        ],
        "additionalProperties": false
      },
      "BulkContactsResult": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                "result": {
                  "type": "string",
                  "enum": [
                    "created",
                    "updated",
                    "skipped"
                  ]
                },
                "contactId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reason": {
                  "description": "Why it was skipped: invalid_email, invalid_phone, no_contact_method, contact_limit…",
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "index",
                "result",
                "contactId",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "created": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "updated": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "skipped": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "results",
          "created",
          "updated",
          "skipped"
        ],
        "additionalProperties": false
      },
      "ContactChanges": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "maxLength": 320
          },
          "mobile": {
            "type": "string",
            "maxLength": 40
          },
          "dateOfBirth": {
            "description": "YYYY-MM-DD; an empty string clears it.",
            "type": "string",
            "maxLength": 10
          },
          "idNumber": {
            "description": "The organization’s client ID, checked by its rules (`invalid:idNumber`), one client per ID (`duplicate_idNumber`); an empty string clears it. `no_client_id` when the organization hasn’t set one.",
            "type": "string",
            "maxLength": 60
          }
        },
        "additionalProperties": false
      },
      "Ok": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": false
      },
      "Groups": {
        "type": "object",
        "properties": {
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Group"
            }
          }
        },
        "required": [
          "groups"
        ],
        "additionalProperties": false
      },
      "Group": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "colour": {
            "type": "string",
            "enum": [
              "teal",
              "blue",
              "violet",
              "pink",
              "orange",
              "amber",
              "green",
              "grey"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "name",
          "colour",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "GroupInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "colour": {
            "type": "string",
            "enum": [
              "teal",
              "blue",
              "violet",
              "pink",
              "orange",
              "amber",
              "green",
              "grey"
            ]
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "GroupMembers": {
        "type": "object",
        "properties": {
          "add": {
            "default": [],
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "remove": {
            "default": [],
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "required": [
          "add",
          "remove"
        ],
        "additionalProperties": false
      },
      "MembersUpdated": {
        "type": "object",
        "properties": {
          "updated": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "updated"
        ],
        "additionalProperties": false
      },
      "NewSend": {
        "type": "object",
        "properties": {
          "groupIds": {
            "default": [],
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "everyone": {
            "default": false,
            "type": "boolean"
          },
          "note": {
            "type": "string",
            "maxLength": 1000
          },
          "questionnaireId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "filesRequired": {
            "type": "boolean"
          },
          "allowReply": {
            "type": "boolean"
          },
          "emailDesignId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "string",
                "const": "plain"
              }
            ]
          },
          "sendAt": {
            "description": "Send later (on a quarter hour, up to a year ahead). Absent: now.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "confirmation": {
            "type": "object",
            "properties": {
              "confirmed": {
                "type": "boolean",
                "const": true
              }
            },
            "required": [
              "confirmed"
            ],
            "additionalProperties": false,
            "description": "Required, as in the app: these people expect this request and the organization has permission to email them."
          }
        },
        "required": [
          "groupIds",
          "everyone",
          "confirmation"
        ],
        "additionalProperties": false
      },
      "SendStarted": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "started",
              "scheduled"
            ]
          },
          "send": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Send"
              },
              {
                "type": "null"
              }
            ],
            "description": "When started now."
          },
          "queued": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "skipped": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "People skipped: no email, don’t contact, bounced or reported before, sent too recently."
          },
          "scheduled": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "sendAt": {
                    "type": "string",
                    "description": "ISO 8601, UTC."
                  }
                },
                "required": [
                  "id",
                  "sendAt"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "When sent later."
          }
        },
        "required": [
          "status",
          "send",
          "queued",
          "skipped",
          "scheduled"
        ],
        "additionalProperties": false
      },
      "Send": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "importing",
              "queued",
              "sending",
              "paused",
              "finished",
              "cancelled"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "queued": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "People queued (sent ones included)."
          },
          "skipped": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "sent": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "bounced": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "complained": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "unsubscribed": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "People who unsubscribed with this send’s link."
          },
          "startedAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "ISO 8601, UTC."
              },
              {
                "type": "null"
              }
            ]
          },
          "nextWaveAt": {
            "anyOf": [
              {
                "type": "string",
                "description": "ISO 8601, UTC."
              },
              {
                "type": "null"
              }
            ],
            "description": "Sends go out in waves within sending hours, at the organization’s daily limit."
          },
          "finishEstimate": {
            "type": [
              "string",
              "null"
            ]
          },
          "pausedReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "bounces",
                  "complaint"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Paused by SealDrop’s safety stops; resuming needs acknowledged: true."
          }
        },
        "required": [
          "id",
          "status",
          "createdAt",
          "queued",
          "skipped",
          "sent",
          "bounced",
          "complained",
          "unsubscribed",
          "startedAt",
          "nextWaveAt",
          "finishEstimate",
          "pausedReason"
        ],
        "additionalProperties": false
      },
      "Sends": {
        "type": "object",
        "properties": {
          "sends": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Send"
            }
          }
        },
        "required": [
          "sends"
        ],
        "additionalProperties": false
      },
      "SendResults": {
        "type": "object",
        "properties": {
          "send": {
            "$ref": "#/components/schemas/Send"
          },
          "people": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "requestId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                },
                "status": {
                  "type": "string",
                  "description": "queued, sent, bounced, complained, unsubscribed, received, downloaded, filed, expired, cancelled"
                },
                "sentAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "ISO 8601, UTC."
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "requestId",
                "name",
                "email",
                "status",
                "sentAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "send",
          "people"
        ],
        "additionalProperties": false
      },
      "Resume": {
        "type": "object",
        "properties": {
          "acknowledged": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ScheduledSends": {
        "type": "object",
        "properties": {
          "scheduled": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "sendAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "ISO 8601, UTC."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "groupIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "everyone": {
                  "type": "boolean"
                },
                "note": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "sendAt",
                "groupIds",
                "everyone",
                "note"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "scheduled"
        ],
        "additionalProperties": false
      },
      "Questionnaire": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "questionCount": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "updatedAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "survey": {
            "description": "The questions, as SurveyJS JSON (the subset SealDrop allows)."
          }
        },
        "required": [
          "id",
          "name",
          "questionCount",
          "updatedAt",
          "survey"
        ],
        "additionalProperties": false
      },
      "QuestionnaireInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "survey": {}
        },
        "required": [
          "name",
          "survey"
        ],
        "additionalProperties": false
      },
      "OpenLinks": {
        "type": "object",
        "properties": {
          "openLinks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OpenLink"
            }
          }
        },
        "required": [
          "openLinks"
        ],
        "additionalProperties": false
      },
      "OpenLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "templateIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allTemplates": {
            "type": "boolean"
          },
          "mode": {
            "type": "string"
          },
          "filesAllowed": {
            "type": "boolean"
          },
          "filesRequired": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "perDay": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "expiresOn": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "today": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991,
            "description": "Submissions today."
          },
          "url": {
            "description": "Only right after it is made or replaced — SealDrop keeps only a hash.",
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          },
          "updatedAt": {
            "type": "string",
            "description": "ISO 8601, UTC."
          }
        },
        "required": [
          "id",
          "name",
          "templateIds",
          "allTemplates",
          "mode",
          "filesAllowed",
          "filesRequired",
          "note",
          "perDay",
          "expiresOn",
          "enabled",
          "today",
          "url",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    }
  },
  "paths": {
    "/v1/me": {
      "get": {
        "tags": [
          "Organization"
        ],
        "summary": "The organization and key making the call",
        "description": "Check that a key works, and read its organization, scopes and limits. Any valid key can call it.",
        "operationId": "getMe",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                },
                "example": {
                  "organization": {
                    "id": "3f8a2c1e-5b7d-4e9f-a1c3-0d2b4f6e8a10",
                    "name": "Ledger & Co.",
                    "timeZone": "America/Toronto"
                  },
                  "key": {
                    "id": "9c1d7e3a-2f4b-4a6c-8e0d-1b3f5a7c9e21",
                    "name": "Tax software integration",
                    "mode": "test",
                    "scopes": [
                      "requests:read",
                      "files:read",
                      "answers:read",
                      "audit:read"
                    ],
                    "expiresAt": "2027-10-22T17:00:00.000Z"
                  },
                  "limits": {
                    "perMinute": 60,
                    "perDay": 5000
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests": {
      "get": {
        "tags": [
          "Requests"
        ],
        "summary": "List requests",
        "description": "Newest first, 50 a page (up to 200). Filter by `status`, by when they were submitted or created. To follow changes as they happen, use the events feed (`GET /v1/events`) instead of listing again and again.",
        "operationId": "getRequests",
        "x-scope": "requests:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Only requests in this status.",
            "schema": {
              "type": "string",
              "enum": [
                "sent",
                "received",
                "downloaded",
                "filed",
                "expired",
                "cancelled"
              ]
            }
          },
          {
            "name": "submittedAfter",
            "in": "query",
            "required": false,
            "description": "Only requests submitted after this time (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          {
            "name": "createdAfter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "1–200, default 50.",
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "`nextCursor` from the previous page.",
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestPage"
                },
                "example": {
                  "requests": [
                    {
                      "id": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                      "reference": "SD-5D0B8C2A-7E1F",
                      "status": "received",
                      "test": false,
                      "person": {
                        "name": "Amara Okafor",
                        "email": "amara.okafor@example.com",
                        "mobile": "+16045550100"
                      },
                      "source": "app",
                      "openLinkId": null,
                      "channels": [
                        "email"
                      ],
                      "note": "Please upload your 2025 tax slips.",
                      "message": "My second T4 is still coming.",
                      "questionnaire": {
                        "name": "Personal tax return checklist"
                      },
                      "filesRequired": true,
                      "fileCount": 2,
                      "blockedFiles": 0,
                      "createdAt": "2026-10-21T16:20:00.000Z",
                      "submittedAt": "2026-10-23T17:42:10.000Z",
                      "linkExpiresAt": "2026-10-28T16:20:00.000Z",
                      "deleteAt": "2026-11-22T17:42:10.000Z",
                      "filesDeletedAt": null,
                      "importedAt": null
                    }
                  ],
                  "nextCursor": "eyJpZCI6Ij…"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Requests"
        ],
        "summary": "Send a request",
        "description": "Sends the secure link by email and/or text, exactly as the app's New request: the organization's wording and branding, its link lifetime, daily limits and plan rules. Needs an `Idempotency-Key` header (any id of your own, e.g. your record's): a retry with the same key and body within 24 hours returns the first answer instead of sending again. With a test key, the email goes only to the admin who created the key and no text is sent.",
        "operationId": "postRequests",
        "x-scope": "requests:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "Any id of yours, up to 200 printable characters. Same key and body within 24 hours → the first answer again; same key, different body → 409 idempotency_mismatch.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sent"
                },
                "example": {
                  "request": {
                    "id": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                    "reference": "SD-5D0B8C2A-7E1F",
                    "status": "sent",
                    "test": false,
                    "person": {
                      "name": "Amara Okafor",
                      "email": "amara.okafor@example.com",
                      "mobile": "+16045550100"
                    },
                    "source": "app",
                    "openLinkId": null,
                    "channels": [
                      "email"
                    ],
                    "note": "Please upload your 2025 tax slips.",
                    "message": null,
                    "questionnaire": {
                      "name": "Personal tax return checklist"
                    },
                    "filesRequired": true,
                    "fileCount": 0,
                    "blockedFiles": 0,
                    "createdAt": "2026-10-21T16:20:00.000Z",
                    "submittedAt": null,
                    "linkExpiresAt": "2026-10-28T16:20:00.000Z",
                    "deleteAt": null,
                    "filesDeletedAt": null,
                    "importedAt": null
                  },
                  "delivery": {
                    "email": "sent"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{id}": {
      "get": {
        "tags": [
          "Requests"
        ],
        "summary": "One request, with its files",
        "description": "Everything the staff app's request page shows: who it went to, the note, the person's reply, the questionnaire, its files and their malware-scan status, and when it will be deleted. Reading it doesn't mark it as seen for staff.",
        "operationId": "getRequestsId",
        "x-scope": "requests:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestDetail"
                },
                "example": {
                  "id": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                  "reference": "SD-5D0B8C2A-7E1F",
                  "status": "received",
                  "test": false,
                  "person": {
                    "name": "Amara Okafor",
                    "email": "amara.okafor@example.com",
                    "mobile": "+16045550100"
                  },
                  "source": "app",
                  "openLinkId": null,
                  "channels": [
                    "email"
                  ],
                  "note": "Please upload your 2025 tax slips.",
                  "message": "My second T4 is still coming.",
                  "questionnaire": {
                    "name": "Personal tax return checklist"
                  },
                  "filesRequired": true,
                  "fileCount": 2,
                  "blockedFiles": 0,
                  "createdAt": "2026-10-21T16:20:00.000Z",
                  "submittedAt": "2026-10-23T17:42:10.000Z",
                  "linkExpiresAt": "2026-10-28T16:20:00.000Z",
                  "deleteAt": "2026-11-22T17:42:10.000Z",
                  "filesDeletedAt": null,
                  "importedAt": null,
                  "files": [
                    {
                      "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
                      "name": "Amara Okafor - T4 2025 (SD-5D0B8C2A-7E1F).pdf",
                      "contentType": "application/pdf",
                      "size": 184220,
                      "kind": "upload",
                      "scan": "clean",
                      "deleted": false,
                      "uploadedAt": "2026-10-23T17:41:02.000Z",
                      "downloadedAt": null
                    },
                    {
                      "id": "7b2e9f10-3c4d-4e5f-8a9b-0c1d2e3f4a5b",
                      "name": "Amara Okafor - Personal tax return checklist (SD-5D0B8C2A-7E1F).pdf",
                      "contentType": "application/pdf",
                      "size": 52310,
                      "kind": "answers",
                      "scan": "clean",
                      "deleted": false,
                      "uploadedAt": "2026-10-23T17:42:10.000Z",
                      "downloadedAt": null
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/files/{id}/download": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "A download link for one file",
        "description": "A link to the malware-scanned copy, valid 5 minutes — GET it without an Authorization header. `409 still_scanning` means try again shortly; `409 blocked`, the scan deleted it; `410`, it is already deleted. The first download of a request starts its deletion clock, exactly as when staff download.",
        "operationId": "getFilesIdDownload",
        "x-scope": "files:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Download"
                },
                "example": {
                  "url": "https://…s3.ca-central-1.amazonaws.com/…?X-Amz-Expires=300&…",
                  "expiresAt": "2026-10-23T18:05:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{id}/answers": {
      "get": {
        "tags": [
          "Documents"
        ],
        "summary": "The questionnaire answers, as data",
        "description": "Each question with its stable name, its title and the answer — to fill your own fields. The same answers are in the answers PDF among the files. `404` when the request had no questionnaire; `410` once its files were deleted.",
        "operationId": "getRequestsIdAnswers",
        "x-scope": "answers:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Answers"
                },
                "example": {
                  "questionnaire": {
                    "name": "Personal tax return checklist"
                  },
                  "submittedAt": "2026-10-23T17:42:10.000Z",
                  "answers": [
                    {
                      "name": "dateOfBirth",
                      "title": "Date of birth",
                      "type": "text",
                      "value": "1984-03-09"
                    },
                    {
                      "name": "q1",
                      "title": "Which tax year is this for?",
                      "type": "dropdown",
                      "value": "2025"
                    },
                    {
                      "name": "q2",
                      "title": "Income you had this year",
                      "type": "checkbox",
                      "value": [
                        "Employment (T4)",
                        "RRSP or RRIF withdrawals"
                      ]
                    },
                    {
                      "name": "q3",
                      "title": "Did your marital status or address change?",
                      "type": "boolean",
                      "value": false
                    }
                  ],
                  "pdfFileId": "7b2e9f10-3c4d-4e5f-8a9b-0c1d2e3f4a5b",
                  "scores": [],
                  "calculations": [
                    {
                      "name": "Age",
                      "value": 42
                    }
                  ],
                  "flags": []
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{id}/imported": {
      "post": {
        "tags": [
          "Documents"
        ],
        "summary": "Confirm your system has the documents",
        "description": "Call it once your system has stored every file (and the answers): SealDrop then deletes its copy right away, as when staff mark a request Filed — so the person's documents live in one place, your system. If the organization chose to have staff look first, the request is marked imported and deleted on its usual schedule. `409 not_downloaded` until every clean file has been downloaded at least once; `409 still_scanning` while a file is being scanned. Calling it again is safe.",
        "operationId": "postRequestsIdImported",
        "x-scope": "files:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Imported"
                },
                "example": {
                  "action": "deleted",
                  "request": {
                    "id": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                    "reference": "SD-5D0B8C2A-7E1F",
                    "status": "filed",
                    "test": false,
                    "person": {
                      "name": "Amara Okafor",
                      "email": "amara.okafor@example.com",
                      "mobile": "+16045550100"
                    },
                    "source": "app",
                    "openLinkId": null,
                    "channels": [
                      "email"
                    ],
                    "note": "Please upload your 2025 tax slips.",
                    "message": "My second T4 is still coming.",
                    "questionnaire": {
                      "name": "Personal tax return checklist"
                    },
                    "filesRequired": true,
                    "fileCount": 2,
                    "blockedFiles": 0,
                    "createdAt": "2026-10-21T16:20:00.000Z",
                    "submittedAt": "2026-10-23T17:42:10.000Z",
                    "linkExpiresAt": "2026-10-28T16:20:00.000Z",
                    "deleteAt": "2026-10-23T18:01:12.000Z",
                    "filesDeletedAt": null,
                    "importedAt": "2026-10-23T18:01:12.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/audit": {
      "get": {
        "tags": [
          "Audit"
        ],
        "summary": "The organization's audit log",
        "description": "Who did what and when — staff, API keys, the people who uploaded, SealDrop itself — with ids, never names of clients, file names or answers. 200 a page, newest first.",
        "operationId": "getAudit",
        "x-scope": "audit:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "description": "Start (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "description": "End (ISO 8601), at most 366 days after from.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          },
          {
            "name": "requestId",
            "in": "query",
            "required": false,
            "description": "Only this request’s events.",
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditPage"
                },
                "example": {
                  "events": [
                    {
                      "at": "2026-10-23T18:00:41.000Z",
                      "action": "file.downloaded",
                      "actor": "apikey:9c1d7e3a-2f4b-4a6c-8e0d-1b3f5a7c9e21",
                      "actorName": "API key “Tax software integration”",
                      "ip": "203.0.113.7",
                      "requestId": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                      "fileId": "7b2e9f10-3c4d-4e5f-8a9b-0c1d2e3f4a5b"
                    }
                  ],
                  "nextCursor": null
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events": {
      "get": {
        "tags": [
          "Events"
        ],
        "summary": "What happened, in order",
        "description": "A feed of changes — ids and types only, nothing about the person — kept 30 days. Poll it (every minute is plenty), remember `nextCursor`, and fetch whatever changed. For systems that can't receive webhooks; webhooks will send the same events.",
        "operationId": "getEvents",
        "x-scope": "requests:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "after",
            "in": "query",
            "required": false,
            "description": "`nextCursor` from your last call. Without it: every event of the last 30 days, oldest first.",
            "schema": {
              "type": "string",
              "maxLength": 500
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "default": 100,
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventPage"
                },
                "example": {
                  "events": [
                    {
                      "id": "evt_0c7f5e2a-1b3d-4f6a-8c9e-2d4f6a8b0c1e",
                      "type": "request.received",
                      "at": "2026-10-23T17:42:10.000Z",
                      "requestId": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                      "fileId": null
                    }
                  ],
                  "nextCursor": "MjAyNi0xMC0yM1Qx…"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{id}/resend": {
      "post": {
        "tags": [
          "Requests"
        ],
        "summary": "Send the link again",
        "description": "A new link replaces the old one (which stops working), sent the same way. Allowed while the request is sent or expired.",
        "operationId": "postRequestsIdResend",
        "x-scope": "requests:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sent"
                },
                "example": {
                  "request": {
                    "id": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                    "reference": "SD-5D0B8C2A-7E1F",
                    "status": "sent",
                    "test": false,
                    "person": {
                      "name": "Amara Okafor",
                      "email": "amara.okafor@example.com",
                      "mobile": "+16045550100"
                    },
                    "source": "app",
                    "openLinkId": null,
                    "channels": [
                      "email"
                    ],
                    "note": "Please upload your 2025 tax slips.",
                    "message": null,
                    "questionnaire": {
                      "name": "Personal tax return checklist"
                    },
                    "filesRequired": true,
                    "fileCount": 0,
                    "blockedFiles": 0,
                    "createdAt": "2026-10-21T16:20:00.000Z",
                    "submittedAt": null,
                    "linkExpiresAt": "2026-10-28T16:20:00.000Z",
                    "deleteAt": null,
                    "filesDeletedAt": null,
                    "importedAt": null
                  },
                  "delivery": {
                    "email": "sent"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{id}/cancel": {
      "post": {
        "tags": [
          "Requests"
        ],
        "summary": "Cancel a request",
        "description": "The link stops working and anything uploaded is deleted right away.",
        "operationId": "postRequestsIdCancel",
        "x-scope": "requests:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestResult"
                },
                "example": {
                  "request": {
                    "id": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                    "reference": "SD-5D0B8C2A-7E1F",
                    "status": "cancelled",
                    "test": false,
                    "person": {
                      "name": "Amara Okafor",
                      "email": "amara.okafor@example.com",
                      "mobile": "+16045550100"
                    },
                    "source": "app",
                    "openLinkId": null,
                    "channels": [
                      "email"
                    ],
                    "note": "Please upload your 2025 tax slips.",
                    "message": "My second T4 is still coming.",
                    "questionnaire": {
                      "name": "Personal tax return checklist"
                    },
                    "filesRequired": true,
                    "fileCount": 2,
                    "blockedFiles": 0,
                    "createdAt": "2026-10-21T16:20:00.000Z",
                    "submittedAt": "2026-10-23T17:42:10.000Z",
                    "linkExpiresAt": "2026-10-28T16:20:00.000Z",
                    "deleteAt": "2026-11-22T17:42:10.000Z",
                    "filesDeletedAt": null,
                    "importedAt": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/requests/{id}/filed": {
      "post": {
        "tags": [
          "Requests"
        ],
        "summary": "Mark a request filed",
        "description": "As Filed in the app: its files are deleted right away. After downloading, prefer `POST /v1/requests/{id}/imported`, which also checks every file was fetched.",
        "operationId": "postRequestsIdFiled",
        "x-scope": "requests:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestResult"
                },
                "example": {
                  "request": {
                    "id": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                    "reference": "SD-5D0B8C2A-7E1F",
                    "status": "filed",
                    "test": false,
                    "person": {
                      "name": "Amara Okafor",
                      "email": "amara.okafor@example.com",
                      "mobile": "+16045550100"
                    },
                    "source": "app",
                    "openLinkId": null,
                    "channels": [
                      "email"
                    ],
                    "note": "Please upload your 2025 tax slips.",
                    "message": "My second T4 is still coming.",
                    "questionnaire": {
                      "name": "Personal tax return checklist"
                    },
                    "filesRequired": true,
                    "fileCount": 2,
                    "blockedFiles": 0,
                    "createdAt": "2026-10-21T16:20:00.000Z",
                    "submittedAt": "2026-10-23T17:42:10.000Z",
                    "linkExpiresAt": "2026-10-28T16:20:00.000Z",
                    "deleteAt": "2026-11-22T17:42:10.000Z",
                    "filesDeletedAt": null,
                    "importedAt": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/questionnaires": {
      "get": {
        "tags": [
          "Forms"
        ],
        "summary": "The organization's questionnaires",
        "description": "Ids and names, to choose one when sending a request.",
        "operationId": "getQuestionnaires",
        "x-scope": "forms:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Questionnaires"
                },
                "example": {
                  "questionnaires": [
                    {
                      "id": "2c4e6a8b-0d1f-4a3b-8c5d-7e9f1a2b3c4d",
                      "name": "Personal tax return checklist",
                      "questionCount": 12
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Forms"
        ],
        "summary": "Make a questionnaire",
        "description": "A name and its questions (SurveyJS JSON; anything outside SealDrop’s allowed subset is refused).",
        "operationId": "postQuestionnaires",
        "x-scope": "forms:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionnaireInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Questionnaire"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/email-designs": {
      "get": {
        "tags": [
          "Forms"
        ],
        "summary": "The organization's email designs",
        "description": "Ids and names of the designed emails; one may be the default.",
        "operationId": "getEmail-designs",
        "x-scope": "forms:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailDesigns"
                },
                "example": {
                  "designs": [
                    {
                      "id": "8e1f3a5c-7b9d-4e2f-a6c8-0b2d4f6a8c1e",
                      "name": "Tax season",
                      "isDefault": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/test/requests/{id}/simulate-upload": {
      "post": {
        "tags": [
          "Test mode"
        ],
        "summary": "Play the person's part (test keys only)",
        "description": "For a request made with a test key: SealDrop uploads its own sample PDF and photo, fills the questionnaire with sample answers, and submits — through the real malware scan, so the files become downloadable a minute or two later, exactly as a real upload would. Live keys get 403.",
        "operationId": "postTestRequestsIdSimulate-upload",
        "x-scope": "requests:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestResult"
                },
                "example": {
                  "request": {
                    "id": "5d0b8c2a-7e1f-4a3b-9c4d-2e6f8a0b1c3d",
                    "reference": "SD-5D0B8C2A-7E1F",
                    "status": "received",
                    "test": true,
                    "person": {
                      "name": "Test Person",
                      "email": "test@example.com",
                      "mobile": null
                    },
                    "source": "app",
                    "openLinkId": null,
                    "channels": [
                      "email"
                    ],
                    "note": "Please upload your 2025 tax slips.",
                    "message": "My second T4 is still coming.",
                    "questionnaire": {
                      "name": "Personal tax return checklist"
                    },
                    "filesRequired": true,
                    "fileCount": 2,
                    "blockedFiles": 0,
                    "createdAt": "2026-10-21T16:20:00.000Z",
                    "submittedAt": "2026-10-23T17:42:10.000Z",
                    "linkExpiresAt": "2026-10-28T16:20:00.000Z",
                    "deleteAt": "2026-11-22T17:42:10.000Z",
                    "filesDeletedAt": null,
                    "importedAt": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "List contacts",
        "description": "2,500 a page. With `updatedSince` (from the last page’s `asOf`), only what changed — and the ids deleted since — so your system can stay in step cheaply.",
        "operationId": "getContacts",
        "x-scope": "contacts:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 2000
            }
          },
          {
            "name": "updatedSince",
            "in": "query",
            "required": false,
            "description": "Only contacts changed (or deleted) since this time.",
            "schema": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPage"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Add a contact",
        "description": "One contact per email, per mobile and per client ID in the organization: one already used → `409 duplicate_email` (or `duplicate_phone`, `duplicate_idNumber`) with the existing `contactId`. Needs `consent.confirmed`.",
        "operationId": "postContacts",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewContact"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/{id}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "One contact",
        "description": "Name, email, mobile, groups, whether they may be contacted, and when they’d be deleted for inactivity.",
        "operationId": "getContactsId",
        "x-scope": "contacts:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Contacts"
        ],
        "summary": "Change a contact",
        "description": "Name, email or mobile.",
        "operationId": "putContactsId",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactChanges"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "description": "Gone for good; their requests keep their own deletion schedule.",
        "operationId": "deleteContactsId",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/bulk": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Add or update up to 500 contacts",
        "description": "For each row: a new person is created, one whose email or mobile is already in Contacts is updated (name, and added to the groups), anything invalid is skipped with the reason. One result per row, in order.",
        "operationId": "postContactsBulk",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkContacts"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkContactsResult"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/contacts/{id}/do-not-contact": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Mark “don’t contact”",
        "description": "No bulk requests from then on. Lifting it is for an admin, in the app.",
        "operationId": "postContactsIdDo-not-contact",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/groups": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "List groups",
        "description": "Ids, names and colours.",
        "operationId": "getGroups",
        "x-scope": "contacts:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Groups"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Make a group",
        "description": "A name and an optional colour.",
        "operationId": "postGroups",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupInput"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/groups/{id}": {
      "put": {
        "tags": [
          "Contacts"
        ],
        "summary": "Rename a group",
        "description": "A new name or colour.",
        "operationId": "putGroupsId",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Group"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a group",
        "description": "Its contacts stay; they just leave the group.",
        "operationId": "deleteGroupsId",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/groups/{id}/members": {
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Add or remove members",
        "description": "Contact ids to add to and remove from the group, up to 500 each.",
        "operationId": "postGroupsIdMembers",
        "x-scope": "contacts:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GroupMembers"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MembersUpdated"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sends": {
      "post": {
        "tags": [
          "Group sends"
        ],
        "summary": "Send to groups or everyone",
        "description": "The app's Group or everyone: one request each, in waves within sending hours, with the organization's daily and monthly limits, the bounce and complaint safety stops, and unsubscribe. People with no email, marked don't contact, bounced or reported before, or sent one recently are skipped. Needs group sending on the plan and the bulk-sending terms accepted by an admin in the app. `sendAt` sends later. Test keys can't send to groups.",
        "operationId": "postSends",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewSend"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendStarted"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Group sends"
        ],
        "summary": "Group sends so far",
        "description": "Newest first, with their counts.",
        "operationId": "getSends",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Sends"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sends/{id}": {
      "get": {
        "tags": [
          "Group sends"
        ],
        "summary": "One group send",
        "description": "Its status and counts.",
        "operationId": "getSendsId",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Send"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sends/{id}/results": {
      "get": {
        "tags": [
          "Group sends"
        ],
        "summary": "Who it went to, and what happened",
        "description": "Per person: their request, whether it was sent, bounced, reported or answered.",
        "operationId": "getSendsIdResults",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendResults"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sends/{id}/pause": {
      "post": {
        "tags": [
          "Group sends"
        ],
        "summary": "Pause a group send",
        "description": "No more waves until it is resumed.",
        "operationId": "postSendsIdPause",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Send"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sends/{id}/resume": {
      "post": {
        "tags": [
          "Group sends"
        ],
        "summary": "Resume a group send",
        "description": "After a safety stop (`pausedReason`), pass `acknowledged: true`.",
        "operationId": "postSendsIdResume",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Resume"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Send"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sends/{id}/cancel": {
      "post": {
        "tags": [
          "Group sends"
        ],
        "summary": "Cancel a group send",
        "description": "People not sent yet are dropped; those already sent keep their links.",
        "operationId": "postSendsIdCancel",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Send"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/scheduled": {
      "get": {
        "tags": [
          "Group sends"
        ],
        "summary": "Scheduled sends",
        "description": "Sends waiting for their time (made here or in the app).",
        "operationId": "getScheduled",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledSends"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/scheduled/{id}": {
      "delete": {
        "tags": [
          "Group sends"
        ],
        "summary": "Cancel a scheduled send",
        "description": "It will not go out.",
        "operationId": "deleteScheduledId",
        "x-scope": "sends:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/questionnaires/{id}": {
      "get": {
        "tags": [
          "Forms"
        ],
        "summary": "One questionnaire, with its questions",
        "description": "SurveyJS JSON, the subset SealDrop allows (text, comment, choices, dropdown, yes/no, date, signature).",
        "operationId": "getQuestionnairesId",
        "x-scope": "forms:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Questionnaire"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "Forms"
        ],
        "summary": "Change a questionnaire",
        "description": "Requests already sent keep the copy they were sent with.",
        "operationId": "putQuestionnairesId",
        "x-scope": "forms:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionnaireInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Questionnaire"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Forms"
        ],
        "summary": "Delete a questionnaire",
        "description": "Requests already sent keep their copy.",
        "operationId": "deleteQuestionnairesId",
        "x-scope": "forms:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/open-links": {
      "get": {
        "tags": [
          "Forms"
        ],
        "summary": "Open links",
        "description": "One link anyone can open to fill questionnaires and upload documents. The address is shown only when made or replaced.",
        "operationId": "getOpen-links",
        "x-scope": "forms:read",
        "security": [
          {
            "bearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenLinks"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Forms"
        ],
        "summary": "Make an open link",
        "description": "Within the plan’s limit. The answer holds its address (`url`) once.",
        "operationId": "postOpen-links",
        "x-scope": "forms:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "templateIds": {
                    "default": [],
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "allTemplates": {
                    "default": false,
                    "type": "boolean"
                  },
                  "mode": {
                    "default": "all",
                    "type": "string",
                    "enum": [
                      "all",
                      "choose"
                    ]
                  },
                  "filesAllowed": {
                    "default": true,
                    "type": "boolean"
                  },
                  "filesRequired": {
                    "default": false,
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "perDay": {
                    "default": 50,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000
                  },
                  "expiresOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "enabled": {
                    "default": true,
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "templateIds",
                  "allTemplates",
                  "mode",
                  "filesAllowed",
                  "filesRequired",
                  "perDay",
                  "enabled"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenLink"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/open-links/{id}": {
      "put": {
        "tags": [
          "Forms"
        ],
        "summary": "Change an open link",
        "description": "Its questionnaires, documents, note, daily limit, last day, or turn it off (`enabled: false`).",
        "operationId": "putOpen-linksId",
        "x-scope": "forms:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "templateIds": {
                    "default": [],
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "allTemplates": {
                    "default": false,
                    "type": "boolean"
                  },
                  "mode": {
                    "default": "all",
                    "type": "string",
                    "enum": [
                      "all",
                      "choose"
                    ]
                  },
                  "filesAllowed": {
                    "default": true,
                    "type": "boolean"
                  },
                  "filesRequired": {
                    "default": false,
                    "type": "boolean"
                  },
                  "note": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "perDay": {
                    "default": 50,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000
                  },
                  "expiresOn": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "enabled": {
                    "default": true,
                    "type": "boolean"
                  }
                },
                "required": [
                  "name",
                  "templateIds",
                  "allTemplates",
                  "mode",
                  "filesAllowed",
                  "filesRequired",
                  "perDay",
                  "enabled"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenLink"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Forms"
        ],
        "summary": "Delete an open link",
        "description": "Its address stops working.",
        "operationId": "deleteOpen-linksId",
        "x-scope": "forms:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/open-links/{id}/rotate": {
      "post": {
        "tags": [
          "Forms"
        ],
        "summary": "Replace an open link’s address",
        "description": "The old address stops working; the new one is in the answer once.",
        "operationId": "postOpen-linksIdRotate",
        "x-scope": "forms:write",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenLink"
                }
              }
            }
          },
          "400": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
