{
  "openapi": "3.1.1",
  "info": {
    "title": "sign.fritss.at | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://sign.fritss.at/"
    }
  ],
  "paths": {
    "/v1/batches": {
      "post": {
        "tags": [
          "Batches"
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "allOf": [
                  {
                    "type": "object",
                    "properties": {
                      "files": {
                        "$ref": "#/components/schemas/IFormFileCollection"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "returnUrl": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "webhookUrl": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "profile": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "signaturePosition": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "properties": {
                      "reference": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBatchResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/batches/{batchId}": {
      "get": {
        "tags": [
          "Batches"
        ],
        "parameters": [
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/BatchStatusResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchStatusResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/BatchStatusResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/documents/{id}/content": {
      "get": {
        "tags": [
          "Documents"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/ping": {
      "get": {
        "tags": [
          "Ping"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BatchStatusResponse": {
        "required": [
          "batchId",
          "status",
          "reference",
          "documents"
        ],
        "type": "object",
        "properties": {
          "batchId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "reference": {
            "type": [
              "null",
              "string"
            ]
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentDetail"
            }
          }
        }
      },
      "CreateBatchResponse": {
        "required": [
          "batchId",
          "status",
          "signUrl",
          "signingExpiresAt",
          "documents"
        ],
        "type": "object",
        "properties": {
          "batchId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string"
          },
          "signUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "signingExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "documents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DocumentSummary"
            }
          }
        }
      },
      "DocumentDetail": {
        "required": [
          "id",
          "originalFileName",
          "status",
          "retrievableUntil"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "originalFileName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "retrievableUntil": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "DocumentSummary": {
        "required": [
          "id",
          "originalFileName",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "originalFileName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "IFormFile": {
        "type": "string",
        "format": "binary"
      },
      "IFormFileCollection": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/IFormFile"
        }
      }
    }
  },
  "tags": [
    {
      "name": "Batches"
    },
    {
      "name": "Documents"
    },
    {
      "name": "Ping"
    }
  ]
}