{
  "openapi": "3.0.1",
  "info": {
    "title": "LinkSquares API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.linksquares.com/api"
    }
  ],
  "paths": {
    "/finalize/v2/agreements/{agreement_id}/answers/{answer_id}/attachments/{attachment_id}/file": {
      "get": {
        "summary": "Download Answers Attachment",
        "tags": ["Finalize Attachments"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement UUID"
          },
          {
            "name": "answer_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The answer UUID"
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The attachment UUID"
          }
        ],
        "responses": {
          "302": {
            "description": "success",
            "headers": {
              "location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                },
                "description": "Presigned download URL for the attachment file."
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}/questions/{question_id}/attachments/{attachment_id}/file": {
      "get": {
        "summary": "Download Question Attachment",
        "tags": ["Finalize Attachments"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement UUID"
          },
          {
            "name": "question_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The question UUID"
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The attachment UUID"
          }
        ],
        "responses": {
          "302": {
            "description": "success",
            "headers": {
              "location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                },
                "description": "Presigned download URL for the attachment file."
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}/agreement_versions": {
      "post": {
        "summary": "Create Agreement Version",
        "tags": ["Finalize Agreement Versions"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement UUID."
          }
        ],
        "responses": {
          "201": {
            "description": "created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement version.",
                          "example": "37c5e7c4-f675-11ed-b67e-0242ac120002"
                        }
                      }
                    },
                    "_links": {
                      "type": "object",
                      "description": "Links to finish agreement version creation.",
                      "properties": {
                        "agreement_version_file_upload": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "Presigned upload URL for the agreement version file.",
                              "example": "https://s3.amazonaws.com/linksquares-finalize-bucket/store/agreement_version/d0441f5b-3f7a-43de-84ef-37758b9929dd/file/ffd9b8871fb6250a4a98a53011e17527/basic_agreement.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<Amz-Credential-Value>&X-Amz-Date=20230402T134848Z&X-Amz-Expires=900&X-Amz-Security-Token=<Amz-Security-Token-Value>&X-Amz-SignedHeaders=host&X-Amz-Signature=<Amz-Signature-Value>"
                            },
                            "operation": {
                              "type": "string",
                              "description": "The HTTP verb. PUT only.",
                              "example": "put"
                            },
                            "file": {
                              "type": "string",
                              "description": "File name with extension.",
                              "example": "basic_agreement.docx"
                            }
                          },
                          "required": ["href", "operation", "file"]
                        },
                        "agreement_version_upload_complete": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "Endpoint to complete agreement version creation.",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements/eb05deb4-05c5-45d0-ae74-9ec2f3e2ad86/agreement_versions/37c5e7c4-f675-11ed-b67e-0242ac120002"
                            },
                            "operation": {
                              "type": "string",
                              "description": "The HTTP verb. PATCH only.",
                              "example": "patch"
                            },
                            "body": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "upload_complete": {
                                      "type": "boolean",
                                      "description": "Patch this field as `true` after the agreement version file has been uploaded.",
                                      "example": "true"
                                    }
                                  },
                                  "required": ["upload_complete"]
                                }
                              },
                              "required": ["data"]
                            }
                          },
                          "required": ["href", "operation", "body"]
                        }
                      },
                      "required": [
                        "agreement_version_file_upload",
                        "agreement_version_upload_complete"
                      ]
                    }
                  },
                  "required": ["_links", "data"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "status_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The status UUID."
                      },
                      "agreement_version_file": {
                        "type": "object",
                        "description": "Information about the agreement version file to be uploaded.",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "File name with extension. File must be type docx, pdf, or xlsx.",
                            "example": "LinkSquares_NDA.docx"
                          }
                        },
                        "required": ["name"]
                      }
                    },
                    "required": ["status_id", "agreement_version_file"]
                  }
                },
                "required": ["data"]
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "List Agreement Versions",
        "tags": ["Finalize Agreement Versions"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the agreement record."
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement version."
                          },
                          "file_name": {
                            "type": "string",
                            "description": "The name of the agreement version file.",
                            "example": "LinkSquares_NDA.docx"
                          },
                          "status_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement version's current status."
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO 8601 datetime of when the agreement version was created."
                          },
                          "deleted_at": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "description": "The ISO 8601 datetime of when the agreement version was deleted. Expected to be null if not deleted."
                          }
                        },
                        "required": [
                          "id",
                          "file_name",
                          "status_id",
                          "created_at",
                          "deleted_at"
                        ]
                      }
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of items returned",
                      "example": 1
                    },
                    "_links": {
                      "type": "object",
                      "properties": {
                        "next": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the next page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements/894e86b8-2866-494e-bb16-5aa19fce3348/agreement_versions?page=3&per_page=1"
                            }
                          }
                        },
                        "prev": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the previous page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements/894e86b8-2866-494e-bb16-5aa19fce3348/agreement_versions?page=1&per_page=1"
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": ["total_count", "_links", "data"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}/agreement_versions/{agreement_version_id}/file": {
      "get": {
        "summary": "Download Agreement Version",
        "tags": ["Finalize Agreement Versions"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement ID."
          },
          {
            "name": "agreement_version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement version ID."
          }
        ],
        "responses": {
          "302": {
            "description": "success",
            "headers": {
              "location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                },
                "description": "Presigned download URL for the agreement version file."
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}/agreement_versions/{agreement_version_id}": {
      "get": {
        "summary": "Get Agreement Version",
        "tags": ["Finalize Agreement Versions"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the agreement."
          },
          {
            "name": "agreement_version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the agreement version."
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement version."
                        },
                        "file_name": {
                          "type": "string",
                          "description": "The name of the agreement version file.",
                          "example": "LinkSquares_NDA.docx"
                        },
                        "status_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement version's current status."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the agreement version was created."
                        },
                        "deleted_at": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true,
                          "description": "The ISO 8601 datetime of when the agreement version was deleted. Expected to be null if not deleted."
                        }
                      },
                      "required": [
                        "id",
                        "file_name",
                        "status_id",
                        "created_at",
                        "deleted_at"
                      ]
                    }
                  },
                  "required": ["data"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Complete Version Upload",
        "tags": ["Finalize Agreement Versions"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement UUID."
          },
          {
            "name": "agreement_version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement version UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement version."
                        },
                        "file_name": {
                          "type": "string",
                          "description": "The name of the agreement version file.",
                          "example": "LinkSquares_NDA.docx"
                        },
                        "status_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement version's current status."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the agreement version was created."
                        },
                        "deleted_at": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true,
                          "description": "The ISO 8601 datetime of when the agreement version was deleted. Expected to be null if not deleted."
                        }
                      },
                      "required": [
                        "id",
                        "file_name",
                        "status_id",
                        "created_at",
                        "deleted_at"
                      ]
                    }
                  },
                  "required": ["data"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "upload_complete": {
                        "type": "boolean",
                        "description": "For agreement version creation, patch this field as `true` after the agreement version file has been uploaded."
                      }
                    },
                    "required": ["upload_complete"]
                  }
                },
                "required": ["data"]
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}/attachments": {
      "post": {
        "summary": "Create Attachment",
        "tags": ["Finalize Attachments"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement UUID."
          }
        ],
        "responses": {
          "201": {
            "description": "created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the attachment record."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the attachment was created.",
                          "readOnly": true
                        },
                        "file_name": {
                          "type": "string",
                          "description": "The name of the attachment file. Expected to be null if file has not been uploaded yet.",
                          "example": "ImportantSpreadsheet.xlsx",
                          "nullable": true
                        }
                      },
                      "required": ["id", "created_at", "file_name"]
                    },
                    "_links": {
                      "type": "object",
                      "description": "For attachment creation.",
                      "properties": {
                        "attachment_file_upload": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "Presigned upload URL for the attachment file.",
                              "example": "https://s3.amazonaws.com/linksquares-finalize-bucket/store/attachment/d0441f5b-3f7a-43de-84ef-37758b9929dd/file/ffd9b8871fb6250a4a98a53011e17527/basic_agreement.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<Amz-Credential-Value>&X-Amz-Date=20230402T134848Z&X-Amz-Expires=900&X-Amz-Security-Token=<Amz-Security-Token-Value>&X-Amz-SignedHeaders=host&X-Amz-Signature=<Amz-Signature-Value>"
                            },
                            "operation": {
                              "type": "string",
                              "description": "The HTTP verb. PUT only.",
                              "example": "put"
                            },
                            "file": {
                              "type": "string",
                              "description": "File name with extension.",
                              "example": "basic_attachment.docx"
                            }
                          },
                          "required": ["href", "operation", "file"]
                        },
                        "attachment_upload_complete": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL for completing file uploads.",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements/eb05deb4-05c5-45d0-ae74-9ec2f3e2ad86/attachments/37c5e7c4-f675-11ed-b67e-0242ac120002"
                            },
                            "operation": {
                              "type": "string",
                              "description": "The HTTP verb. PATCH only.",
                              "example": "patch"
                            },
                            "body": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "upload_complete": {
                                      "type": "boolean",
                                      "description": "For attachment creation, patch this field as `true` when the attachment file has been uploaded.",
                                      "example": "true"
                                    }
                                  },
                                  "required": ["upload_complete"]
                                }
                              },
                              "required": ["data"]
                            }
                          },
                          "required": ["href", "operation", "body"]
                        }
                      },
                      "required": [
                        "attachment_file_upload",
                        "attachment_upload_complete"
                      ]
                    }
                  },
                  "required": ["_links", "data"]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "attachment_file": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The name of the attachment file.",
                            "example": "ImportantSpreadsheet.xlsx"
                          }
                        },
                        "required": ["name"]
                      }
                    },
                    "required": ["attachment_file"]
                  }
                }
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "List Agreement Attachments",
        "tags": ["Finalize Attachments"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the agreement record."
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Which page of attachments to get.",
            "example": 2
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "How many attachments should be returned per page.",
            "example": 10
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the attachment record."
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO 8601 datetime of when the attachment was created.",
                            "readOnly": true
                          },
                          "file_name": {
                            "type": "string",
                            "description": "The name of the attachment file. Expected to be null if file has not been uploaded yet.",
                            "example": "ImportantSpreadsheet.xlsx",
                            "nullable": true
                          }
                        },
                        "required": ["id", "created_at", "file_name"]
                      }
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of items returned",
                      "example": 1
                    },
                    "_links": {
                      "type": "object",
                      "properties": {
                        "next": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the next page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements/894e86b8-2866-494e-bb16-5aa19fce3348/attachments?page=3&per_page=1"
                            }
                          }
                        },
                        "prev": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the previous page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements/894e86b8-2866-494e-bb16-5aa19fce3348/attachments?page=1&per_page=1"
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": ["total_count", "_links", "data"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}/attachments/{attachment_id}/file": {
      "get": {
        "summary": "Download Attachment",
        "tags": ["Finalize Attachments"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agreement id",
            "example": "ed85ba3c-d323-11ed-afa1-0242ac120002"
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The attachment id",
            "example": "ed85ba3c-d323-11ed-afa1-0242ac120002"
          }
        ],
        "responses": {
          "302": {
            "description": "success",
            "headers": {
              "location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                },
                "description": "Presigned download URL for the attachment file."
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}/attachments/{attachment_id}": {
      "get": {
        "summary": "Get Agreement Attachment",
        "tags": ["Finalize Attachments"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agreement id",
            "example": "ed85ba3c-d323-11ed-afa1-0242ac120002"
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The attachment id",
            "example": "ed85ba3c-d323-11ed-afa1-0242ac120002"
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the attachment record."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the attachment was created.",
                          "readOnly": true
                        },
                        "file_name": {
                          "type": "string",
                          "description": "The name of the attachment file. Expected to be null if file has not been uploaded yet.",
                          "example": "ImportantSpreadsheet.xlsx",
                          "nullable": true
                        }
                      },
                      "required": ["id", "created_at", "file_name"]
                    }
                  },
                  "required": ["data"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Complete Attachment Upload",
        "tags": ["Finalize Attachments"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement UUID."
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The attachment UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the attachment record."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the attachment was created.",
                          "readOnly": true
                        },
                        "file_name": {
                          "type": "string",
                          "description": "The name of the attachment file. Expected to be null if file has not been uploaded yet.",
                          "example": "ImportantSpreadsheet.xlsx",
                          "nullable": true
                        }
                      },
                      "required": ["id", "created_at", "file_name"]
                    }
                  },
                  "required": ["data"]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "upload_complete": {
                        "type": "boolean",
                        "description": "For attachment creation, patch this field as `true` when the attachment file has been uploaded."
                      }
                    },
                    "required": ["upload_complete"]
                  }
                },
                "required": ["data"]
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements": {
      "post": {
        "summary": "Create Agreement",
        "tags": ["Finalize Agreements"],
        "parameters": [],
        "responses": {
          "201": {
            "description": "created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement record.",
                          "readOnly": true
                        },
                        "name": {
                          "type": "string",
                          "description": "The name of the agreement.",
                          "example": "LinkSquares Contract"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the agreement record was created.",
                          "readOnly": true
                        },
                        "status_updated_at": {
                          "type": "string",
                          "nullable": true,
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the agreement status was updated. Expected to be null if the agreement is not fully created.",
                          "readOnly": true
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "intake",
                            "request",
                            "sign",
                            "webform"
                          ],
                          "description": "The kind of the agreement.",
                          "readOnly": true
                        },
                        "analyze_agreement_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the Analyze agreement that was created and referenced by a Fully Signed Finalize agreement.",
                          "readOnly": true,
                          "example": "2bdb40a3-e5d3-47fb-bcb8-b5b1d6ee549d"
                        },
                        "template_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the template the agreement was created from. Expected to be null if the agreement was not created from a template.",
                          "readOnly": true,
                          "example": "a25771d9-f44b-4284-82a7-a9e822ae6c18"
                        },
                        "author_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the user record that created the agreement.",
                          "readOnly": true
                        },
                        "owner_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the user record that is currently the agreement owner. Expected to be null if the agreement does not have an owner.",
                          "example": "b25771d9-f44b-4284-82a7-a9e822ae6c18"
                        },
                        "collaborator_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement collaborator User UUIDs."
                        },
                        "status_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the current status record. Expected to be null if the agreement is not fully created."
                        },
                        "question_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement question UUIDs."
                        },
                        "token_value_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement token value UUIDs."
                        },
                        "pen": {
                          "type": "object",
                          "properties": {
                            "assigned_to_counterparty": {
                              "type": "boolean",
                              "description": "Indicates whether the pen is assigned to the counterparty."
                            },
                            "holder_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "description": "Array of the agreement pen holder User UUIDs."
                            }
                          }
                        }
                      },
                      "_embedded": {
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the user record.",
                                "readOnly": true
                              },
                              "first_name": {
                                "type": "string",
                                "description": "The first name of the user.",
                                "example": "Steve",
                                "readOnly": true
                              },
                              "last_name": {
                                "type": "string",
                                "description": "The last name of the user.",
                                "example": "Urkel",
                                "readOnly": true
                              },
                              "email": {
                                "type": "string",
                                "description": "The email of the user.",
                                "example": "surkel@linksquares.com",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "first_name",
                              "last_name",
                              "email"
                            ]
                          }
                        },
                        "questions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the agreement question.",
                                "readOnly": true
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "description": "A description of what the question is asking.",
                                "readOnly": true
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Whether the question is required or not.",
                                "readOnly": true
                              },
                              "attachment_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": "List of agreement question attachment UUIDs."
                              },
                              "options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": {
                                      "type": "string",
                                      "description": "The answer option value.",
                                      "example": "Option 1"
                                    },
                                    "custom_description": {
                                      "type": "string",
                                      "description": "A user-defined description for the answer option",
                                      "example": "The best option."
                                    }
                                  },
                                  "required": ["id", "description"]
                                },
                                "description": "List of possible answer options."
                              },
                              "answer": {
                                "type": "object",
                                "oneOf": [
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "value": {
                                        "type": "string",
                                        "description": "The answer value.",
                                        "readOnly": true
                                      }
                                    },
                                    "required": ["id", "value"]
                                  },
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "selected_option_ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "format": "uuid"
                                        },
                                        "description": "List of the selected answer option UUIDs."
                                      }
                                    },
                                    "required": ["id", "selected_option_ids"]
                                  },
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "attachment_ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "format": "uuid"
                                        },
                                        "description": "List of agreement answer attachment UUIDs."
                                      }
                                    },
                                    "required": ["id", "attachment_ids"]
                                  }
                                ]
                              }
                            },
                            "example": {
                              "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                              "answer_type": "text",
                              "description": "What is the agreement name?",
                              "required": true,
                              "answer": {
                                "id": "4fa85f64-5717-4562-b3fc-2c963f66afa6",
                                "value": "LinkSquares Non Disclosure Agreement"
                              }
                            },
                            "required": [
                              "id",
                              "answer_type",
                              "description",
                              "required",
                              "answer"
                            ]
                          }
                        },
                        "token_values": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the token value.",
                                    "readOnly": true
                                  },
                                  "token_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The template token UUID associated with the token value."
                                  },
                                  "selected_option_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid",
                                      "readOnly": true
                                    },
                                    "description": "The UUIDs of the selected answer options."
                                  }
                                },
                                "required": [
                                  "id",
                                  "token_id",
                                  "selected_option_ids"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the token value.",
                                    "readOnly": true
                                  },
                                  "token_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The template token UUID associated with the token value."
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "The value of the token.",
                                    "example": "Nevada",
                                    "readOnly": true
                                  }
                                },
                                "required": ["id", "token_id", "value"]
                              }
                            ]
                          }
                        },
                        "statuses": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the agreement status record.",
                                "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                                "readOnly": true
                              },
                              "name": {
                                "type": "string",
                                "description": "The name of the agreement status.",
                                "example": "Internal Review",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "description": "The description of the agreement status.",
                                "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                                "readOnly": true
                              },
                              "internal_enum": {
                                "type": "string",
                                "description": "A unique string to identify the agreement status.",
                                "example": "internal_review",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "internal_enum"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "status_updated_at",
                        "created_at",
                        "template_id",
                        "author_id",
                        "owner_id",
                        "kind",
                        "analyze_agreement_id",
                        "collaborator_ids",
                        "status_id",
                        "question_ids",
                        "token_value_ids"
                      ],
                      "single_only": [
                        "collaborator_ids",
                        "question_ids",
                        "token_value_ids"
                      ]
                    },
                    "_links": {
                      "type": "object",
                      "description": "Upload links to finish intake agreement creation.",
                      "properties": {
                        "agreement_file_upload": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "Presigned upload URL for the agreement file.",
                              "example": "https://s3.amazonaws.com/linksquares-finalize-bucket/store/agreementversion/d0441f5b-3f7a-43de-84ef-37758b9929dd/file/ffd9b8871fb6250a4a98a53011e17527/basic_agreement.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<Amz-Credential-Value>&X-Amz-Date=20230402T134848Z&X-Amz-Expires=900&X-Amz-Security-Token=<Amz-Security-Token-Value>&X-Amz-SignedHeaders=host&X-Amz-Signature=<Amz-Signature-Value>"
                            },
                            "operation": {
                              "type": "string",
                              "description": "The HTTP verb. PUT only.",
                              "example": "put"
                            },
                            "file": {
                              "type": "string",
                              "description": "File name with extension.",
                              "example": "basic_agreement.docx"
                            }
                          },
                          "required": ["href", "operation", "file"]
                        },
                        "answer_file_uploads": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "href": {
                                "type": "string",
                                "description": "Presigned upload URL for the answer file.",
                                "example": "https://s3.amazonaws.com/linksquares-finalize-bucket/store/agreement/d0441f5b-3f7a-43de-84ef-37758b9929dd/file/ffd9b8871fb6250a4a98a53011e17527/basic_agreement.docx?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<Amz-Credential-Value>&X-Amz-Date=20230402T134848Z&X-Amz-Expires=900&X-Amz-Security-Token=<Amz-Security-Token-Value>&X-Amz-SignedHeaders=host&X-Amz-Signature=<Amz-Signature-Value>"
                              },
                              "operation": {
                                "type": "string",
                                "description": "The HTTP verb. PUT only.",
                                "example": "put"
                              },
                              "file": {
                                "type": "string",
                                "description": "File name with extension.",
                                "example": "ImportantSpreadsheet.xlsx"
                              }
                            },
                            "required": ["href", "operation", "file"]
                          }
                        },
                        "agreement_uploads_complete": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL for completing file uploads.",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements/eb05deb4-05c5-45d0-ae74-9ec2f3e2ad86"
                            },
                            "operation": {
                              "type": "string",
                              "description": "The HTTP verb. PATCH only.",
                              "example": "patch"
                            },
                            "body": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "type": "object",
                                  "properties": {
                                    "upload_complete": {
                                      "type": "boolean",
                                      "description": "For agreement creation flow, patch this field as `true` when all agreement files have been uploaded."
                                    }
                                  },
                                  "required": ["upload_complete"]
                                }
                              },
                              "required": ["data"]
                            }
                          },
                          "required": ["href", "operation", "body"]
                        }
                      },
                      "required": [
                        "agreement_file_upload",
                        "agreement_uploads_complete"
                      ]
                    }
                  },
                  "required": ["_links", "data"]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "The name of the agreement.",
                        "example": "LinkSquares Contract"
                      },
                      "kind": {
                        "type": "string",
                        "enum": ["draft", "intake", "request"],
                        "description": "The kind of the agreement."
                      },
                      "template_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The UUID of the template or request form to create from."
                      },
                      "agreement_file": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "File name with extension. File must be type docx, pdf, or xlsx.",
                            "example": "LinkSquares_NDA.docx"
                          }
                        },
                        "description": "Information about the file to be uploaded with this agreement. Only applicable for 'intake' templates."
                      },
                      "tokens": {
                        "type": "array",
                        "description": "The values for the template tokens. Only applicable for 'draft' templates. Must provide 'selected' for single and multi select token types and 'value' for every other token type.",
                        "items": {
                          "type": "object",
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the template token."
                                },
                                "value": {
                                  "oneOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "integer"
                                    }
                                  ],
                                  "description": "The value of the token.",
                                  "example": "Token 1 value"
                                }
                              },
                              "required": ["id", "value"]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the template token."
                                },
                                "selected": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the token option."
                                      }
                                    },
                                    "required": ["id"]
                                  }
                                }
                              },
                              "required": ["id", "selected"]
                            }
                          ]
                        }
                      },
                      "answers": {
                        "type": "array",
                        "description": "The answers to the template questions. Must provide 'selected' for single and multi select question types and 'value' for every other question type.",
                        "items": {
                          "type": "object",
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the template question."
                                },
                                "value": {
                                  "oneOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "integer"
                                    }
                                  ],
                                  "description": "The answer to the question.",
                                  "example": "Answer to question one"
                                }
                              },
                              "required": ["id", "value"]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the template question."
                                },
                                "selected": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer option."
                                      },
                                      "custom_description": {
                                        "type": "string",
                                        "description": "A user-defined description for the answer option",
                                        "example": "The best option."
                                      }
                                    },
                                    "required": ["id"]
                                  }
                                }
                              },
                              "required": ["id", "selected"]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the template question."
                                },
                                "files": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "name": {
                                        "type": "string",
                                        "description": "The name of the answer file.",
                                        "example": "ImportantSpreadsheet.xlsx"
                                      }
                                    },
                                    "required": ["name"]
                                  }
                                }
                              },
                              "required": ["id", "files"]
                            }
                          ]
                        }
                      },
                      "tables_values": {
                        "type": "array",
                        "description": "The table tokens to populate corresponding table token placeholders in the template, tokens must be be prefixed by #[ and suffixed by ]#",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "The UUID of the table token."
                            },
                            "start_token": {
                              "type": "string",
                              "description": "Start table token identifier.",
                              "example": "#[TABLE::START::Subscription_Fees]#"
                            },
                            "end_token": {
                              "type": "string",
                              "description": "End table token identifier.",
                              "example": "#[TABLE::END::Subscription_Fees]#"
                            },
                            "total_tokens": {
                              "type": "object",
                              "description": "The total token identifiers and their values.",
                              "example": "\"#[TOTAL::Quote_Rollup_ARR]#\" : \"$32,851.728\""
                            },
                            "row_tokens": {
                              "type": "array",
                              "description": "The row token identifiers and their values.",
                              "items": {
                                "type": "object"
                              }
                            }
                          },
                          "required": [
                            "start_token",
                            "end_token",
                            "total_tokens",
                            "row_tokens"
                          ]
                        }
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "source_name": {
                            "type": "string",
                            "description": "Name of the ingestion source",
                            "example": "Salesforce"
                          },
                          "metadata": {
                            "type": "object",
                            "properties": {
                              "source_record_id": {
                                "type": "string",
                                "description": "Ingestion source record id"
                              },
                              "source_record_name": {
                                "type": "string",
                                "description": "Name of the ingestion source record",
                                "example": "SFDC Opportunity.docx"
                              },
                              "source_record_url": {
                                "type": "string",
                                "description": "Link to ingestion source record",
                                "example": "https://example.com/deals/1"
                              },
                              "color": {
                                "type": "string",
                                "description": "Hex value of color associated with the ingestion source",
                                "example": "#FFFFFF"
                              }
                            }
                          }
                        },
                        "description": "Information about the ingestion source of agreements",
                        "required": ["source_name", "metadata"]
                      }
                    },
                    "required": ["name", "kind", "template_id"]
                  }
                },
                "required": ["data"]
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "get": {
        "summary": "List Agreements",
        "tags": ["Finalize Agreements"],
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Which page of agreements to get.",
            "example": 2
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "How many agreements should be returned per page.",
            "example": 10
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "description": "Filter agreements by a specific attribute. Options are:</br>\n                    ```filter[name]``` - Returns only agreements with the specified name attribute. This can query name with partial match.</br>\n                    ```filter[created_at][before]``` - Returns only agreements created before this date. Must be in ISO8601 format.</br>\n                    ```filter[created_at][after]``` - Returns only agreements created after this date. Must be in ISO8601 format.</br>\n                    ```filter[status_updated_at][before]``` - Returns only agreements with status updated before this date. Must be in ISO8601 format.</br>\n                    ```filter[status_updated_at][after]``` - Returns only agreements with status updated after this date. Must be in ISO8601 format.</br>\n                    ```filter[status_id][]``` - Filter to agreements with a ```status_id``` that contains the specified value.</br>\n                    ```filter[template_id][]``` - Filter to agreements with a ```template_id``` that contains the specified value.</br>\n                    ```filter[analyze_agreement_id][]``` - Filter to agreements with an ```analyze_agreement_id``` that contains the specified value.</br></br>\n                    NOTE: Query multiple ```status_id``` or ```template_id``` using syntax: ```?filter[template_id][]=4076215b-2476-467b-893d-1fe9fd9199d9&filter[template_id][]=93978d89-38a9-4d5f-b531-9468ff1ba9af```</br>"
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement record.",
                            "readOnly": true
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the agreement.",
                            "example": "LinkSquares Contract"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO 8601 datetime of when the agreement record was created.",
                            "readOnly": true
                          },
                          "status_updated_at": {
                            "type": "string",
                            "nullable": true,
                            "format": "date-time",
                            "description": "The ISO 8601 datetime of when the agreement status was updated. Expected to be null if the agreement is not fully created.",
                            "readOnly": true
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "draft",
                              "intake",
                              "request",
                              "sign",
                              "webform"
                            ],
                            "description": "The kind of the agreement.",
                            "readOnly": true
                          },
                          "analyze_agreement_id": {
                            "type": "string",
                            "nullable": true,
                            "format": "uuid",
                            "description": "The UUID of the Analyze agreement that was created and referenced by a Fully Signed Finalize agreement.",
                            "readOnly": true,
                            "example": "2bdb40a3-e5d3-47fb-bcb8-b5b1d6ee549d"
                          },
                          "template_id": {
                            "type": "string",
                            "nullable": true,
                            "format": "uuid",
                            "description": "The UUID of the template the agreement was created from. Expected to be null if the agreement was not created from a template.",
                            "readOnly": true,
                            "example": "a25771d9-f44b-4284-82a7-a9e822ae6c18"
                          },
                          "author_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the user record that created the agreement.",
                            "readOnly": true
                          },
                          "owner_id": {
                            "type": "string",
                            "nullable": true,
                            "format": "uuid",
                            "description": "The UUID of the user record that is currently the agreement owner. Expected to be null if the agreement does not have an owner.",
                            "example": "b25771d9-f44b-4284-82a7-a9e822ae6c18"
                          },
                          "status_id": {
                            "type": "string",
                            "nullable": true,
                            "format": "uuid",
                            "description": "The UUID of the current status record. Expected to be null if the agreement is not fully created."
                          },
                          "pen": {
                            "type": "object",
                            "properties": {
                              "assigned_to_counterparty": {
                                "type": "boolean",
                                "description": "Indicates whether the pen is assigned to the counterparty."
                              },
                              "holder_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": "Array of the agreement pen holder User UUIDs."
                              }
                            }
                          }
                        },
                        "_embedded": {
                          "users": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the user record.",
                                  "readOnly": true
                                },
                                "first_name": {
                                  "type": "string",
                                  "description": "The first name of the user.",
                                  "example": "Steve",
                                  "readOnly": true
                                },
                                "last_name": {
                                  "type": "string",
                                  "description": "The last name of the user.",
                                  "example": "Urkel",
                                  "readOnly": true
                                },
                                "email": {
                                  "type": "string",
                                  "description": "The email of the user.",
                                  "example": "surkel@linksquares.com",
                                  "readOnly": true
                                }
                              },
                              "required": [
                                "id",
                                "first_name",
                                "last_name",
                                "email"
                              ]
                            }
                          },
                          "questions": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the agreement question.",
                                  "readOnly": true
                                },
                                "answer_type": {
                                  "type": "string",
                                  "enum": [
                                    "text",
                                    "paragraph",
                                    "date",
                                    "numbers",
                                    "multiple_selection",
                                    "single_selection",
                                    "file",
                                    "url"
                                  ],
                                  "description": "The answer type of the question.",
                                  "readOnly": true
                                },
                                "description": {
                                  "type": "string",
                                  "description": "A description of what the question is asking.",
                                  "readOnly": true
                                },
                                "required": {
                                  "type": "boolean",
                                  "description": "Whether the question is required or not.",
                                  "readOnly": true
                                },
                                "attachment_ids": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "format": "uuid"
                                  },
                                  "description": "List of agreement question attachment UUIDs."
                                },
                                "options": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid"
                                      },
                                      "description": {
                                        "type": "string",
                                        "description": "The answer option value.",
                                        "example": "Option 1"
                                      },
                                      "custom_description": {
                                        "type": "string",
                                        "description": "A user-defined description for the answer option",
                                        "example": "The best option."
                                      }
                                    },
                                    "required": ["id", "description"]
                                  },
                                  "description": "List of possible answer options."
                                },
                                "answer": {
                                  "type": "object",
                                  "oneOf": [
                                    {
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "format": "uuid",
                                          "description": "The UUID of the answer.",
                                          "readOnly": true
                                        },
                                        "value": {
                                          "type": "string",
                                          "description": "The answer value.",
                                          "readOnly": true
                                        }
                                      },
                                      "required": ["id", "value"]
                                    },
                                    {
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "format": "uuid",
                                          "description": "The UUID of the answer.",
                                          "readOnly": true
                                        },
                                        "selected_option_ids": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "format": "uuid"
                                          },
                                          "description": "List of the selected answer option UUIDs."
                                        }
                                      },
                                      "required": ["id", "selected_option_ids"]
                                    },
                                    {
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "format": "uuid",
                                          "description": "The UUID of the answer.",
                                          "readOnly": true
                                        },
                                        "attachment_ids": {
                                          "type": "array",
                                          "items": {
                                            "type": "string",
                                            "format": "uuid"
                                          },
                                          "description": "List of agreement answer attachment UUIDs."
                                        }
                                      },
                                      "required": ["id", "attachment_ids"]
                                    }
                                  ]
                                }
                              },
                              "example": {
                                "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                                "answer_type": "text",
                                "description": "What is the agreement name?",
                                "required": true,
                                "answer": {
                                  "id": "4fa85f64-5717-4562-b3fc-2c963f66afa6",
                                  "value": "LinkSquares Non Disclosure Agreement"
                                }
                              },
                              "required": [
                                "id",
                                "answer_type",
                                "description",
                                "required",
                                "answer"
                              ]
                            }
                          },
                          "token_values": {
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the token value.",
                                      "readOnly": true
                                    },
                                    "token_id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The template token UUID associated with the token value."
                                    },
                                    "selected_option_ids": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "format": "uuid",
                                        "readOnly": true
                                      },
                                      "description": "The UUIDs of the selected answer options."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "token_id",
                                    "selected_option_ids"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the token value.",
                                      "readOnly": true
                                    },
                                    "token_id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The template token UUID associated with the token value."
                                    },
                                    "value": {
                                      "type": "string",
                                      "description": "The value of the token.",
                                      "example": "Nevada",
                                      "readOnly": true
                                    }
                                  },
                                  "required": ["id", "token_id", "value"]
                                }
                              ]
                            }
                          },
                          "statuses": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the agreement status record.",
                                  "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                                  "readOnly": true
                                },
                                "name": {
                                  "type": "string",
                                  "description": "The name of the agreement status.",
                                  "example": "Internal Review",
                                  "readOnly": true
                                },
                                "description": {
                                  "type": "string",
                                  "description": "The description of the agreement status.",
                                  "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                                  "readOnly": true
                                },
                                "internal_enum": {
                                  "type": "string",
                                  "description": "A unique string to identify the agreement status.",
                                  "example": "internal_review",
                                  "readOnly": true
                                }
                              },
                              "required": [
                                "id",
                                "name",
                                "description",
                                "internal_enum"
                              ]
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "status_updated_at",
                          "created_at",
                          "template_id",
                          "author_id",
                          "owner_id",
                          "kind",
                          "analyze_agreement_id",
                          "status_id"
                        ],
                        "single_only": [
                          "collaborator_ids",
                          "question_ids",
                          "token_value_ids"
                        ]
                      }
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of items returned",
                      "example": 1
                    },
                    "_links": {
                      "type": "object",
                      "properties": {
                        "next": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the next page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements?page=3&per_page=1"
                            }
                          }
                        },
                        "prev": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the previous page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements?page=1&per_page=1"
                            }
                          }
                        }
                      }
                    }
                  },
                  "_embedded": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the user record.",
                            "readOnly": true
                          },
                          "first_name": {
                            "type": "string",
                            "description": "The first name of the user.",
                            "example": "Steve",
                            "readOnly": true
                          },
                          "last_name": {
                            "type": "string",
                            "description": "The last name of the user.",
                            "example": "Urkel",
                            "readOnly": true
                          },
                          "email": {
                            "type": "string",
                            "description": "The email of the user.",
                            "example": "surkel@linksquares.com",
                            "readOnly": true
                          }
                        },
                        "required": ["id", "first_name", "last_name", "email"]
                      }
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement question.",
                            "readOnly": true
                          },
                          "answer_type": {
                            "type": "string",
                            "enum": [
                              "text",
                              "paragraph",
                              "date",
                              "numbers",
                              "multiple_selection",
                              "single_selection",
                              "file",
                              "url"
                            ],
                            "description": "The answer type of the question.",
                            "readOnly": true
                          },
                          "description": {
                            "type": "string",
                            "description": "A description of what the question is asking.",
                            "readOnly": true
                          },
                          "required": {
                            "type": "boolean",
                            "description": "Whether the question is required or not.",
                            "readOnly": true
                          },
                          "attachment_ids": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "description": "List of agreement question attachment UUIDs."
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": {
                                  "type": "string",
                                  "description": "The answer option value.",
                                  "example": "Option 1"
                                },
                                "custom_description": {
                                  "type": "string",
                                  "description": "A user-defined description for the answer option",
                                  "example": "The best option."
                                }
                              },
                              "required": ["id", "description"]
                            },
                            "description": "List of possible answer options."
                          },
                          "answer": {
                            "type": "object",
                            "oneOf": [
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "The answer value.",
                                    "readOnly": true
                                  }
                                },
                                "required": ["id", "value"]
                              },
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "selected_option_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": "List of the selected answer option UUIDs."
                                  }
                                },
                                "required": ["id", "selected_option_ids"]
                              },
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "attachment_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": "List of agreement answer attachment UUIDs."
                                  }
                                },
                                "required": ["id", "attachment_ids"]
                              }
                            ]
                          }
                        },
                        "example": {
                          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                          "answer_type": "text",
                          "description": "What is the agreement name?",
                          "required": true,
                          "answer": {
                            "id": "4fa85f64-5717-4562-b3fc-2c963f66afa6",
                            "value": "LinkSquares Non Disclosure Agreement"
                          }
                        },
                        "required": [
                          "id",
                          "answer_type",
                          "description",
                          "required",
                          "answer"
                        ]
                      }
                    },
                    "token_values": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the token value.",
                                "readOnly": true
                              },
                              "token_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The template token UUID associated with the token value."
                              },
                              "selected_option_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid",
                                  "readOnly": true
                                },
                                "description": "The UUIDs of the selected answer options."
                              }
                            },
                            "required": [
                              "id",
                              "token_id",
                              "selected_option_ids"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the token value.",
                                "readOnly": true
                              },
                              "token_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The template token UUID associated with the token value."
                              },
                              "value": {
                                "type": "string",
                                "description": "The value of the token.",
                                "example": "Nevada",
                                "readOnly": true
                              }
                            },
                            "required": ["id", "token_id", "value"]
                          }
                        ]
                      }
                    },
                    "statuses": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement status record.",
                            "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                            "readOnly": true
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the agreement status.",
                            "example": "Internal Review",
                            "readOnly": true
                          },
                          "description": {
                            "type": "string",
                            "description": "The description of the agreement status.",
                            "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                            "readOnly": true
                          },
                          "internal_enum": {
                            "type": "string",
                            "description": "A unique string to identify the agreement status.",
                            "example": "internal_review",
                            "readOnly": true
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "internal_enum"
                        ]
                      }
                    }
                  },
                  "required": ["total_count", "_links", "data"],
                  "single_only": [
                    "collaborator_ids",
                    "question_ids",
                    "token_value_ids"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}": {
      "get": {
        "summary": "Get Agreement",
        "tags": ["Finalize Agreements"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agreement id",
            "example": "6d3b27ba-0949-44e0-b207-105722610af5"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "description": "When given the value 'embedded', the response will include subresource content",
            "example": "embedded",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement record.",
                          "readOnly": true
                        },
                        "name": {
                          "type": "string",
                          "description": "The name of the agreement.",
                          "example": "LinkSquares Contract"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the agreement record was created.",
                          "readOnly": true
                        },
                        "status_updated_at": {
                          "type": "string",
                          "nullable": true,
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the agreement status was updated. Expected to be null if the agreement is not fully created.",
                          "readOnly": true
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "intake",
                            "request",
                            "sign",
                            "webform"
                          ],
                          "description": "The kind of the agreement.",
                          "readOnly": true
                        },
                        "analyze_agreement_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the Analyze agreement that was created and referenced by a Fully Signed Finalize agreement.",
                          "readOnly": true,
                          "example": "2bdb40a3-e5d3-47fb-bcb8-b5b1d6ee549d"
                        },
                        "template_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the template the agreement was created from. Expected to be null if the agreement was not created from a template.",
                          "readOnly": true,
                          "example": "a25771d9-f44b-4284-82a7-a9e822ae6c18"
                        },
                        "author_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the user record that created the agreement.",
                          "readOnly": true
                        },
                        "owner_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the user record that is currently the agreement owner. Expected to be null if the agreement does not have an owner.",
                          "example": "b25771d9-f44b-4284-82a7-a9e822ae6c18"
                        },
                        "collaborator_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement collaborator User UUIDs."
                        },
                        "status_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the current status record. Expected to be null if the agreement is not fully created."
                        },
                        "question_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement question UUIDs."
                        },
                        "token_value_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement token value UUIDs."
                        },
                        "pen": {
                          "type": "object",
                          "properties": {
                            "assigned_to_counterparty": {
                              "type": "boolean",
                              "description": "Indicates whether the pen is assigned to the counterparty."
                            },
                            "holder_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "description": "Array of the agreement pen holder User UUIDs."
                            }
                          }
                        }
                      },
                      "_embedded": {
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the user record.",
                                "readOnly": true
                              },
                              "first_name": {
                                "type": "string",
                                "description": "The first name of the user.",
                                "example": "Steve",
                                "readOnly": true
                              },
                              "last_name": {
                                "type": "string",
                                "description": "The last name of the user.",
                                "example": "Urkel",
                                "readOnly": true
                              },
                              "email": {
                                "type": "string",
                                "description": "The email of the user.",
                                "example": "surkel@linksquares.com",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "first_name",
                              "last_name",
                              "email"
                            ]
                          }
                        },
                        "questions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the agreement question.",
                                "readOnly": true
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "description": "A description of what the question is asking.",
                                "readOnly": true
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Whether the question is required or not.",
                                "readOnly": true
                              },
                              "attachment_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": "List of agreement question attachment UUIDs."
                              },
                              "options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": {
                                      "type": "string",
                                      "description": "The answer option value.",
                                      "example": "Option 1"
                                    },
                                    "custom_description": {
                                      "type": "string",
                                      "description": "A user-defined description for the answer option",
                                      "example": "The best option."
                                    }
                                  },
                                  "required": ["id", "description"]
                                },
                                "description": "List of possible answer options."
                              },
                              "answer": {
                                "type": "object",
                                "oneOf": [
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "value": {
                                        "type": "string",
                                        "description": "The answer value.",
                                        "readOnly": true
                                      }
                                    },
                                    "required": ["id", "value"]
                                  },
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "selected_option_ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "format": "uuid"
                                        },
                                        "description": "List of the selected answer option UUIDs."
                                      }
                                    },
                                    "required": ["id", "selected_option_ids"]
                                  },
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "attachment_ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "format": "uuid"
                                        },
                                        "description": "List of agreement answer attachment UUIDs."
                                      }
                                    },
                                    "required": ["id", "attachment_ids"]
                                  }
                                ]
                              }
                            },
                            "example": {
                              "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                              "answer_type": "text",
                              "description": "What is the agreement name?",
                              "required": true,
                              "answer": {
                                "id": "4fa85f64-5717-4562-b3fc-2c963f66afa6",
                                "value": "LinkSquares Non Disclosure Agreement"
                              }
                            },
                            "required": [
                              "id",
                              "answer_type",
                              "description",
                              "required",
                              "answer"
                            ]
                          }
                        },
                        "token_values": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the token value.",
                                    "readOnly": true
                                  },
                                  "token_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The template token UUID associated with the token value."
                                  },
                                  "selected_option_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid",
                                      "readOnly": true
                                    },
                                    "description": "The UUIDs of the selected answer options."
                                  }
                                },
                                "required": [
                                  "id",
                                  "token_id",
                                  "selected_option_ids"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the token value.",
                                    "readOnly": true
                                  },
                                  "token_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The template token UUID associated with the token value."
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "The value of the token.",
                                    "example": "Nevada",
                                    "readOnly": true
                                  }
                                },
                                "required": ["id", "token_id", "value"]
                              }
                            ]
                          }
                        },
                        "statuses": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the agreement status record.",
                                "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                                "readOnly": true
                              },
                              "name": {
                                "type": "string",
                                "description": "The name of the agreement status.",
                                "example": "Internal Review",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "description": "The description of the agreement status.",
                                "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                                "readOnly": true
                              },
                              "internal_enum": {
                                "type": "string",
                                "description": "A unique string to identify the agreement status.",
                                "example": "internal_review",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "internal_enum"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "status_updated_at",
                        "created_at",
                        "template_id",
                        "author_id",
                        "owner_id",
                        "kind",
                        "analyze_agreement_id",
                        "collaborator_ids",
                        "status_id",
                        "question_ids",
                        "token_value_ids"
                      ],
                      "single_only": [
                        "collaborator_ids",
                        "question_ids",
                        "token_value_ids"
                      ]
                    },
                    "_embedded": {
                      "properties": {
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the user record.",
                                "readOnly": true
                              },
                              "first_name": {
                                "type": "string",
                                "description": "The first name of the user.",
                                "example": "Steve",
                                "readOnly": true
                              },
                              "last_name": {
                                "type": "string",
                                "description": "The last name of the user.",
                                "example": "Urkel",
                                "readOnly": true
                              },
                              "email": {
                                "type": "string",
                                "description": "The email of the user.",
                                "example": "surkel@linksquares.com",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "first_name",
                              "last_name",
                              "email"
                            ]
                          }
                        },
                        "questions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the agreement question.",
                                "readOnly": true
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "description": "A description of what the question is asking.",
                                "readOnly": true
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Whether the question is required or not.",
                                "readOnly": true
                              },
                              "attachment_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": "List of agreement question attachment UUIDs."
                              },
                              "options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": {
                                      "type": "string",
                                      "description": "The answer option value.",
                                      "example": "Option 1"
                                    },
                                    "custom_description": {
                                      "type": "string",
                                      "description": "A user-defined description for the answer option",
                                      "example": "The best option."
                                    }
                                  },
                                  "required": ["id", "description"]
                                },
                                "description": "List of possible answer options."
                              },
                              "answer": {
                                "type": "object",
                                "oneOf": [
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "value": {
                                        "type": "string",
                                        "description": "The answer value.",
                                        "readOnly": true
                                      }
                                    },
                                    "required": ["id", "value"]
                                  },
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "selected_option_ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "format": "uuid"
                                        },
                                        "description": "List of the selected answer option UUIDs."
                                      }
                                    },
                                    "required": ["id", "selected_option_ids"]
                                  },
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "attachment_ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "format": "uuid"
                                        },
                                        "description": "List of agreement answer attachment UUIDs."
                                      }
                                    },
                                    "required": ["id", "attachment_ids"]
                                  }
                                ]
                              }
                            },
                            "example": {
                              "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                              "answer_type": "text",
                              "description": "What is the agreement name?",
                              "required": true,
                              "answer": {
                                "id": "4fa85f64-5717-4562-b3fc-2c963f66afa6",
                                "value": "LinkSquares Non Disclosure Agreement"
                              }
                            },
                            "required": [
                              "id",
                              "answer_type",
                              "description",
                              "required",
                              "answer"
                            ]
                          }
                        },
                        "token_values": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the token value.",
                                    "readOnly": true
                                  },
                                  "token_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The template token UUID associated with the token value."
                                  },
                                  "selected_option_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid",
                                      "readOnly": true
                                    },
                                    "description": "The UUIDs of the selected answer options."
                                  }
                                },
                                "required": [
                                  "id",
                                  "token_id",
                                  "selected_option_ids"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the token value.",
                                    "readOnly": true
                                  },
                                  "token_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The template token UUID associated with the token value."
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "The value of the token.",
                                    "example": "Nevada",
                                    "readOnly": true
                                  }
                                },
                                "required": ["id", "token_id", "value"]
                              }
                            ]
                          }
                        },
                        "statuses": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the agreement status record.",
                                "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                                "readOnly": true
                              },
                              "name": {
                                "type": "string",
                                "description": "The name of the agreement status.",
                                "example": "Internal Review",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "description": "The description of the agreement status.",
                                "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                                "readOnly": true
                              },
                              "internal_enum": {
                                "type": "string",
                                "description": "A unique string to identify the agreement status.",
                                "example": "internal_review",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "internal_enum"
                            ]
                          }
                        }
                      },
                      "type": "object",
                      "description": "Includes the full sub-resource objects. Only present if ?include=embedded query parameter is supplied",
                      "required": [
                        "users",
                        "questions",
                        "token_values",
                        "statuses"
                      ]
                    }
                  },
                  "_embedded": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the user record.",
                            "readOnly": true
                          },
                          "first_name": {
                            "type": "string",
                            "description": "The first name of the user.",
                            "example": "Steve",
                            "readOnly": true
                          },
                          "last_name": {
                            "type": "string",
                            "description": "The last name of the user.",
                            "example": "Urkel",
                            "readOnly": true
                          },
                          "email": {
                            "type": "string",
                            "description": "The email of the user.",
                            "example": "surkel@linksquares.com",
                            "readOnly": true
                          }
                        },
                        "required": ["id", "first_name", "last_name", "email"]
                      }
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement question.",
                            "readOnly": true
                          },
                          "answer_type": {
                            "type": "string",
                            "enum": [
                              "text",
                              "paragraph",
                              "date",
                              "numbers",
                              "multiple_selection",
                              "single_selection",
                              "file",
                              "url"
                            ],
                            "description": "The answer type of the question.",
                            "readOnly": true
                          },
                          "description": {
                            "type": "string",
                            "description": "A description of what the question is asking.",
                            "readOnly": true
                          },
                          "required": {
                            "type": "boolean",
                            "description": "Whether the question is required or not.",
                            "readOnly": true
                          },
                          "attachment_ids": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "description": "List of agreement question attachment UUIDs."
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": {
                                  "type": "string",
                                  "description": "The answer option value.",
                                  "example": "Option 1"
                                },
                                "custom_description": {
                                  "type": "string",
                                  "description": "A user-defined description for the answer option",
                                  "example": "The best option."
                                }
                              },
                              "required": ["id", "description"]
                            },
                            "description": "List of possible answer options."
                          },
                          "answer": {
                            "type": "object",
                            "oneOf": [
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "The answer value.",
                                    "readOnly": true
                                  }
                                },
                                "required": ["id", "value"]
                              },
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "selected_option_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": "List of the selected answer option UUIDs."
                                  }
                                },
                                "required": ["id", "selected_option_ids"]
                              },
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "attachment_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": "List of agreement answer attachment UUIDs."
                                  }
                                },
                                "required": ["id", "attachment_ids"]
                              }
                            ]
                          }
                        },
                        "example": {
                          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                          "answer_type": "text",
                          "description": "What is the agreement name?",
                          "required": true,
                          "answer": {
                            "id": "4fa85f64-5717-4562-b3fc-2c963f66afa6",
                            "value": "LinkSquares Non Disclosure Agreement"
                          }
                        },
                        "required": [
                          "id",
                          "answer_type",
                          "description",
                          "required",
                          "answer"
                        ]
                      }
                    },
                    "token_values": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the token value.",
                                "readOnly": true
                              },
                              "token_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The template token UUID associated with the token value."
                              },
                              "selected_option_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid",
                                  "readOnly": true
                                },
                                "description": "The UUIDs of the selected answer options."
                              }
                            },
                            "required": [
                              "id",
                              "token_id",
                              "selected_option_ids"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the token value.",
                                "readOnly": true
                              },
                              "token_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The template token UUID associated with the token value."
                              },
                              "value": {
                                "type": "string",
                                "description": "The value of the token.",
                                "example": "Nevada",
                                "readOnly": true
                              }
                            },
                            "required": ["id", "token_id", "value"]
                          }
                        ]
                      }
                    },
                    "statuses": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement status record.",
                            "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                            "readOnly": true
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the agreement status.",
                            "example": "Internal Review",
                            "readOnly": true
                          },
                          "description": {
                            "type": "string",
                            "description": "The description of the agreement status.",
                            "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                            "readOnly": true
                          },
                          "internal_enum": {
                            "type": "string",
                            "description": "A unique string to identify the agreement status.",
                            "example": "internal_review",
                            "readOnly": true
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "internal_enum"
                        ]
                      }
                    }
                  },
                  "required": ["_embedded", "data"],
                  "single_only": [
                    "collaborator_ids",
                    "question_ids",
                    "token_value_ids"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Update Agreement",
        "tags": ["Finalize Agreements"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The agreement id.",
            "example": "6d3b27ba-0949-44e0-b207-105722610af5"
          }
        ],
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement record.",
                          "readOnly": true
                        },
                        "name": {
                          "type": "string",
                          "description": "The name of the agreement.",
                          "example": "LinkSquares Contract"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the agreement record was created.",
                          "readOnly": true
                        },
                        "status_updated_at": {
                          "type": "string",
                          "nullable": true,
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the agreement status was updated. Expected to be null if the agreement is not fully created.",
                          "readOnly": true
                        },
                        "kind": {
                          "type": "string",
                          "enum": [
                            "draft",
                            "intake",
                            "request",
                            "sign",
                            "webform"
                          ],
                          "description": "The kind of the agreement.",
                          "readOnly": true
                        },
                        "analyze_agreement_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the Analyze agreement that was created and referenced by a Fully Signed Finalize agreement.",
                          "readOnly": true,
                          "example": "2bdb40a3-e5d3-47fb-bcb8-b5b1d6ee549d"
                        },
                        "template_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the template the agreement was created from. Expected to be null if the agreement was not created from a template.",
                          "readOnly": true,
                          "example": "a25771d9-f44b-4284-82a7-a9e822ae6c18"
                        },
                        "author_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the user record that created the agreement.",
                          "readOnly": true
                        },
                        "owner_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the user record that is currently the agreement owner. Expected to be null if the agreement does not have an owner.",
                          "example": "b25771d9-f44b-4284-82a7-a9e822ae6c18"
                        },
                        "collaborator_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement collaborator User UUIDs."
                        },
                        "status_id": {
                          "type": "string",
                          "nullable": true,
                          "format": "uuid",
                          "description": "The UUID of the current status record. Expected to be null if the agreement is not fully created."
                        },
                        "question_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement question UUIDs."
                        },
                        "token_value_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the agreement token value UUIDs."
                        },
                        "pen": {
                          "type": "object",
                          "properties": {
                            "assigned_to_counterparty": {
                              "type": "boolean",
                              "description": "Indicates whether the pen is assigned to the counterparty."
                            },
                            "holder_ids": {
                              "type": "array",
                              "items": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "description": "Array of the agreement pen holder User UUIDs."
                            }
                          }
                        }
                      },
                      "_embedded": {
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the user record.",
                                "readOnly": true
                              },
                              "first_name": {
                                "type": "string",
                                "description": "The first name of the user.",
                                "example": "Steve",
                                "readOnly": true
                              },
                              "last_name": {
                                "type": "string",
                                "description": "The last name of the user.",
                                "example": "Urkel",
                                "readOnly": true
                              },
                              "email": {
                                "type": "string",
                                "description": "The email of the user.",
                                "example": "surkel@linksquares.com",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "first_name",
                              "last_name",
                              "email"
                            ]
                          }
                        },
                        "questions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the agreement question.",
                                "readOnly": true
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "description": "A description of what the question is asking.",
                                "readOnly": true
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Whether the question is required or not.",
                                "readOnly": true
                              },
                              "attachment_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": "List of agreement question attachment UUIDs."
                              },
                              "options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": {
                                      "type": "string",
                                      "description": "The answer option value.",
                                      "example": "Option 1"
                                    },
                                    "custom_description": {
                                      "type": "string",
                                      "description": "A user-defined description for the answer option",
                                      "example": "The best option."
                                    }
                                  },
                                  "required": ["id", "description"]
                                },
                                "description": "List of possible answer options."
                              },
                              "answer": {
                                "type": "object",
                                "oneOf": [
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "value": {
                                        "type": "string",
                                        "description": "The answer value.",
                                        "readOnly": true
                                      }
                                    },
                                    "required": ["id", "value"]
                                  },
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "selected_option_ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "format": "uuid"
                                        },
                                        "description": "List of the selected answer option UUIDs."
                                      }
                                    },
                                    "required": ["id", "selected_option_ids"]
                                  },
                                  {
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the answer.",
                                        "readOnly": true
                                      },
                                      "attachment_ids": {
                                        "type": "array",
                                        "items": {
                                          "type": "string",
                                          "format": "uuid"
                                        },
                                        "description": "List of agreement answer attachment UUIDs."
                                      }
                                    },
                                    "required": ["id", "attachment_ids"]
                                  }
                                ]
                              }
                            },
                            "example": {
                              "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                              "answer_type": "text",
                              "description": "What is the agreement name?",
                              "required": true,
                              "answer": {
                                "id": "4fa85f64-5717-4562-b3fc-2c963f66afa6",
                                "value": "LinkSquares Non Disclosure Agreement"
                              }
                            },
                            "required": [
                              "id",
                              "answer_type",
                              "description",
                              "required",
                              "answer"
                            ]
                          }
                        },
                        "token_values": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the token value.",
                                    "readOnly": true
                                  },
                                  "token_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The template token UUID associated with the token value."
                                  },
                                  "selected_option_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid",
                                      "readOnly": true
                                    },
                                    "description": "The UUIDs of the selected answer options."
                                  }
                                },
                                "required": [
                                  "id",
                                  "token_id",
                                  "selected_option_ids"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the token value.",
                                    "readOnly": true
                                  },
                                  "token_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The template token UUID associated with the token value."
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "The value of the token.",
                                    "example": "Nevada",
                                    "readOnly": true
                                  }
                                },
                                "required": ["id", "token_id", "value"]
                              }
                            ]
                          }
                        },
                        "statuses": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the agreement status record.",
                                "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                                "readOnly": true
                              },
                              "name": {
                                "type": "string",
                                "description": "The name of the agreement status.",
                                "example": "Internal Review",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "description": "The description of the agreement status.",
                                "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                                "readOnly": true
                              },
                              "internal_enum": {
                                "type": "string",
                                "description": "A unique string to identify the agreement status.",
                                "example": "internal_review",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "description",
                              "internal_enum"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "status_updated_at",
                        "created_at",
                        "template_id",
                        "author_id",
                        "owner_id",
                        "kind",
                        "analyze_agreement_id",
                        "collaborator_ids",
                        "status_id",
                        "question_ids",
                        "token_value_ids"
                      ],
                      "single_only": [
                        "collaborator_ids",
                        "question_ids",
                        "token_value_ids"
                      ]
                    }
                  },
                  "_embedded": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the user record.",
                            "readOnly": true
                          },
                          "first_name": {
                            "type": "string",
                            "description": "The first name of the user.",
                            "example": "Steve",
                            "readOnly": true
                          },
                          "last_name": {
                            "type": "string",
                            "description": "The last name of the user.",
                            "example": "Urkel",
                            "readOnly": true
                          },
                          "email": {
                            "type": "string",
                            "description": "The email of the user.",
                            "example": "surkel@linksquares.com",
                            "readOnly": true
                          }
                        },
                        "required": ["id", "first_name", "last_name", "email"]
                      }
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement question.",
                            "readOnly": true
                          },
                          "answer_type": {
                            "type": "string",
                            "enum": [
                              "text",
                              "paragraph",
                              "date",
                              "numbers",
                              "multiple_selection",
                              "single_selection",
                              "file",
                              "url"
                            ],
                            "description": "The answer type of the question.",
                            "readOnly": true
                          },
                          "description": {
                            "type": "string",
                            "description": "A description of what the question is asking.",
                            "readOnly": true
                          },
                          "required": {
                            "type": "boolean",
                            "description": "Whether the question is required or not.",
                            "readOnly": true
                          },
                          "attachment_ids": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "description": "List of agreement question attachment UUIDs."
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": {
                                  "type": "string",
                                  "description": "The answer option value.",
                                  "example": "Option 1"
                                },
                                "custom_description": {
                                  "type": "string",
                                  "description": "A user-defined description for the answer option",
                                  "example": "The best option."
                                }
                              },
                              "required": ["id", "description"]
                            },
                            "description": "List of possible answer options."
                          },
                          "answer": {
                            "type": "object",
                            "oneOf": [
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "The answer value.",
                                    "readOnly": true
                                  }
                                },
                                "required": ["id", "value"]
                              },
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "selected_option_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": "List of the selected answer option UUIDs."
                                  }
                                },
                                "required": ["id", "selected_option_ids"]
                              },
                              {
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the answer.",
                                    "readOnly": true
                                  },
                                  "attachment_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": "List of agreement answer attachment UUIDs."
                                  }
                                },
                                "required": ["id", "attachment_ids"]
                              }
                            ]
                          }
                        },
                        "example": {
                          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
                          "answer_type": "text",
                          "description": "What is the agreement name?",
                          "required": true,
                          "answer": {
                            "id": "4fa85f64-5717-4562-b3fc-2c963f66afa6",
                            "value": "LinkSquares Non Disclosure Agreement"
                          }
                        },
                        "required": [
                          "id",
                          "answer_type",
                          "description",
                          "required",
                          "answer"
                        ]
                      }
                    },
                    "token_values": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the token value.",
                                "readOnly": true
                              },
                              "token_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The template token UUID associated with the token value."
                              },
                              "selected_option_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid",
                                  "readOnly": true
                                },
                                "description": "The UUIDs of the selected answer options."
                              }
                            },
                            "required": [
                              "id",
                              "token_id",
                              "selected_option_ids"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the token value.",
                                "readOnly": true
                              },
                              "token_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The template token UUID associated with the token value."
                              },
                              "value": {
                                "type": "string",
                                "description": "The value of the token.",
                                "example": "Nevada",
                                "readOnly": true
                              }
                            },
                            "required": ["id", "token_id", "value"]
                          }
                        ]
                      }
                    },
                    "statuses": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement status record.",
                            "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                            "readOnly": true
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the agreement status.",
                            "example": "Internal Review",
                            "readOnly": true
                          },
                          "description": {
                            "type": "string",
                            "description": "The description of the agreement status.",
                            "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                            "readOnly": true
                          },
                          "internal_enum": {
                            "type": "string",
                            "description": "A unique string to identify the agreement status.",
                            "example": "internal_review",
                            "readOnly": true
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "internal_enum"
                        ]
                      }
                    }
                  },
                  "required": ["data"],
                  "single_only": [
                    "collaborator_ids",
                    "question_ids",
                    "token_value_ids"
                  ]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "upload_complete": {
                        "type": "boolean",
                        "description": "For agreement creation flow, patch this field as `true` when all agreement files have been uploaded."
                      },
                      "status_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The UUID of the Agreement Status record you want to transition to."
                      },
                      "questions": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "format": "uuid",
                              "description": "The UUID of the Question record that you want to update."
                            },
                            "answer": {
                              "type": "object",
                              "oneOf": [
                                {
                                  "properties": {
                                    "value": {
                                      "type": "string",
                                      "description": "The answer value."
                                    }
                                  },
                                  "required": ["value"]
                                },
                                {
                                  "properties": {
                                    "selected": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "format": "uuid",
                                            "description": "The UUID of the answer option record that you want to select."
                                          }
                                        },
                                        "required": ["id"]
                                      },
                                      "description": "List of the selected answer options."
                                    }
                                  },
                                  "required": ["selected"]
                                }
                              ]
                            }
                          },
                          "required": ["id", "answer"]
                        }
                      }
                    }
                  }
                },
                "required": ["data"]
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/agreements/{agreement_id}/comments": {
      "post": {
        "summary": "Create Comment",
        "tags": ["Finalize Comments"],
        "parameters": [
          {
            "name": "agreement_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The agreement UUID."
          }
        ],
        "responses": {
          "201": {
            "description": "created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the comment record."
                        },
                        "author_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the author of the comment record."
                        },
                        "text": {
                          "type": "string",
                          "description": "The text content of the comment."
                        },
                        "commentable_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the agreement."
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the comment was created.",
                          "readOnly": true
                        }
                      },
                      "required": [
                        "id",
                        "author_id",
                        "text",
                        "commentable_id",
                        "created_at"
                      ]
                    }
                  },
                  "required": ["data"]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "description": "The text of the comment.",
                        "example": "This is my comment."
                      }
                    },
                    "required": ["text"]
                  }
                }
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/statuses": {
      "get": {
        "summary": "List Statuses",
        "tags": ["Finalize Statuses"],
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Which page of statuses to get.",
            "example": 2
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "How many statuses to get per page.",
            "example": 5
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the agreement status record.",
                            "example": "77c1e48c-23c2-4958-9dcb-84f23d896512",
                            "readOnly": true
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the agreement status.",
                            "example": "Internal Review",
                            "readOnly": true
                          },
                          "description": {
                            "type": "string",
                            "description": "The description of the agreement status.",
                            "example": "This is where an agreement starts when an agreement is directly drafted from a third party paper template, an our-paper template or agreement is sent to Finalize.",
                            "readOnly": true
                          },
                          "internal_enum": {
                            "type": "string",
                            "description": "A unique string to identify the agreement status.",
                            "example": "internal_review",
                            "readOnly": true
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "internal_enum"
                        ]
                      }
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of items returned",
                      "example": 1
                    },
                    "_links": {
                      "type": "object",
                      "properties": {
                        "next": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the next page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/statuses?page=3&per_page=1"
                            }
                          }
                        },
                        "prev": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the previous page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/statuses?page=1&per_page=1"
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": ["total_count", "_links", "data"]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/me": {
      "get": {
        "summary": "Get User Information",
        "tags": ["Finalize System"],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "example": {
                  "whoami": "user@example.com",
                  "timestamp": "2022-06-14T14:49:10Z",
                  "status": "up"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/tasks": {
      "get": {
        "summary": "List Tasks",
        "tags": ["Finalize Tasks"],
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Which page of tasks to get.",
            "example": 2
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "How many tasks should be returned per page.",
            "example": 10
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "description": "Filter tasks by a specific attribute. Options are:</br>\n                    ```filter[name]``` - Returns only tasks with the specified name attribute. This can query name with partial match.</br>\n                    ```filter[active]``` - Returns either active or inactive tasks. Options are: `true` or `false`.</br>\n                    ```filter[status][]``` - Returns only tasks with the specified statuses. Options are: ```unreviewed```, ```approved```, ```rejected```</br>\n                    ```filter[agreement_id][]``` - Returns only tasks that belong to an agreement with the specified agreement UUIDs.</br>\n                    ```filter[author_id][]``` - Returns only tasks that have an author with the specified user UUIDs.</br>\n                    ```filter[assignee_ids][]``` - Returns only tasks assigned to the specified user UUIDs. Includes tasks with additional assignee UUIDs besides those specified.</br>\n                    NOTE: Query multiple ```agreement_id``` or ```author_id``` using syntax: ```?filter[agreement_id][]=4076215b-2476-467b-893d-1fe9fd9199d9&filter[agreement_id][]=93978d89-38a9-4d5f-b531-9468ff1ba9af```</br>"
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the task record.",
                            "readOnly": true
                          },
                          "active": {
                            "type": "boolean",
                            "description": "Denotes if the task is active or not.",
                            "example": "true",
                            "readOnly": true
                          },
                          "agreement_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the parent agreement. Will be null for stand-alone tasks.",
                            "readOnly": true,
                            "nullable": true
                          },
                          "approval_type": {
                            "type": "string",
                            "description": "The requirements of approval. Will be null for tasks of type GenericTask.",
                            "enum": ["latest_version", "text", "attachment"],
                            "nullable": true
                          },
                          "assignee_ids": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "description": "Array of the assignee User UUIDs.",
                            "readOnly": true
                          },
                          "attachment_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the attachment.",
                            "readOnly": true,
                            "nullable": true
                          },
                          "author_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the task author.",
                            "readOnly": true,
                            "nullable": true
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO 8601 datetime of when the task was created.",
                            "example": "2023-08-15T20:00:39Z",
                            "readOnly": true
                          },
                          "due_date": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO 8601 datetime of the task due date.",
                            "example": "2023-09-15T20:00:39Z",
                            "readOnly": true,
                            "nullable": true
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the task.",
                            "example": "Approve Deliverable",
                            "readOnly": true,
                            "nullable": true
                          },
                          "position": {
                            "type": "integer",
                            "description": "Denotes the order for \"ordered\" tasks in which tasks should be completed. Tasks of type StandaloneTask and GenericTask can have a null position.",
                            "example": "1",
                            "readOnly": true,
                            "nullable": true
                          },
                          "resolver_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the User that completed the task.",
                            "readOnly": true,
                            "nullable": true
                          },
                          "status": {
                            "type": "string",
                            "description": "Indicates the current status of a task.",
                            "enum": [
                              "unreviewed",
                              "approved",
                              "rejected(deprecated)"
                            ]
                          },
                          "text": {
                            "type": "string",
                            "description": "Information on completing the task.",
                            "example": "Please review the latest version and approve the agreement to complete this task",
                            "readOnly": true
                          },
                          "type": {
                            "type": "string",
                            "description": "Indicates the type of a task.",
                            "enum": [
                              "ApprovalTask",
                              "GenericTask",
                              "StandaloneTask"
                            ],
                            "readOnly": true
                          }
                        },
                        "_embedded": {
                          "users": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the user record.",
                                  "readOnly": true
                                },
                                "first_name": {
                                  "type": "string",
                                  "description": "The first name of the user.",
                                  "example": "Steve",
                                  "readOnly": true
                                },
                                "last_name": {
                                  "type": "string",
                                  "description": "The last name of the user.",
                                  "example": "Urkel",
                                  "readOnly": true
                                },
                                "email": {
                                  "type": "string",
                                  "description": "The email of the user.",
                                  "example": "surkel@linksquares.com",
                                  "readOnly": true
                                }
                              },
                              "required": [
                                "id",
                                "first_name",
                                "last_name",
                                "email"
                              ]
                            }
                          }
                        },
                        "required": [
                          "active",
                          "agreement_id",
                          "approval_type",
                          "assignee_ids",
                          "attachment_id",
                          "author_id",
                          "created_at",
                          "due_date",
                          "id",
                          "name",
                          "position",
                          "resolver_id",
                          "status",
                          "text",
                          "type"
                        ]
                      }
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of items returned",
                      "example": 1
                    },
                    "_links": {
                      "type": "object",
                      "properties": {
                        "next": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the next page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/tasks?page=3&per_page=1"
                            }
                          }
                        },
                        "prev": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the previous page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/tasks?page=1&per_page=1"
                            }
                          }
                        }
                      }
                    }
                  },
                  "_embedded": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the user record.",
                            "readOnly": true
                          },
                          "first_name": {
                            "type": "string",
                            "description": "The first name of the user.",
                            "example": "Steve",
                            "readOnly": true
                          },
                          "last_name": {
                            "type": "string",
                            "description": "The last name of the user.",
                            "example": "Urkel",
                            "readOnly": true
                          },
                          "email": {
                            "type": "string",
                            "description": "The email of the user.",
                            "example": "surkel@linksquares.com",
                            "readOnly": true
                          }
                        },
                        "required": ["id", "first_name", "last_name", "email"]
                      }
                    }
                  },
                  "required": ["total_count", "_links", "data"]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/tasks/{task_id}": {
      "get": {
        "summary": "Get Task",
        "tags": ["Finalize Tasks"],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The task id",
            "example": "6d3b27ba-0949-44e0-b207-105722610af5"
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "description": "When given the value 'embedded', the response will include subresource content",
            "example": "embedded",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the task record.",
                          "readOnly": true
                        },
                        "active": {
                          "type": "boolean",
                          "description": "Denotes if the task is active or not.",
                          "example": "true",
                          "readOnly": true
                        },
                        "agreement_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the parent agreement. Will be null for stand-alone tasks.",
                          "readOnly": true,
                          "nullable": true
                        },
                        "approval_type": {
                          "type": "string",
                          "description": "The requirements of approval. Will be null for tasks of type GenericTask.",
                          "enum": ["latest_version", "text", "attachment"],
                          "nullable": true
                        },
                        "assignee_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the assignee User UUIDs.",
                          "readOnly": true
                        },
                        "attachment_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the attachment.",
                          "readOnly": true,
                          "nullable": true
                        },
                        "author_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the task author.",
                          "readOnly": true,
                          "nullable": true
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the task was created.",
                          "example": "2023-08-15T20:00:39Z",
                          "readOnly": true
                        },
                        "due_date": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of the task due date.",
                          "example": "2023-09-15T20:00:39Z",
                          "readOnly": true,
                          "nullable": true
                        },
                        "name": {
                          "type": "string",
                          "description": "The name of the task.",
                          "example": "Approve Deliverable",
                          "readOnly": true,
                          "nullable": true
                        },
                        "position": {
                          "type": "integer",
                          "description": "Denotes the order for \"ordered\" tasks in which tasks should be completed. Tasks of type StandaloneTask and GenericTask can have a null position.",
                          "example": "1",
                          "readOnly": true,
                          "nullable": true
                        },
                        "resolver_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the User that completed the task.",
                          "readOnly": true,
                          "nullable": true
                        },
                        "status": {
                          "type": "string",
                          "description": "Indicates the current status of a task.",
                          "enum": [
                            "unreviewed",
                            "approved",
                            "rejected(deprecated)"
                          ]
                        },
                        "text": {
                          "type": "string",
                          "description": "Information on completing the task.",
                          "example": "Please review the latest version and approve the agreement to complete this task",
                          "readOnly": true
                        },
                        "type": {
                          "type": "string",
                          "description": "Indicates the type of a task.",
                          "enum": [
                            "ApprovalTask",
                            "GenericTask",
                            "StandaloneTask"
                          ],
                          "readOnly": true
                        }
                      },
                      "_embedded": {
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the user record.",
                                "readOnly": true
                              },
                              "first_name": {
                                "type": "string",
                                "description": "The first name of the user.",
                                "example": "Steve",
                                "readOnly": true
                              },
                              "last_name": {
                                "type": "string",
                                "description": "The last name of the user.",
                                "example": "Urkel",
                                "readOnly": true
                              },
                              "email": {
                                "type": "string",
                                "description": "The email of the user.",
                                "example": "surkel@linksquares.com",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "first_name",
                              "last_name",
                              "email"
                            ]
                          }
                        }
                      },
                      "required": [
                        "active",
                        "agreement_id",
                        "approval_type",
                        "assignee_ids",
                        "attachment_id",
                        "author_id",
                        "created_at",
                        "due_date",
                        "id",
                        "name",
                        "position",
                        "resolver_id",
                        "status",
                        "text",
                        "type"
                      ]
                    },
                    "_embedded": {
                      "properties": {
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the user record.",
                                "readOnly": true
                              },
                              "first_name": {
                                "type": "string",
                                "description": "The first name of the user.",
                                "example": "Steve",
                                "readOnly": true
                              },
                              "last_name": {
                                "type": "string",
                                "description": "The last name of the user.",
                                "example": "Urkel",
                                "readOnly": true
                              },
                              "email": {
                                "type": "string",
                                "description": "The email of the user.",
                                "example": "surkel@linksquares.com",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "first_name",
                              "last_name",
                              "email"
                            ]
                          }
                        }
                      },
                      "type": "object",
                      "description": "Includes the full sub-resource objects. Only present if ?include=embedded query parameter is supplied",
                      "required": ["users"]
                    }
                  },
                  "_embedded": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the user record.",
                            "readOnly": true
                          },
                          "first_name": {
                            "type": "string",
                            "description": "The first name of the user.",
                            "example": "Steve",
                            "readOnly": true
                          },
                          "last_name": {
                            "type": "string",
                            "description": "The last name of the user.",
                            "example": "Urkel",
                            "readOnly": true
                          },
                          "email": {
                            "type": "string",
                            "description": "The email of the user.",
                            "example": "surkel@linksquares.com",
                            "readOnly": true
                          }
                        },
                        "required": ["id", "first_name", "last_name", "email"]
                      }
                    }
                  },
                  "required": ["_embedded", "data"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Approve Task",
        "tags": ["Finalize Tasks"],
        "parameters": [
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "format": "uuid",
            "description": "The task UUID.",
            "example": "69327aa7-db27-488a-af22-855f19324286",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the task record.",
                          "readOnly": true
                        },
                        "active": {
                          "type": "boolean",
                          "description": "Denotes if the task is active or not.",
                          "example": "true",
                          "readOnly": true
                        },
                        "agreement_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the parent agreement. Will be null for stand-alone tasks.",
                          "readOnly": true,
                          "nullable": true
                        },
                        "approval_type": {
                          "type": "string",
                          "description": "The requirements of approval. Will be null for tasks of type GenericTask.",
                          "enum": ["latest_version", "text", "attachment"],
                          "nullable": true
                        },
                        "assignee_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "description": "Array of the assignee User UUIDs.",
                          "readOnly": true
                        },
                        "attachment_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the attachment.",
                          "readOnly": true,
                          "nullable": true
                        },
                        "author_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the task author.",
                          "readOnly": true,
                          "nullable": true
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the task was created.",
                          "example": "2023-08-15T20:00:39Z",
                          "readOnly": true
                        },
                        "due_date": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of the task due date.",
                          "example": "2023-09-15T20:00:39Z",
                          "readOnly": true,
                          "nullable": true
                        },
                        "name": {
                          "type": "string",
                          "description": "The name of the task.",
                          "example": "Approve Deliverable",
                          "readOnly": true,
                          "nullable": true
                        },
                        "position": {
                          "type": "integer",
                          "description": "Denotes the order for \"ordered\" tasks in which tasks should be completed. Tasks of type StandaloneTask and GenericTask can have a null position.",
                          "example": "1",
                          "readOnly": true,
                          "nullable": true
                        },
                        "resolver_id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the User that completed the task.",
                          "readOnly": true,
                          "nullable": true
                        },
                        "status": {
                          "type": "string",
                          "description": "Indicates the current status of a task.",
                          "enum": [
                            "unreviewed",
                            "approved",
                            "rejected(deprecated)"
                          ]
                        },
                        "text": {
                          "type": "string",
                          "description": "Information on completing the task.",
                          "example": "Please review the latest version and approve the agreement to complete this task",
                          "readOnly": true
                        },
                        "type": {
                          "type": "string",
                          "description": "Indicates the type of a task.",
                          "enum": [
                            "ApprovalTask",
                            "GenericTask",
                            "StandaloneTask"
                          ],
                          "readOnly": true
                        }
                      },
                      "_embedded": {
                        "users": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the user record.",
                                "readOnly": true
                              },
                              "first_name": {
                                "type": "string",
                                "description": "The first name of the user.",
                                "example": "Steve",
                                "readOnly": true
                              },
                              "last_name": {
                                "type": "string",
                                "description": "The last name of the user.",
                                "example": "Urkel",
                                "readOnly": true
                              },
                              "email": {
                                "type": "string",
                                "description": "The email of the user.",
                                "example": "surkel@linksquares.com",
                                "readOnly": true
                              }
                            },
                            "required": [
                              "id",
                              "first_name",
                              "last_name",
                              "email"
                            ]
                          }
                        }
                      },
                      "required": [
                        "active",
                        "agreement_id",
                        "approval_type",
                        "assignee_ids",
                        "attachment_id",
                        "author_id",
                        "created_at",
                        "due_date",
                        "id",
                        "name",
                        "position",
                        "resolver_id",
                        "status",
                        "text",
                        "type"
                      ]
                    }
                  },
                  "_embedded": {
                    "users": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the user record.",
                            "readOnly": true
                          },
                          "first_name": {
                            "type": "string",
                            "description": "The first name of the user.",
                            "example": "Steve",
                            "readOnly": true
                          },
                          "last_name": {
                            "type": "string",
                            "description": "The last name of the user.",
                            "example": "Urkel",
                            "readOnly": true
                          },
                          "email": {
                            "type": "string",
                            "description": "The email of the user.",
                            "example": "surkel@linksquares.com",
                            "readOnly": true
                          }
                        },
                        "required": ["id", "first_name", "last_name", "email"]
                      }
                    }
                  },
                  "required": ["data"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string",
                        "enum": ["approved"],
                        "description": "The status you want to transition the Task to."
                      }
                    },
                    "required": ["status"]
                  }
                },
                "required": ["data"]
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/templates": {
      "get": {
        "summary": "List Templates",
        "tags": ["Finalize Templates"],
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Which page of templates to get.",
            "example": 2
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "How many templates should be returned per page.",
            "example": 10
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "description": "Filter templates by a specific attribute. Options are:</br>\n                    ```filter[created_at][before]``` - Returns only templates created before this date. Must be in ISO8601 format.</br>\n                    ```filter[created_at][after]``` - Returns only templates created after this date. Must be in ISO8601 format.</br>\n                    ```filter[name]``` - Returns only templates with the specified name attribute. This can query name with partial match.</br>\n                    ```filter[kind]``` - Returns only templates with the specified kind attribute. __Must be draft, intake or request_form__.</br></br>\n                    NOTE: Query multiple ```kind``` using syntax: ```?filter[kind][]=intake&filter[kind][]=draft```</br>"
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the template record.",
                            "readOnly": true,
                            "example": "99fd96ed-2c61-4066-b800-c34850146ea9"
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the template.",
                            "example": "Security Addendum"
                          },
                          "description": {
                            "type": "string",
                            "description": "The description of the template.",
                            "example": "Security terms for vendors"
                          },
                          "kind": {
                            "type": "string",
                            "enum": ["draft", "intake", "request_form"],
                            "description": "The kind of the template.",
                            "readOnly": true,
                            "example": "draft"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO 8601 datetime of when the template was created.",
                            "readOnly": true
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time",
                            "description": "The ISO 8601 datetime of when the template was updated.",
                            "readOnly": true
                          }
                        },
                        "_embedded": {
                          "tokens": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the template token record.",
                                  "readOnly": true
                                },
                                "kind": {
                                  "type": "string",
                                  "enum": [
                                    "text_field",
                                    "text_area",
                                    "date",
                                    "clause",
                                    "multi_select",
                                    "single_selection",
                                    "external_list"
                                  ],
                                  "description": "The kind of template token.",
                                  "example": "single_selection"
                                },
                                "question": {
                                  "type": "string",
                                  "description": "The template token question.",
                                  "example": "What is the single selection token?"
                                },
                                "required": {
                                  "type": "boolean",
                                  "description": "Indicates whether the template token is required."
                                },
                                "clause_category_id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The clause category UUID for the template token.",
                                  "nullable": true
                                },
                                "clause_category_name": {
                                  "type": "string",
                                  "description": "The clause category name for the template token.",
                                  "example": "Governing Law",
                                  "nullable": true
                                },
                                "options": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string",
                                        "format": "uuid",
                                        "description": "The UUID of the token option record."
                                      },
                                      "value": {
                                        "type": "string",
                                        "description": "The value of the token option record.",
                                        "example": "Option 1"
                                      }
                                    }
                                  }
                                }
                              },
                              "required": [
                                "id",
                                "kind",
                                "question",
                                "required",
                                "clause_category_id",
                                "clause_category_name",
                                "options"
                              ]
                            }
                          },
                          "questions": {
                            "type": "array",
                            "items": {
                              "oneOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the template question record.",
                                      "readOnly": true
                                    },
                                    "description": {
                                      "type": "string",
                                      "nullable": true,
                                      "description": "The description of the template question record.",
                                      "example": "What is question one?"
                                    },
                                    "required": {
                                      "type": "boolean",
                                      "description": "Indicates whether the the template question is required."
                                    },
                                    "answer_type": {
                                      "type": "string",
                                      "enum": [
                                        "text",
                                        "paragraph",
                                        "date",
                                        "numbers",
                                        "multiple_selection",
                                        "single_selection",
                                        "file",
                                        "url"
                                      ],
                                      "description": "The answer type of the question.",
                                      "example": "text"
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "description",
                                    "required",
                                    "answer_type"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the template question record.",
                                      "readOnly": true
                                    },
                                    "description": {
                                      "type": "string",
                                      "nullable": true,
                                      "description": "The description of the template question record.",
                                      "example": "What is question two?"
                                    },
                                    "required": {
                                      "type": "boolean",
                                      "description": "Indicates whether the the template question is required.",
                                      "example": false
                                    },
                                    "answer_type": {
                                      "type": "string",
                                      "enum": [
                                        "text",
                                        "paragraph",
                                        "date",
                                        "numbers",
                                        "multiple_selection",
                                        "single_selection",
                                        "file",
                                        "url"
                                      ],
                                      "description": "The answer type of the question.",
                                      "example": "single_selection"
                                    },
                                    "answer_options": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "id": {
                                            "type": "string",
                                            "format": "uuid",
                                            "description": "The UUID of the question answer_option record.",
                                            "readOnly": true
                                          },
                                          "description": {
                                            "type": "string",
                                            "description": "The description of the question answer_option record.",
                                            "example": "Yes"
                                          }
                                        },
                                        "required": ["id", "description"]
                                      },
                                      "description": "List of possible answer options for the question."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "description",
                                    "required",
                                    "answer_type",
                                    "answer_options"
                                  ]
                                },
                                {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the template question record.",
                                      "readOnly": true
                                    },
                                    "description": {
                                      "type": "string",
                                      "nullable": true,
                                      "description": "The description of the template question record.",
                                      "example": "What is question three?"
                                    },
                                    "required": {
                                      "type": "boolean",
                                      "description": "Indicates whether the the template question is required."
                                    },
                                    "answer_type": {
                                      "type": "string",
                                      "enum": [
                                        "text",
                                        "paragraph",
                                        "date",
                                        "numbers",
                                        "multiple_selection",
                                        "single_selection",
                                        "file",
                                        "url"
                                      ],
                                      "description": "The answer type of the question.",
                                      "example": "file"
                                    },
                                    "attachment_ids": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "format": "uuid"
                                      },
                                      "description": "List of template question attachment UUIDs."
                                    }
                                  },
                                  "required": [
                                    "id",
                                    "description",
                                    "required",
                                    "answer_type",
                                    "attachment_ids"
                                  ]
                                }
                              ]
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "description",
                          "created_at",
                          "updated_at",
                          "kind"
                        ],
                        "single_only": [
                          "question_ids",
                          "token_ids",
                          "instructions"
                        ]
                      }
                    },
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of items returned",
                      "example": 1
                    },
                    "_links": {
                      "type": "object",
                      "properties": {
                        "next": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the next page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/templates?page=3&per_page=1"
                            }
                          }
                        },
                        "prev": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the previous page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/templates?page=1&per_page=1"
                            }
                          }
                        }
                      }
                    }
                  },
                  "_embedded": {
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the template token record.",
                            "readOnly": true
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "text_field",
                              "text_area",
                              "date",
                              "clause",
                              "multi_select",
                              "single_selection",
                              "external_list"
                            ],
                            "description": "The kind of template token.",
                            "example": "single_selection"
                          },
                          "question": {
                            "type": "string",
                            "description": "The template token question.",
                            "example": "What is the single selection token?"
                          },
                          "required": {
                            "type": "boolean",
                            "description": "Indicates whether the template token is required."
                          },
                          "clause_category_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The clause category UUID for the template token.",
                            "nullable": true
                          },
                          "clause_category_name": {
                            "type": "string",
                            "description": "The clause category name for the template token.",
                            "example": "Governing Law",
                            "nullable": true
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the token option record."
                                },
                                "value": {
                                  "type": "string",
                                  "description": "The value of the token option record.",
                                  "example": "Option 1"
                                }
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "question",
                          "required",
                          "clause_category_id",
                          "clause_category_name",
                          "options"
                        ]
                      }
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the template question record.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "nullable": true,
                                "description": "The description of the template question record.",
                                "example": "What is question one?"
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Indicates whether the the template question is required."
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "example": "text"
                              }
                            },
                            "required": [
                              "id",
                              "description",
                              "required",
                              "answer_type"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the template question record.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "nullable": true,
                                "description": "The description of the template question record.",
                                "example": "What is question two?"
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Indicates whether the the template question is required.",
                                "example": false
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "example": "single_selection"
                              },
                              "answer_options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the question answer_option record.",
                                      "readOnly": true
                                    },
                                    "description": {
                                      "type": "string",
                                      "description": "The description of the question answer_option record.",
                                      "example": "Yes"
                                    }
                                  },
                                  "required": ["id", "description"]
                                },
                                "description": "List of possible answer options for the question."
                              }
                            },
                            "required": [
                              "id",
                              "description",
                              "required",
                              "answer_type",
                              "answer_options"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the template question record.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "nullable": true,
                                "description": "The description of the template question record.",
                                "example": "What is question three?"
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Indicates whether the the template question is required."
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "example": "file"
                              },
                              "attachment_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": "List of template question attachment UUIDs."
                              }
                            },
                            "required": [
                              "id",
                              "description",
                              "required",
                              "answer_type",
                              "attachment_ids"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "required": ["total_count", "_links", "data"],
                  "single_only": ["question_ids", "token_ids", "instructions"]
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/templates/{template_id}/questions/{question_id}/attachments/{attachment_id}/file": {
      "get": {
        "summary": "Download Template Attachment",
        "tags": ["Finalize Attachments"],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The template UUID"
          },
          {
            "name": "question_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The template question UUID"
          },
          {
            "name": "attachment_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The attachment UUID"
          }
        ],
        "responses": {
          "302": {
            "description": "success",
            "headers": {
              "location": {
                "schema": {
                  "type": "string",
                  "format": "uri"
                },
                "description": "Presigned download URL for the attachment file."
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/finalize/v2/templates/{template_id}": {
      "get": {
        "summary": "Get Template",
        "tags": ["Finalize Templates"],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The UUID of the template."
          },
          {
            "name": "include",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "When given the value 'embedded', the response will include subresource content.",
            "example": "embedded"
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "format": "uuid",
                          "description": "The UUID of the template record.",
                          "readOnly": true,
                          "example": "99fd96ed-2c61-4066-b800-c34850146ea9"
                        },
                        "name": {
                          "type": "string",
                          "description": "The name of the template.",
                          "example": "Security Addendum"
                        },
                        "description": {
                          "type": "string",
                          "description": "The description of the template.",
                          "example": "Security terms for vendors"
                        },
                        "kind": {
                          "type": "string",
                          "enum": ["draft", "intake", "request_form"],
                          "description": "The kind of the template.",
                          "readOnly": true,
                          "example": "draft"
                        },
                        "instructions": {
                          "type": "string",
                          "nullable": true,
                          "description": "Instructions for the template.",
                          "example": "Some instructions with link"
                        },
                        "created_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the template was created.",
                          "readOnly": true
                        },
                        "updated_at": {
                          "type": "string",
                          "format": "date-time",
                          "description": "The ISO 8601 datetime of when the template was updated.",
                          "readOnly": true
                        },
                        "token_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "question_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      },
                      "_embedded": {
                        "tokens": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the template token record.",
                                "readOnly": true
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "text_field",
                                  "text_area",
                                  "date",
                                  "clause",
                                  "multi_select",
                                  "single_selection",
                                  "external_list"
                                ],
                                "description": "The kind of template token.",
                                "example": "single_selection"
                              },
                              "question": {
                                "type": "string",
                                "description": "The template token question.",
                                "example": "What is the single selection token?"
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Indicates whether the template token is required."
                              },
                              "clause_category_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The clause category UUID for the template token.",
                                "nullable": true
                              },
                              "clause_category_name": {
                                "type": "string",
                                "description": "The clause category name for the template token.",
                                "example": "Governing Law",
                                "nullable": true
                              },
                              "options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the token option record."
                                    },
                                    "value": {
                                      "type": "string",
                                      "description": "The value of the token option record.",
                                      "example": "Option 1"
                                    }
                                  }
                                }
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "question",
                              "required",
                              "clause_category_id",
                              "clause_category_name",
                              "options"
                            ]
                          }
                        },
                        "questions": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the template question record.",
                                    "readOnly": true
                                  },
                                  "description": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The description of the template question record.",
                                    "example": "What is question one?"
                                  },
                                  "required": {
                                    "type": "boolean",
                                    "description": "Indicates whether the the template question is required."
                                  },
                                  "answer_type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "paragraph",
                                      "date",
                                      "numbers",
                                      "multiple_selection",
                                      "single_selection",
                                      "file",
                                      "url"
                                    ],
                                    "description": "The answer type of the question.",
                                    "example": "text"
                                  }
                                },
                                "required": [
                                  "id",
                                  "description",
                                  "required",
                                  "answer_type"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the template question record.",
                                    "readOnly": true
                                  },
                                  "description": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The description of the template question record.",
                                    "example": "What is question two?"
                                  },
                                  "required": {
                                    "type": "boolean",
                                    "description": "Indicates whether the the template question is required.",
                                    "example": false
                                  },
                                  "answer_type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "paragraph",
                                      "date",
                                      "numbers",
                                      "multiple_selection",
                                      "single_selection",
                                      "file",
                                      "url"
                                    ],
                                    "description": "The answer type of the question.",
                                    "example": "single_selection"
                                  },
                                  "answer_options": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "format": "uuid",
                                          "description": "The UUID of the question answer_option record.",
                                          "readOnly": true
                                        },
                                        "description": {
                                          "type": "string",
                                          "description": "The description of the question answer_option record.",
                                          "example": "Yes"
                                        }
                                      },
                                      "required": ["id", "description"]
                                    },
                                    "description": "List of possible answer options for the question."
                                  }
                                },
                                "required": [
                                  "id",
                                  "description",
                                  "required",
                                  "answer_type",
                                  "answer_options"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the template question record.",
                                    "readOnly": true
                                  },
                                  "description": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The description of the template question record.",
                                    "example": "What is question three?"
                                  },
                                  "required": {
                                    "type": "boolean",
                                    "description": "Indicates whether the the template question is required."
                                  },
                                  "answer_type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "paragraph",
                                      "date",
                                      "numbers",
                                      "multiple_selection",
                                      "single_selection",
                                      "file",
                                      "url"
                                    ],
                                    "description": "The answer type of the question.",
                                    "example": "file"
                                  },
                                  "attachment_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": "List of template question attachment UUIDs."
                                  }
                                },
                                "required": [
                                  "id",
                                  "description",
                                  "required",
                                  "answer_type",
                                  "attachment_ids"
                                ]
                              }
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "description",
                        "created_at",
                        "updated_at",
                        "kind",
                        "instructions",
                        "token_ids",
                        "question_ids"
                      ],
                      "single_only": [
                        "question_ids",
                        "token_ids",
                        "instructions"
                      ]
                    },
                    "_embedded": {
                      "properties": {
                        "tokens": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the template token record.",
                                "readOnly": true
                              },
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "text_field",
                                  "text_area",
                                  "date",
                                  "clause",
                                  "multi_select",
                                  "single_selection",
                                  "external_list"
                                ],
                                "description": "The kind of template token.",
                                "example": "single_selection"
                              },
                              "question": {
                                "type": "string",
                                "description": "The template token question.",
                                "example": "What is the single selection token?"
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Indicates whether the template token is required."
                              },
                              "clause_category_id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The clause category UUID for the template token.",
                                "nullable": true
                              },
                              "clause_category_name": {
                                "type": "string",
                                "description": "The clause category name for the template token.",
                                "example": "Governing Law",
                                "nullable": true
                              },
                              "options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the token option record."
                                    },
                                    "value": {
                                      "type": "string",
                                      "description": "The value of the token option record.",
                                      "example": "Option 1"
                                    }
                                  }
                                }
                              }
                            },
                            "required": [
                              "id",
                              "kind",
                              "question",
                              "required",
                              "clause_category_id",
                              "clause_category_name",
                              "options"
                            ]
                          }
                        },
                        "questions": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the template question record.",
                                    "readOnly": true
                                  },
                                  "description": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The description of the template question record.",
                                    "example": "What is question one?"
                                  },
                                  "required": {
                                    "type": "boolean",
                                    "description": "Indicates whether the the template question is required."
                                  },
                                  "answer_type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "paragraph",
                                      "date",
                                      "numbers",
                                      "multiple_selection",
                                      "single_selection",
                                      "file",
                                      "url"
                                    ],
                                    "description": "The answer type of the question.",
                                    "example": "text"
                                  }
                                },
                                "required": [
                                  "id",
                                  "description",
                                  "required",
                                  "answer_type"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the template question record.",
                                    "readOnly": true
                                  },
                                  "description": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The description of the template question record.",
                                    "example": "What is question two?"
                                  },
                                  "required": {
                                    "type": "boolean",
                                    "description": "Indicates whether the the template question is required.",
                                    "example": false
                                  },
                                  "answer_type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "paragraph",
                                      "date",
                                      "numbers",
                                      "multiple_selection",
                                      "single_selection",
                                      "file",
                                      "url"
                                    ],
                                    "description": "The answer type of the question.",
                                    "example": "single_selection"
                                  },
                                  "answer_options": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "id": {
                                          "type": "string",
                                          "format": "uuid",
                                          "description": "The UUID of the question answer_option record.",
                                          "readOnly": true
                                        },
                                        "description": {
                                          "type": "string",
                                          "description": "The description of the question answer_option record.",
                                          "example": "Yes"
                                        }
                                      },
                                      "required": ["id", "description"]
                                    },
                                    "description": "List of possible answer options for the question."
                                  }
                                },
                                "required": [
                                  "id",
                                  "description",
                                  "required",
                                  "answer_type",
                                  "answer_options"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "description": "The UUID of the template question record.",
                                    "readOnly": true
                                  },
                                  "description": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "The description of the template question record.",
                                    "example": "What is question three?"
                                  },
                                  "required": {
                                    "type": "boolean",
                                    "description": "Indicates whether the the template question is required."
                                  },
                                  "answer_type": {
                                    "type": "string",
                                    "enum": [
                                      "text",
                                      "paragraph",
                                      "date",
                                      "numbers",
                                      "multiple_selection",
                                      "single_selection",
                                      "file",
                                      "url"
                                    ],
                                    "description": "The answer type of the question.",
                                    "example": "file"
                                  },
                                  "attachment_ids": {
                                    "type": "array",
                                    "items": {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    "description": "List of template question attachment UUIDs."
                                  }
                                },
                                "required": [
                                  "id",
                                  "description",
                                  "required",
                                  "answer_type",
                                  "attachment_ids"
                                ]
                              }
                            ]
                          }
                        }
                      },
                      "type": "object",
                      "description": "Includes the full sub-resource objects. Only present if ?include=embedded query parameter is supplied",
                      "required": ["tokens", "questions"]
                    }
                  },
                  "_embedded": {
                    "tokens": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The UUID of the template token record.",
                            "readOnly": true
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "text_field",
                              "text_area",
                              "date",
                              "clause",
                              "multi_select",
                              "single_selection",
                              "external_list"
                            ],
                            "description": "The kind of template token.",
                            "example": "single_selection"
                          },
                          "question": {
                            "type": "string",
                            "description": "The template token question.",
                            "example": "What is the single selection token?"
                          },
                          "required": {
                            "type": "boolean",
                            "description": "Indicates whether the template token is required."
                          },
                          "clause_category_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "The clause category UUID for the template token.",
                            "nullable": true
                          },
                          "clause_category_name": {
                            "type": "string",
                            "description": "The clause category name for the template token.",
                            "example": "Governing Law",
                            "nullable": true
                          },
                          "options": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "The UUID of the token option record."
                                },
                                "value": {
                                  "type": "string",
                                  "description": "The value of the token option record.",
                                  "example": "Option 1"
                                }
                              }
                            }
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "question",
                          "required",
                          "clause_category_id",
                          "clause_category_name",
                          "options"
                        ]
                      }
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the template question record.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "nullable": true,
                                "description": "The description of the template question record.",
                                "example": "What is question one?"
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Indicates whether the the template question is required."
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "example": "text"
                              }
                            },
                            "required": [
                              "id",
                              "description",
                              "required",
                              "answer_type"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the template question record.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "nullable": true,
                                "description": "The description of the template question record.",
                                "example": "What is question two?"
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Indicates whether the the template question is required.",
                                "example": false
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "example": "single_selection"
                              },
                              "answer_options": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string",
                                      "format": "uuid",
                                      "description": "The UUID of the question answer_option record.",
                                      "readOnly": true
                                    },
                                    "description": {
                                      "type": "string",
                                      "description": "The description of the question answer_option record.",
                                      "example": "Yes"
                                    }
                                  },
                                  "required": ["id", "description"]
                                },
                                "description": "List of possible answer options for the question."
                              }
                            },
                            "required": [
                              "id",
                              "description",
                              "required",
                              "answer_type",
                              "answer_options"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "The UUID of the template question record.",
                                "readOnly": true
                              },
                              "description": {
                                "type": "string",
                                "nullable": true,
                                "description": "The description of the template question record.",
                                "example": "What is question three?"
                              },
                              "required": {
                                "type": "boolean",
                                "description": "Indicates whether the the template question is required."
                              },
                              "answer_type": {
                                "type": "string",
                                "enum": [
                                  "text",
                                  "paragraph",
                                  "date",
                                  "numbers",
                                  "multiple_selection",
                                  "single_selection",
                                  "file",
                                  "url"
                                ],
                                "description": "The answer type of the question.",
                                "example": "file"
                              },
                              "attachment_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "description": "List of template question attachment UUIDs."
                              }
                            },
                            "required": [
                              "id",
                              "description",
                              "required",
                              "answer_type",
                              "attachment_ids"
                            ]
                          }
                        ]
                      }
                    }
                  },
                  "required": ["_embedded", "data"],
                  "single_only": ["question_ids", "token_ids", "instructions"]
                }
              }
            }
          },
          "404": {
            "description": "not_found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    }
                  },
                  "required": ["message"],
                  "example": {
                    "message": "Not Found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "unprocessable_entity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "description": "A message describing the error."
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string",
                            "description": "Name of the top level field that caused the error."
                          },
                          "field_path": {
                            "type": "string",
                            "description": "The JSON query path of the specific field that caused the error. Omits the 'data' field when applicable."
                          },
                          "message": {
                            "type": "string",
                            "description": "A message describing the error."
                          }
                        },
                        "required": ["field_name", "message"]
                      }
                    }
                  },
                  "required": ["message", "errors"],
                  "example": {
                    "message": "Validation Failed",
                    "errors": [
                      {
                        "field_name": "template_id",
                        "message": "template_id is missing"
                      },
                      {
                        "field_name": "tokens",
                        "field_path": "tokens[1].selected",
                        "message": "Invalid options selected"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/agreements/{id}/attachments": {
      "post": {
        "summary": "Create Attachment: Create Upload URL",
        "tags": ["Analyze Attachments"],
        "description": "Returns an AWS S3 URL upon success for subsequent file uploads. On a successful response, execute a PUT request to the AWS S3 URL with the file.\n\nKnowledge Base Example: https://help.linksquares.com/hc/en-us/articles/10849398433559-Analyze-API-Sample-Use-Cases#01H7AP6S3SDSWKYEZPT4JCS1KZ\n\nAWS Documentation: https://docs.aws.amazon.com/AmazonS3/latest/userguide/PresignedUrlUploadObject.html\n",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "example": {
                  "attachment_upload_url": "https://www.linksquares.com/example-upload-url"
                },
                "schema": {
                  "type": "object",
                  "required": ["attachment_upload_url"],
                  "properties": {
                    "attachment_upload_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "could not create agreement attachment",
            "content": {
              "application/json": {
                "example": {
                  "message": "file_name must have an extension matching .csv, .doc, .docx, .pdf, .txt, .xls, .xlsx or .asice",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "agreement not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Agreement Not Found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "500": {
            "description": "could not create s3 url",
            "content": {
              "application/json": {
                "example": {
                  "message": "Internal Server Error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file_name": {
                    "type": "string"
                  }
                },
                "required": ["file_name"]
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/agreements/{id}/tags": {
      "get": {
        "summary": "List Agreement Tags",
        "tags": ["Analyze Agreements"],
        "description": "Retrieve all tags assigned to a specific agreement in Analyze.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Specify agreement type name to filter results [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Specify the field to sort by [name]. Prepend `-` for descending [-name]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Specify cursor from previous response to get next page of data",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Specify page size of results, between 1 and 100",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful without params",
            "content": {
              "application/json": {
                "example": {
                  "page_size": 100,
                  "count": 3,
                  "next_cursor": null,
                  "tags": [
                    {
                      "id": "ca4100ee-56b7-11f0-8b2c-6f053525352d",
                      "name": "blue tag",
                      "is_smart": false
                    },
                    {
                      "id": "ca43cdf6-56b7-11f0-8b2c-5f906addfca6",
                      "name": "green tag",
                      "is_smart": false
                    },
                    {
                      "id": "ca4674f2-56b7-11f0-8b2c-270044d5131b",
                      "name": "yellow tag",
                      "is_smart": false
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "page_size": {
                      "type": "integer",
                      "description": "The number of results displayed",
                      "example": 100
                    },
                    "count": {
                      "type": "integer",
                      "description": "Total number of results found",
                      "example": 100
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true,
                      "format": "uuid",
                      "description": "The string that must be passed to the cursor parameter to get the next page of results",
                      "readOnly": true
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "UUID of the tag",
                            "example": "ec140d32-5a97-41c1-b9f5-0f358b5978be"
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the tag",
                            "example": "Blue"
                          },
                          "is_smart": {
                            "type": "boolean",
                            "description": "Indicates if the tag is a Smart Tag (true) or a manual tag (false)",
                            "example": false
                          }
                        }
                      }
                    }
                  },
                  "required": ["page_size", "count", "next_cursor", "tags"]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "cursor is invalid",
            "content": {
              "application/json": {
                "example": {
                  "message": "cursor is in invalid format",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/agreements/{id}/terms": {
      "get": {
        "summary": "List Agreement Terms Data",
        "tags": ["Analyze Agreements"],
        "description": "Retrieve all term data associated with a specific agreement in Analyze.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Specify agreement type name to filter results [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Specify the field to sort by [name]. Prepend `-` for descending [-name]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Specify cursor from previous response to get next page of data",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Specify page size of results, between 1 and 100",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful without params",
            "content": {
              "application/json": {
                "example": {
                  "page_size": 100,
                  "count": 4,
                  "next_cursor": null,
                  "terms": [
                    {
                      "id": "d31f3d02-56b7-11f0-8b2c-57529b7f5535",
                      "name": "abc",
                      "value": "a",
                      "kind": "string",
                      "status": "User-Defined"
                    },
                    {
                      "id": "d3254d0a-56b7-11f0-8b2c-7fd71904748d",
                      "name": "bcd",
                      "value": null,
                      "kind": "list",
                      "status": "User-Defined"
                    },
                    {
                      "id": "d328a392-56b7-11f0-8b2c-9b129c868497",
                      "name": "cde",
                      "value": "c",
                      "kind": "string",
                      "status": "User-Defined"
                    },
                    {
                      "id": "d32e1912-56b7-11f0-8b2c-478b20d7cd76",
                      "name": "def",
                      "value": "d",
                      "kind": "string",
                      "status": "User-Defined"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "page_size": {
                      "type": "integer",
                      "description": "The number of results displayed",
                      "example": 100
                    },
                    "count": {
                      "type": "integer",
                      "description": "Total number of results found",
                      "example": 100
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true,
                      "format": "uuid",
                      "description": "The string that must be passed to the cursor parameter to get the next page of results",
                      "readOnly": true
                    },
                    "terms": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "UUID of the term",
                            "example": "5d8f60b3-72b0-4495-9a65-e16c45784740"
                          },
                          "name": {
                            "type": "string",
                            "description": "The name of the term",
                            "example": "Effective Date"
                          },
                          "value": {
                            "type": "string",
                            "description": "The value of the term",
                            "example": "2022-12-25",
                            "nullable": true
                          },
                          "kind": {
                            "type": "string",
                            "description": "The kind of the term",
                            "example": "Date"
                          },
                          "status": {
                            "type": "string",
                            "description": "The status of the term",
                            "example": "User-Defined"
                          }
                        }
                      }
                    }
                  },
                  "required": ["page_size", "count", "next_cursor", "terms"]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "cursor is invalid",
            "content": {
              "application/json": {
                "example": {
                  "message": "cursor is in invalid format",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/agreements/{id}/terms/{term_id}": {
      "get": {
        "summary": "Get Agreement Term Data",
        "tags": ["Analyze Agreements"],
        "description": "Retrieve specific term data associated with an agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "term_id",
            "in": "path",
            "description": "term id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "example": {
                  "id": "dd167848-56b7-11f0-8b2c-ab5c2a62e004",
                  "name": "abc",
                  "value": 123,
                  "kind": "string",
                  "status": "User-Defined"
                },
                "schema": {
                  "type": "object",
                  "required": ["id", "name", "kind", "status"],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "value": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    },
                    "kind": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "term not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/agreements/{id}": {
      "get": {
        "summary": "Get Agreement",
        "tags": ["Analyze Agreements"],
        "description": "Retrieve metadata for a specific agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "example": {
                  "id": "e0dfbe58-56b7-11f0-8b2c-77dd76072083",
                  "parent_agreement_id": "e0ba425e-56b7-11f0-8b2c-5b9149096445",
                  "finalize_agreement_id": "3bc58c29-04b5-470b-9044-1d4dabb229cb",
                  "name": "Agreement1",
                  "original_name": "original 1",
                  "enqueued_at": "2025-07-29T12:41:17.776-04:00",
                  "updated_date": "2025-07-01T16:13:40.022-04:00",
                  "upload_date": "2025-07-01T16:13:40.022-04:00",
                  "uploaded_by": "Ming Veum",
                  "type": {
                    "id": "e06f3f34-56b7-11f0-8b2c-7f85737f53dc",
                    "name": "Master Agreement"
                  },
                  "tags": [
                    {
                      "id": "e0891c7e-56b7-11f0-8b2c-4f58017773e1",
                      "name": "green"
                    },
                    {
                      "id": "e08be51c-56b7-11f0-8b2c-7f1e6cb93de6",
                      "name": "yellow"
                    }
                  ],
                  "terms": [
                    {
                      "id": "e0ea1024-56b7-11f0-8b2c-735e04d24e0c",
                      "value": "test term value",
                      "name": "stt_1",
                      "kind": "string",
                      "status": "AI Inconclusive"
                    },
                    {
                      "id": "e0f3cbc8-56b7-11f0-8b2c-6377d6ae9795",
                      "value": "test term value 2",
                      "name": "stt_2",
                      "kind": "string",
                      "status": "AI Not Present"
                    }
                  ],
                  "child_agreements": [
                    {
                      "id": "e17a6d86-56b7-11f0-8b2c-db62980b0ed5"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "original_name",
                    "name",
                    "type",
                    "terms",
                    "tags",
                    "uploaded_by",
                    "upload_date",
                    "updated_date",
                    "parent_agreement_id",
                    "finalize_agreement_id",
                    "child_agreements"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "id"
                    },
                    "original_name": {
                      "type": "string",
                      "description": "original file name"
                    },
                    "name": {
                      "type": "string",
                      "description": "agreement name"
                    },
                    "type": {
                      "type": "object",
                      "description": "agreement type",
                      "required": ["id", "name"],
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "type id"
                        },
                        "name": {
                          "type": "string",
                          "description": "type name"
                        }
                      }
                    },
                    "terms": {
                      "type": "array",
                      "description": "agreement terms",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "description": "value"
                          },
                          "name": {
                            "type": "string",
                            "description": "term type name"
                          },
                          "status": {
                            "type": "string",
                            "description": "status"
                          },
                          "kind": {
                            "type": "string",
                            "description": "term type kind"
                          }
                        }
                      }
                    },
                    "tags": {
                      "type": "array",
                      "description": "tags",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "name"
                          }
                        }
                      }
                    },
                    "uploaded_by": {
                      "type": "string",
                      "description": "full name of uploading user"
                    },
                    "upload_date": {
                      "type": "string",
                      "description": "uploaded date"
                    },
                    "updated_date": {
                      "type": "string",
                      "description": "updated date"
                    },
                    "parent_agreement_id": {
                      "type": "string",
                      "description": "parent agreement id"
                    },
                    "finalize_agreement_id": {
                      "type": "string",
                      "description": "finalize agreement id"
                    },
                    "child_agreements": {
                      "type": "array",
                      "description": "child agreements",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "child agreement id"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                }
              }
            }
          },
          "404": {
            "description": "No record found for id",
            "content": {
              "application/json": {
                "example": {
                  "message": "Record Not Found",
                  "error_code": "not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "invalid id format",
            "content": {
              "application/json": {
                "example": {
                  "message": "id is in invalid format",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/agreements/{id}/hierarchy": {
      "get": {
        "summary": "Get Agreement Hierarchy",
        "tags": ["Analyze Agreements"],
        "description": "Retrieve a JSON-formatted hierarchy of an agreement, detailing parent and child agreements with IDs, names, effective dates, and upload dates.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "example": {
                  "name": "Agreement2",
                  "effective_date": "2021-09-23",
                  "agreement_id": "f5cb3e3c-56b7-11f0-8b2c-870ba0ea97b7",
                  "upload_date": "2025-07-01T16:14:15-04:00",
                  "children": [
                    {
                      "name": "Agreement1",
                      "effective_date": "2021-09-23",
                      "agreement_id": "f5eef034-56b7-11f0-8b2c-879f437f92d8",
                      "upload_date": "2025-07-01T16:14:15-04:00",
                      "children": [
                        {
                          "name": "child agreement 1",
                          "effective_date": "2021-09-23",
                          "agreement_id": "f6753ef0-56b7-11f0-8b2c-fb96776face7",
                          "upload_date": "2025-07-01T16:14:16-04:00",
                          "children": null
                        }
                      ]
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "description": "Agreement Name (Parent)",
                      "example": "Example Master Agreement"
                    },
                    "effective_date": {
                      "type": "string",
                      "nullable": true,
                      "description": "Effective Date of Agreement",
                      "example": "2021-09-23"
                    },
                    "agreement_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUID of the Agreement"
                    },
                    "upload_date": {
                      "type": "string",
                      "description": "Upload Date of the Agreement",
                      "example": "2022-10-23"
                    },
                    "children": {
                      "type": "array",
                      "nullable": true,
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "Name of the Child Agreement",
                            "example": "Example Child Agreement Name"
                          },
                          "effective_date": {
                            "type": "string",
                            "nullable": true,
                            "description": "Effective Date of Child Agreement",
                            "example": "2020-04-23"
                          },
                          "agreement_id": {
                            "type": "string",
                            "format": "uuid",
                            "description": "UUID of the Child Agreement"
                          },
                          "upload_date": {
                            "type": "string",
                            "description": "Upload Date of the Child Agreement",
                            "example": "2022-03-23"
                          },
                          "children": {
                            "type": "array",
                            "nullable": true,
                            "items": {
                              "type": "object",
                              "properties": {
                                "name": {
                                  "type": "string",
                                  "description": "Name of the Grandchild Agreement",
                                  "example": "Example Child Agreement Name"
                                },
                                "effective_date": {
                                  "type": "string",
                                  "nullable": true,
                                  "description": "Effective Date of Grandchild Agreement",
                                  "example": "2021-01-23"
                                },
                                "agreement_id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "UUID of the Grandchild Agreement"
                                },
                                "upload_date": {
                                  "type": "string",
                                  "description": "Upload Date of the Grandchild Agreement",
                                  "example": "2022-12-23"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "name",
                    "effective_date",
                    "agreement_id",
                    "upload_date",
                    "children"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                }
              }
            }
          },
          "404": {
            "description": "No record found for id",
            "content": {
              "application/json": {
                "example": {
                  "message": "Record Not Found",
                  "error_code": "not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "invalid id format",
            "content": {
              "application/json": {
                "example": {
                  "message": "id is in invalid format",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/agreements": {
      "get": {
        "summary": "List Agreements",
        "tags": ["Analyze Agreements"],
        "description": "Retrieve a list of agreements in Analyze, with options to filter and paginate.",
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "description": "Specify agreement type name to filter results by agreement type [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tags",
            "in": "query",
            "description": "Specify comma separated tags to return agreements with all tags requested [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "after_date",
            "in": "query",
            "description": "Specify after_date which will return all agreements updated since date [YYYY-MM-DD]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Specify the field to sort by [name, updated_date, upload_date]. Prepend `-` for descending [-name, -updated_date, -upload_date]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Specify cursor from previous response to get next page of data",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tags_delimiter",
            "in": "query",
            "description": "Specify a delimiter to separate tags, default is comma [,].  Acceptable delimiters [- ~ . _ ,]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Specify page size of results, between 1 and 100",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "page_size": {
                      "type": "integer",
                      "description": "The number of results displayed",
                      "example": 100
                    },
                    "count": {
                      "type": "integer",
                      "description": "Total number of results found",
                      "example": 100
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true,
                      "format": "uuid",
                      "description": "The string that must be passed to the cursor parameter to get the next page of results",
                      "readOnly": true
                    },
                    "agreements": {
                      "type": "array",
                      "nullable": true,
                      "minItems": 0,
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "UUID of the Agreement",
                            "example": "269b36b3-df8d-4481-81f8-72c97a7c1e1a"
                          },
                          "parent_agreement_id": {
                            "type": "string",
                            "nullable": true,
                            "description": "UUID of the Parent Agreement",
                            "example": "77213953-7d73-497c-8786-6bd136b197d4"
                          },
                          "finalize_agreement_id": {
                            "type": "string",
                            "nullable": true,
                            "description": "UUID of the Finalize Agreement",
                            "example": "bfac6469-164f-4965-9e8c-933ef85833f5"
                          },
                          "name": {
                            "type": "string",
                            "description": "Agreement Name",
                            "readOnly": true,
                            "example": "Example Agreement Name"
                          },
                          "original_name": {
                            "type": "string",
                            "description": "Original File Name",
                            "example": "Example Original File Name"
                          },
                          "updated_date": {
                            "type": "string",
                            "description": "Last Updated Date of Agreement",
                            "example": "2023-06-27T14:27:11.022-04:00"
                          },
                          "upload_date": {
                            "type": "string",
                            "description": "Upload Date of the Agreement",
                            "example": "2023-06-27T14:27:11.022-04:00"
                          },
                          "uploaded_by": {
                            "type": "string",
                            "description": "Name of User who Uploaded Agreement",
                            "example": "John Doe"
                          },
                          "type": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "UUID of the Agreement Type",
                                "example": "a223bf8c-a25b-4811-8b12-f0246d33df99"
                              },
                              "name": {
                                "type": "string",
                                "description": "Name of the Agreement Type",
                                "example": "Master Agreement"
                              }
                            }
                          },
                          "tags": {
                            "type": "array",
                            "nullable": true,
                            "minItems": 0,
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "UUID of the tag",
                                  "example": "6df3cb35-2481-45c8-84b0-06db1a025c54"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "The name of the tag",
                                  "example": "Blue"
                                }
                              }
                            }
                          },
                          "child_agreements": {
                            "type": "array",
                            "nullable": true,
                            "minItems": 0,
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "format": "uuid",
                                  "description": "UUID of the Child Agreement",
                                  "example": "6d37ecf4-6857-439f-adf5-ac015632baab"
                                }
                              }
                            }
                          },
                          "terms": {
                            "type": "array",
                            "nullable": true,
                            "minItems": 0,
                            "items": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string",
                                  "description": "UUID of the term",
                                  "example": "11e68e8b-4723-4a08-98d8-02f788224b95"
                                },
                                "name": {
                                  "type": "string",
                                  "description": "The name of the term",
                                  "example": "Effective Date"
                                },
                                "value": {
                                  "type": "string",
                                  "description": "The value of the term",
                                  "example": "2022-12-25",
                                  "nullable": true
                                },
                                "kind": {
                                  "type": "string",
                                  "description": "The kind of the term",
                                  "example": "Date"
                                },
                                "status": {
                                  "type": "string",
                                  "description": "The status of the term",
                                  "example": "User-Defined"
                                }
                              }
                            }
                          }
                        }
                      },
                      "required": [
                        "id",
                        "parent_agreement_id",
                        "finalize_agreement_id",
                        "name",
                        "original_name",
                        "updated_date",
                        "upload_date",
                        "uploaded_by",
                        "type",
                        "tags",
                        "terms",
                        "child_agreements"
                      ]
                    }
                  },
                  "required": [
                    "page_size",
                    "count",
                    "next_cursor",
                    "agreements"
                  ]
                },
                "example": {
                  "page_size": 100,
                  "count": 2,
                  "next_cursor": null,
                  "agreements": [
                    {
                      "id": "10a8e826-56b8-11f0-8b2c-1366d43a3966",
                      "parent_agreement_id": null,
                      "finalize_agreement_id": "77549390-2e7c-4665-96af-32d712250f1c",
                      "name": "Agreement2",
                      "original_name": "original 2",
                      "enqueued_at": null,
                      "updated_date": "2025-07-01T16:15:00.194-04:00",
                      "upload_date": "2025-07-01T16:15:00.194-04:00",
                      "uploaded_by": "Staci Windler",
                      "type": {
                        "id": "107371fa-56b8-11f0-8b2c-9313c70230d9",
                        "name": "Assignment"
                      },
                      "tags": [
                        {
                          "id": "107cbdc8-56b8-11f0-8b2c-e3d3b806172f",
                          "name": "blue"
                        }
                      ],
                      "terms": null,
                      "child_agreements": [
                        {
                          "id": "10cdeed2-56b8-11f0-8b2c-17bc4e85553a"
                        }
                      ]
                    },
                    {
                      "id": "110d23cc-56b8-11f0-8b2c-eff4668193d1",
                      "parent_agreement_id": null,
                      "finalize_agreement_id": "a353c6bf-6d53-4552-8fae-784223ef7379",
                      "name": "Agreement2 (1)",
                      "original_name": "original 2",
                      "enqueued_at": null,
                      "updated_date": "2025-07-01T16:15:00.851-04:00",
                      "upload_date": "2025-07-01T16:15:00.851-04:00",
                      "uploaded_by": "Elvin Stroman",
                      "type": {
                        "id": "107371fa-56b8-11f0-8b2c-9313c70230d9",
                        "name": "Assignment"
                      },
                      "tags": [
                        {
                          "id": "107cbdc8-56b8-11f0-8b2c-e3d3b806172f",
                          "name": "blue"
                        }
                      ],
                      "terms": [
                        {
                          "id": "1115d86e-56b8-11f0-8b2c-c3035bb3cebc",
                          "value": "1",
                          "name": "stt_1",
                          "kind": "string",
                          "status": "AI Processing"
                        },
                        {
                          "id": "112066e4-56b8-11f0-8b2c-eb7c022ff815",
                          "value": "custom",
                          "name": "stt_2",
                          "kind": "string",
                          "status": "User-Defined"
                        },
                        {
                          "id": "1129b8fc-56b8-11f0-8b2c-871a6e0f63cc",
                          "value": "strong value",
                          "name": "stt_3",
                          "kind": "string",
                          "status": "AI Present"
                        }
                      ],
                      "child_agreements": null
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "wrong date format",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "after_date is in invalid format",
                  "error_code": "unknown_error"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Create Agreement: Create Upload URL",
        "tags": ["Analyze Agreements"],
        "description": "Returns an AWS S3 URL upon success for subsequent file uploads. On a successful response, execute a PUT request to the AWS S3 URL with the file.\n\nKnowledge Base Example: https://help.linksquares.com/hc/en-us/articles/10849398433559-Analyze-API-Sample-Use-Cases#01H7AP6S3RDH2AF5SGGFX5P8DR\n\nAWS Documentation: https://docs.aws.amazon.com/AmazonS3/latest/userguide/PresignedUrlUploadObject.html\n",
        "parameters": [],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "example": {
                  "upload_id": "39ce4b9c-56b8-11f0-8b2c-c716419ec21b",
                  "name": "custom name",
                  "file_name": "new file name.pdf",
                  "type": "Master Agreement",
                  "status": "Initialized",
                  "url": "https://linksquares-agreement-api-upload-test.s3.amazonaws.com/37ddddc0-56b8-11f0-8b2c-237bf53a6698/39ce4b9c-56b8-11f0-8b2c-c716419ec21b/new%20file%20name.pdf?x-amz-sdk-checksum-algorithm=CRC32&x-amz-checksum-crc32=AAAAAA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIARONR2CMFH5VU4OCK%2F20250701%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250701T201609Z&X-Amz-Expires=900&X-Amz-Security-Token=unused-test-session-key&X-Amz-SignedHeaders=host&X-Amz-Signature=f577ab3f3e3c98dd6816d757c33e82609186a4145665c1779fb7d7f7369bf384",
                  "tags": ["red", "blue"],
                  "terms": [
                    {
                      "name": "stt_1",
                      "value": "value2"
                    },
                    {
                      "name": "Warranty_58",
                      "value": "1.5"
                    },
                    {
                      "name": "stt_2",
                      "value": "LinkSquares Ireland, Ltd St"
                    }
                  ],
                  "parent_agreement_id": "3868faae-56b8-11f0-8b2c-a76cd605882e"
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "upload_id": {
                      "type": "string",
                      "description": "UUID of the Upload",
                      "example": "f6cb5f59-ea46-4371-9739-570e83c5da27"
                    },
                    "name": {
                      "type": "string",
                      "description": "The custom name of the document being uploaded",
                      "example": "Example Agreement Name"
                    },
                    "type": {
                      "type": "string",
                      "description": "The Agreement Type of the Upload",
                      "example": "Master Agreement"
                    },
                    "file_name": {
                      "type": "string",
                      "description": "The name of the file being uploaded",
                      "example": "example_agreement_name.pdf"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the Upload",
                      "example": "Initialized"
                    },
                    "url": {
                      "type": "string",
                      "description": "AWS Presigned Upload URL",
                      "example": "https://linksquares-agreement-api-upload-test.s3.amazonaws.com/3f4f51c8-15d9-11ee-8c7f-1f7f5cacceef/4037a5e0-15d9-11ee-8c7f-9ffe3bde9219/new%20file%20name.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIARONR2CMFGDRHHB3F%2F20230628%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230628T172852Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Security-Token=unused-test-session-key&X-Amz-Signature=2d3739f49a682547d1f52c3ab0b32709ec39df9954b8a05e1abb2588414276cf"
                    },
                    "parent_agreement_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "UUID of the Parent Agreement",
                      "example": "7d3a7092-ecf7-4342-b96f-2a751133e14d"
                    },
                    "tags": {
                      "type": "array",
                      "nullable": true,
                      "minItems": 0,
                      "items": {
                        "type": "string",
                        "description": "Tag Name"
                      }
                    },
                    "terms": {
                      "type": "array",
                      "nullable": true,
                      "minItems": 0,
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "description": "The name of the term",
                            "example": "Effective Date"
                          },
                          "value": {
                            "type": "string",
                            "description": "The value of the term",
                            "example": "2022-12-25",
                            "nullable": true
                          }
                        }
                      }
                    }
                  },
                  "required": [
                    "upload_id",
                    "name",
                    "file_name",
                    "type",
                    "status",
                    "url",
                    "tags",
                    "terms",
                    "parent_agreement_id"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                }
              }
            }
          },
          "422": {
            "description": "invalid extension",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "message": "file_name must have an extension matching [pdf, docx]",
                  "error_code": "unknown_error"
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "file_name": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "agreement_type": {
                    "type": "string"
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "terms": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "approve_agreement": {
                    "type": "boolean"
                  },
                  "parent_agreement_id": {
                    "type": "string"
                  }
                },
                "required": ["file_name"]
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/clause_categories": {
      "get": {
        "summary": "List Clause Categories",
        "tags": ["Analyze Clauses"],
        "description": "Retrieve a list of clause categories in Analyze, with options to filter and paginate.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Specify agreement type name to filter results [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Specify the field to sort by [name]. Prepend `-` for descending [-name]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Specify cursor from previous response to get next page of data",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Specify page size of results, between 1 and 100",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful without params",
            "content": {
              "application/json": {
                "example": {
                  "page_size": 100,
                  "count": 3,
                  "next_cursor": null,
                  "clause_categories": [
                    {
                      "id": "0276a0e1-d590-40b2-80c5-5d0a0d23a4c4",
                      "name": "abc",
                      "created_at": "2025-07-01T16:17:00-04:00",
                      "updated_at": "2025-07-01T16:17:00-04:00"
                    },
                    {
                      "id": "209aaa2a-7d4a-4e7c-84db-e689078f3145",
                      "name": "def",
                      "created_at": "2025-07-01T16:17:00-04:00",
                      "updated_at": "2025-07-01T16:17:00-04:00"
                    },
                    {
                      "id": "61af9780-2ef8-4cd8-bc46-e15d71041934",
                      "name": "ghi",
                      "created_at": "2025-07-01T16:17:00-04:00",
                      "updated_at": "2025-07-01T16:17:00-04:00"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "page_size": {
                      "type": "integer",
                      "description": "The number of results displayed",
                      "example": 100
                    },
                    "count": {
                      "type": "integer",
                      "description": "Total number of results found",
                      "example": 100
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true,
                      "format": "uuid",
                      "description": "The string that must be passed to the cursor parameter to get the next page of results",
                      "readOnly": true
                    },
                    "clause_categories": {
                      "type": "array",
                      "nullable": true,
                      "minItems": 0,
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "UUID of the Clause Category",
                            "example": "dacb0d83-f240-496b-9a86-118f5935165e"
                          },
                          "name": {
                            "type": "string",
                            "description": "Clause Category Name",
                            "example": "Example Agreement Name"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "Created Date of Clause Category",
                            "example": "2023-06-27T14:27:11.022-04:00"
                          },
                          "updated_at": {
                            "type": "string",
                            "description": "Last Updated Date of Clause Category",
                            "example": "2023-06-27T14:27:11.022-04:00"
                          }
                        },
                        "required": ["id", "name", "created_at", "updated_at"]
                      }
                    }
                  },
                  "required": [
                    "page_size",
                    "count",
                    "next_cursor",
                    "clause_categories"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "cursor is invalid",
            "content": {
              "application/json": {
                "example": {
                  "message": "cursor is in invalid format",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/clauses": {
      "get": {
        "summary": "List Clauses",
        "tags": ["Analyze Clauses"],
        "description": "Retrieve a list of clauses in Analyze, with options to filter by clause category and paginate.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Specify agreement type name to filter results [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Specify the field to sort by [name]. Prepend `-` for descending [-name]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Specify cursor from previous response to get next page of data",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "description": "Specify page size of results, between 1 and 100",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clause_category_id",
            "in": "query",
            "description": "Specify the clause category id to filter results",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful without params",
            "content": {
              "application/json": {
                "example": {
                  "page_size": 100,
                  "count": 3,
                  "next_cursor": null,
                  "clauses": [
                    {
                      "id": "776ac25a-56b8-11f0-8b2c-8b6eaa62dcf1",
                      "name": "clause a",
                      "text": "Minus est sit accusamus.",
                      "clause_category_id": "b85dc0f0-2262-4889-8642-bad8682bf250",
                      "note": "Sequi vel expedita quasi.",
                      "agreement_id": "77510810-56b8-11f0-8b2c-53691ab8876b",
                      "created_at": "2025-07-01T16:17:52-04:00",
                      "updated_at": "2025-07-01T16:17:52-04:00",
                      "author_name": "Antonetta Jones"
                    },
                    {
                      "id": "77cb05d4-56b8-11f0-8b2c-a3bfc0014a2f",
                      "name": "clause b",
                      "text": "Saepe qui consequatur ratione.",
                      "clause_category_id": "146a9041-9811-4562-9382-9f56c8ce2753",
                      "note": "Quas eaque est atque.",
                      "agreement_id": "77ae2950-56b8-11f0-8b2c-3bfabd21404a",
                      "created_at": "2025-07-01T16:17:53-04:00",
                      "updated_at": "2025-07-01T16:17:53-04:00",
                      "author_name": "Gaston Torphy"
                    },
                    {
                      "id": "7831c7ba-56b8-11f0-8b2c-1bc5f3b5c63f",
                      "name": "clause c",
                      "text": "Dignissimos dolore ut non.",
                      "clause_category_id": "b85dc0f0-2262-4889-8642-bad8682bf250",
                      "note": "Debitis molestias neque ut.",
                      "agreement_id": "78128ac6-56b8-11f0-8b2c-fb273a95ba55",
                      "created_at": "2025-07-01T16:17:53-04:00",
                      "updated_at": "2025-07-01T16:17:53-04:00",
                      "author_name": "Thomas Harber"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "page_size": {
                      "type": "integer",
                      "description": "The number of results displayed",
                      "example": 100
                    },
                    "count": {
                      "type": "integer",
                      "description": "Total number of results found",
                      "example": 100
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true,
                      "format": "uuid",
                      "description": "The string that must be passed to the cursor parameter to get the next page of results",
                      "readOnly": true
                    },
                    "clause_categories": {
                      "type": "array",
                      "nullable": true,
                      "minItems": 0,
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "UUID of the Clause",
                            "example": "e350ab48-f65b-4504-9bfc-64502cc9ad93"
                          },
                          "name": {
                            "type": "string",
                            "description": "Clause Name",
                            "example": "Example Clause Name"
                          },
                          "text": {
                            "type": "string",
                            "description": "Clause Text",
                            "example": "lorem ipsum"
                          },
                          "clause_category_id": {
                            "type": "string",
                            "description": "UUID of the associated Clause Category",
                            "example": "1650aba4-91f7-4855-90b4-d1f00564566b"
                          },
                          "note": {
                            "type": "string",
                            "description": "Note",
                            "example": "Please adhere to this note."
                          },
                          "agreement_id": {
                            "type": "string",
                            "description": "UUID of the associated Agreement",
                            "example": "05849aab-988d-439e-85f0-e1eceb7a4b7b"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "Created Date of Clause",
                            "example": "2023-06-27T14:27:11.022-04:00"
                          },
                          "updated_at": {
                            "type": "string",
                            "description": "Last Updated Date of Clause",
                            "example": "2023-06-27T14:27:11.022-04:00"
                          },
                          "author_name": {
                            "type": "string",
                            "description": "Name of Author",
                            "example": "John Doe"
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "text",
                          "clause_category_id",
                          "note",
                          "agreement_id",
                          "created_at",
                          "updated_at",
                          "author_name"
                        ]
                      }
                    }
                  },
                  "required": ["page_size", "count", "next_cursor", "clauses"]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "cursor is invalid",
            "content": {
              "application/json": {
                "example": {
                  "message": "cursor is in invalid format",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/agreement_types": {
      "get": {
        "summary": "List Agreement Types",
        "tags": ["Analyze Agreements"],
        "description": "Retrieve all available agreement types in Analyze.",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Specify agreement type name to filter results [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Specify the field to sort by [name]. Prepend `-` for descending [-name]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Specify cursor from previous response to get next page of data",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Specify page size of results, between 1 and 100",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful without params",
            "content": {
              "application/json": {
                "example": {
                  "page_size": 100,
                  "count": 3,
                  "next_cursor": null,
                  "agreement_types": [
                    {
                      "id": "95fddc34-56b8-11f0-8b2c-2b554cc9804d",
                      "name": "Addendum",
                      "is_smart": false
                    },
                    {
                      "id": "95e3fae4-56b8-11f0-8b2c-bfd1cb5e4833",
                      "name": "Master Agreement",
                      "is_smart": false
                    },
                    {
                      "id": "96174cb4-56b8-11f0-8b2c-e37ac073a694",
                      "name": "Service Agreement",
                      "is_smart": false
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "page_size": {
                      "type": "integer",
                      "description": "The number of results displayed",
                      "example": 100
                    },
                    "count": {
                      "type": "integer",
                      "description": "Total number of results found",
                      "example": 100
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true,
                      "format": "uuid",
                      "description": "The string that must be passed to the cursor parameter to get the next page of results",
                      "readOnly": true
                    },
                    "agreement_types": {
                      "type": "array",
                      "nullable": true,
                      "minItems": 0,
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "UUID of the Agreement Type",
                            "example": "fd906eb1-82b6-4e1a-933b-0d3f3ead3622"
                          },
                          "name": {
                            "type": "string",
                            "description": "Agreement Type Name",
                            "example": "Example Clause Name"
                          },
                          "is_smart": {
                            "type": "boolean",
                            "description": "Boolean indicator of whether the agreement type is smart or not",
                            "example": false
                          }
                        },
                        "required": ["id", "name", "is_smart"]
                      }
                    }
                  },
                  "required": [
                    "page_size",
                    "count",
                    "next_cursor",
                    "agreement_types"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "cursor is invalid",
            "content": {
              "application/json": {
                "example": {
                  "message": "cursor is in invalid format",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/uploads/{id}": {
      "get": {
        "summary": "Create Agreement: Verify Upload Status",
        "tags": ["Analyze Agreements"],
        "description": "Verify the upload status of a file by upload ID in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "example": {
                  "upload_id": "9eca0158-56b8-11f0-8b2c-ef6d7d15a2e1",
                  "status": "success",
                  "agreement_id": "9eb1d3b2-56b8-11f0-8b2c-4378a3ed36e9",
                  "updated_date": "2025-07-01T16:18:58.633-04:00",
                  "message": null
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "upload_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUID of Upload",
                      "example": "0d797b42-15f7-11ee-ae77-67008a40b00c"
                    },
                    "status": {
                      "type": "string",
                      "description": "Status of the Upload",
                      "example": "success"
                    },
                    "agreement_id": {
                      "type": "string",
                      "format": "uuid",
                      "description": "UUID of the related Agreement"
                    },
                    "updated_date": {
                      "type": "string",
                      "description": "Last Updated Date of the Upload",
                      "example": "2022-10-23"
                    },
                    "message": {
                      "type": "string",
                      "nullable": true,
                      "description": "Additional information about the Upload status",
                      "example": "2021-09-23"
                    }
                  },
                  "required": [
                    "upload_id",
                    "status",
                    "agreement_id",
                    "updated_date",
                    "message"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No record found for id",
            "content": {
              "application/json": {
                "example": {
                  "message": "Record Not Found",
                  "error_code": "not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "invalid id format",
            "content": {
              "application/json": {
                "example": {
                  "message": "id is in invalid format",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v1/me": {
      "get": {
        "summary": "Get User Information",
        "tags": ["Analyze System"],
        "parameters": [],
        "responses": {
          "200": {
            "description": "successful",
            "content": {
              "application/json": {
                "example": {
                  "whoami": "shiloh.wisoky@flatley-quitzon.test",
                  "status": "up",
                  "timestamp": "2025-07-01T20:19:10Z"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}": {
      "patch": {
        "summary": "Update Agreement Metadata",
        "tags": ["Analyze Agreements"],
        "description": "Modify metadata details of an existing agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful with params",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "b9cf1966-56b8-11f0-8b2c-9f2851d4840c",
                    "parent_agreement_id": "b9a3eda4-56b8-11f0-8b2c-5b4f5d8af6f1",
                    "name": "Updated Agreement Name",
                    "original_name": "original 1",
                    "updated_date": "2025-07-01T20:19:43Z",
                    "upload_date": "2025-07-01T20:19:43Z",
                    "uploaded_by": "Ozie Weber",
                    "type_id": "b955734a-56b8-11f0-8b2c-4b2e05a38b75",
                    "tag_ids": [
                      "b9726b58-56b8-11f0-8b2c-1769dcdbc803",
                      "b97593d2-56b8-11f0-8b2c-1785770e22da"
                    ],
                    "term_ids": [
                      "b9df903e-56b8-11f0-8b2c-835b3ea8e8d0",
                      "b9eaf546-56b8-11f0-8b2c-43f6aabbedf0"
                    ],
                    "child_agreements": [
                      {
                        "id": "ba646f0c-56b8-11f0-8b2c-7fe06b8ba9e9"
                      }
                    ]
                  }
                },
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "parent agreement id not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Parent agreement not found: 9d0c4abd-2167-4822-b809-f2947fea7d22",
                  "error_code": "parent_agreement_not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation failure on value",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "type_id",
                      "error_code": "validation_failure",
                      "message": "type_id must be a string"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "type_id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "parent_agreement_id": {
                        "type": "string",
                        "nullable": true
                      }
                    },
                    "required": ["value"]
                  }
                },
                "required": ["data"]
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}/download": {
      "get": {
        "summary": "Get Agreement File URL",
        "tags": ["Analyze Agreements"],
        "description": "Retrieve a URL to download the file of a specific agreement in Analyze, with an option to use the original or smart-renamed file.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "use_original_name",
            "in": "query",
            "schema": {
              "type": "boolean"
            },
            "required": false,
            "description": "A filter used to return original file or renamed with a smart_name",
            "example": "`?use_original_name=true`"
          }
        ],
        "responses": {
          "200": {
            "description": "successful with params",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "url": "memory://6267cc504c1f4aaf569a6c42f139e9f1/real.pdf"
                  }
                },
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "failure with agreement not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Not Found",
                  "error_code": "agreement_not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "failure when user does not have an access",
            "content": {
              "application/json": {
                "example": {
                  "message": "Access Denied for User",
                  "error_code": "unauthorized_user"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation failure on value",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "use_original_name",
                      "error_code": "validation_failure",
                      "message": "use_original_name must be boolean"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}/content": {
      "get": {
        "summary": "returns agreement file text content",
        "tags": ["Analyze Agreements V2"],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful with params",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "content": "MASTER SERVICE AGREEMENT \nThis Master Services Agreement (\"Agreement\") is entered into effective 17 March 2017, (\"Effective Date\") by (\"Company\") LinkSquares Inc. and consists of the below terms and conditions."
                  }
                },
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "failure with agreement not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Not Found",
                  "error_code": "agreement_not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "failure when user does not have an access",
            "content": {
              "application/json": {
                "example": {
                  "message": "Access Denied for User",
                  "error_code": "unauthorized_user"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation failure on value",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "id",
                      "error_code": "validation_failure",
                      "message": "id is in invalid format"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}/attachments/{attachment_id}": {
      "delete": {
        "summary": "Delete Attachment",
        "tags": ["Analyze Attachments"],
        "description": "Remove an existing attachment from an agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Agreement ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "description": "Attachment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "agreement attachment successfully deleted"
          },
          "404": {
            "description": "agreement attachment not found"
          },
          "400": {
            "description": "failed to delete agreement attachment"
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}/attachments": {
      "get": {
        "summary": "List Attachments",
        "tags": ["Analyze Attachments"],
        "description": "Retrieve all attachments associated with an agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Agreement ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Specify uuid of the last agreement attachment from the collection for pagination",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Specify the limit count of returned collection",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful with limit param",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "e2aefaca-b7ae-4d18-8d04-4078f3181ace",
                      "file_name": null,
                      "file_size": null,
                      "file_type": null,
                      "uploaded_by": "Jeff Leffler",
                      "created_at": "2025-07-01T20:19:13Z"
                    }
                  ],
                  "total_count": 2,
                  "_links": {}
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "next": {
                      "type": "object",
                      "properties": {
                        "href": {
                          "type": "string",
                          "description": "URL to the next page of items (null if none)",
                          "example": "https://api.linksquares.com/api/finalize/v2/tags?cursor=0bbb5bb8-4036-11ee-82e0-9b1bc927e249"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "cursor not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Cursor not found: d7473f2f-d191-4eb4-8477-e742b0f00d87",
                  "error_code": "cursor_not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "invalid limit",
            "content": {
              "application/json": {
                "example": {
                  "message": "limit must be greater than 0",
                  "error_code": "unknown_error"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}/attachments/{attachment_id}/download": {
      "get": {
        "summary": "Get Agreement Attachment URL",
        "tags": ["Analyze Attachments"],
        "description": "Retrieve a URL to download an attachment from an agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Agreement ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "attachment_id",
            "in": "path",
            "description": "Attachment ID",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successfully returns agreement attachment file url",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "url": "memory://4ff4853048c765a63d7837038e312a5a/real.pdf"
                  }
                },
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "attachment file does not exist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "unauthorized user",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}/terms/{term_id}": {
      "patch": {
        "summary": "Update Agreement Term Value",
        "tags": ["Analyze Agreements"],
        "description": "Update the value of a specific term within an agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "term_id",
            "in": "path",
            "description": "term id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful without params",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": "b06903d2-56b8-11f0-8b2c-13b7c5fadf9f",
                    "name": "generic term abc",
                    "value": "text example",
                    "kind": "text",
                    "status": "User-Defined"
                  }
                },
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "object",
                      "required": ["id", "name", "kind", "status"],
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "integer"
                            }
                          ]
                        },
                        "kind": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "failure with term not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Term not found: 695ac1d2-349a-430a-904b-47476b9b4308",
                  "error_code": "term_not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation failure on value",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "value",
                      "error_code": "validation_failure",
                      "message": "value must be boolean"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "value": {
                        "type": "string"
                      }
                    },
                    "required": ["value"]
                  }
                },
                "required": ["data"]
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}/notes": {
      "post": {
        "summary": "Create Agreement Notes",
        "tags": ["Analyze Agreements"],
        "description": "Add notes to an existing agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful with valid params",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "ec94477c-56b8-11f0-8b2c-d786c4ab3c2d",
                      "content": "Hi",
                      "user_id": "ec3d1c72-56b8-11f0-8b2c-9757577b373a",
                      "agreement_id": "ec742e92-56b8-11f0-8b2c-435c6653d253",
                      "created_at": "2025-07-01T16:21:09.158-04:00"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": ["content"],
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "note id"
                          },
                          "content": {
                            "type": "string",
                            "description": "notes content"
                          },
                          "user_id": {
                            "type": "string",
                            "description": "user id"
                          },
                          "agreement_id": {
                            "type": "string",
                            "description": "agreement id"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "when it was created"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "failure when agreement not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Not Found",
                  "error_code": "agreement_or_user_not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "failure when user does not have an access",
            "content": {
              "application/json": {
                "example": {
                  "message": "Access Denied for User",
                  "error_code": "unauthorized_user"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "validation failure when there is no content",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "data",
                      "error_code": "validation_failure",
                      "message": "data [1, {:content=>[\"must be filled\"]}]"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "content": {
                          "type": "string"
                        },
                        "user_email": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": ["data", "content"]
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/agreements/{id}/tags/{tag_id}": {
      "post": {
        "summary": "Assign Tag to Agreement",
        "tags": ["Analyze Agreements"],
        "description": "Assign an existing tag to an agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag_id",
            "in": "path",
            "description": "tag id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "successfully created with valid params",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "name": "corrupti1",
                    "color": "blue",
                    "id": "f148b2ee-56b8-11f0-8b2c-ebeb34a52d50"
                  }
                },
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "failure when tag not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "message": "Not Found",
                  "error_code": "tag_not_found"
                }
              }
            }
          },
          "422": {
            "description": "validation failure when wrong params format",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "id",
                      "error_code": "validation_failure",
                      "message": "id is in invalid format"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "failure when user does not have an access",
            "content": {
              "application/json": {
                "example": {
                  "message": "Access Denied for User",
                  "error_code": "unauthorized_user"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "delete": {
        "summary": "Remove Tag From Agreement",
        "tags": ["Analyze Agreements"],
        "description": "Remove a specific tag from an existing agreement in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "agreement id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag_id",
            "in": "path",
            "description": "tag id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "The resource was deleted successfully."
          },
          "404": {
            "description": "failure when tag does not belong to agreement",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tag does not belong to the agreement",
                  "error_code": "no_such_tag_in_agreement"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "failure when user does not have an access",
            "content": {
              "application/json": {
                "example": {
                  "message": "Access Denied for User",
                  "error_code": "unauthorized_user"
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "failure validation when pass wrong params format",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "id",
                      "error_code": "validation_failure",
                      "message": "id is in invalid format"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/tags": {
      "get": {
        "summary": "List Company Tags",
        "tags": ["Analyze Settings"],
        "description": "Retrieve all available tags in Analyze.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Specify page size of results, between 1 and 100",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Specify tag name to filter results [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Specify uuid of the last tag form the collection for pagination",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Specify the field to sort by [name]. Prepend `-` for descending [-name]",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "successful with pagination",
            "content": {
              "application/json": {
                "example": {
                  "data": [
                    {
                      "id": "04e29f86-56b9-11f0-8b2c-731914a3bc8c",
                      "name": "blue tag",
                      "color": "blue",
                      "agreements_count": 0
                    }
                  ],
                  "total_count": 3,
                  "_links": {
                    "next": {
                      "href": "http://www.example.com/api/analyze/v2/tags?cursor=04e29f86-56b9-11f0-8b2c-731914a3bc8c&limit=1"
                    }
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "next": {
                      "type": "object",
                      "properties": {
                        "href": {
                          "type": "string",
                          "description": "URL to the next page of items (null if none)",
                          "example": "https://api.linksquares.com/api/finalize/v2/tags?cursor=0bbb5bb8-4036-11ee-82e0-9b1bc927e249"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "limit does not have a valid value",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "limit",
                      "error_code": "validation_failure",
                      "message": "limit must be an integer"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      },
      "post": {
        "summary": "Create Company Tags",
        "tags": ["Analyze Settings"],
        "description": "Create a custom tag available for all agreement in Analyze.",
        "parameters": [],
        "responses": {
          "201": {
            "description": "successfully created with valid params",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "id": null,
                    "name": "dolore",
                    "color": "green",
                    "agreements_count": 0,
                    "created_at": null
                  }
                },
                "schema": {
                  "type": "object",
                  "required": ["data"],
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "duplicate name passed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "message": "Tag has already been created.",
                  "error_code": "tag_exists"
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "data": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "color": {
                        "type": "string",
                        "enum": [
                          "blue",
                          "green",
                          "red",
                          "purple",
                          "dark_blue",
                          "smart_green",
                          "aqua",
                          "orange",
                          "yellow",
                          "light_gray",
                          "medium_gray",
                          "dark_gray",
                          "evergreen",
                          "brown",
                          "sky_blue",
                          "pink",
                          "slate"
                        ]
                      }
                    }
                  }
                },
                "required": ["data", "name"]
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/tags/{id}": {
      "delete": {
        "summary": "Delete Tag from Company",
        "tags": ["Analyze Settings"],
        "description": "Remove a specific tag from your company's tag list in Analyze.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Remove a specific tag from your company's tag list in Analyze.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "successfully"
          },
          "403": {
            "description": "unauthorized user - read only",
            "content": {
              "application/json": {
                "example": {
                  "message": "Access Denied for User",
                  "error_code": "unauthorized_user"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "tag not found",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tag does not exist.",
                  "error_code": "tag_not_found"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "fails validation",
            "content": {
              "application/json": {
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "tag_id",
                      "error_code": "validation_failure",
                      "message": "tag_id is in invalid format"
                    }
                  ]
                },
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "405": {
            "description": "not allowed",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tag has associated role, role must first be disassociated.",
                  "error_code": "tag_has_associated_role"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "410": {
            "description": "resource gone",
            "content": {
              "application/json": {
                "example": {
                  "message": "Tag was previously deleted.",
                  "error_code": "tag_previously_deleted"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/analyze/v2/term_types": {
      "get": {
        "summary": "List Term Types",
        "tags": ["Analyze Settings"],
        "description": "Retrieve all available term types in Analyze.",
        "parameters": [
          {
            "name": "page_size",
            "in": "query",
            "required": false,
            "description": "Specify page size of results, between 1 and 100",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "description": "Specify term type name to filter results [Case Sensitive]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort_by",
            "in": "query",
            "description": "Specify the field to sort by [name]. Prepend `-` for descending [-name]",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Specify the documents to include [embedded]",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "success with embedded documents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_count": {
                      "type": "integer",
                      "description": "Total number of results found",
                      "example": 100
                    },
                    "data": {
                      "type": "array",
                      "nullable": true,
                      "minItems": 0,
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "description": "UUID of the Term Type",
                            "example": "b0480ef8-d9c1-41fa-b980-2d6433aa50ca"
                          },
                          "name": {
                            "type": "string",
                            "description": "Term Type Name",
                            "readOnly": true,
                            "example": "Effective Date"
                          },
                          "kind": {
                            "type": "string",
                            "description": "Kind of Term Type",
                            "example": "date"
                          },
                          "created_at": {
                            "type": "string",
                            "description": "Last Updated Date of Agreement",
                            "example": "2023-06-27T14:27:11.022-04:00"
                          },
                          "agreement_type_id": {
                            "type": "string",
                            "nullable": true,
                            "format": "uuid",
                            "description": "UUID of the associated Agreement Type",
                            "example": "42d70b3e-02a9-4dec-b134-2ff102da5684"
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "kind",
                        "created_at",
                        "agreement_type_id"
                      ]
                    },
                    "_embedded": {
                      "type": "object",
                      "nullable": true,
                      "minItems": 0,
                      "properties": {
                        "agreement_types": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "format": "uuid",
                                "description": "ID of Agreement Type",
                                "example": "0d797b42-15f7-11ee-ae77-67008a40b00c"
                              },
                              "name": {
                                "type": "string",
                                "nullable": true,
                                "description": "Name of Agreement Type",
                                "example": "Master Agreement"
                              }
                            },
                            "required": ["id", "name"]
                          }
                        }
                      },
                      "required": ["agreement_types"]
                    },
                    "_links": {
                      "type": "object",
                      "properties": {
                        "next": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the next page of items (null if none)",
                              "example": "https://api.linksquares.com/api/finalize/v2/agreements?page=3&per_page=100"
                            }
                          }
                        },
                        "prev": {
                          "type": "object",
                          "properties": {
                            "href": {
                              "type": "string",
                              "description": "URL to the previous page of items (null if none)",
                              "example": "https://api.linksquares.com/api/analyze/v2/agreements?page=1&per_page=100"
                            }
                          }
                        }
                      }
                    }
                  },
                  "required": ["data", "total_count"]
                },
                "example": {
                  "data": [
                    {
                      "id": "14e3392c-56b9-11f0-8b2c-1b865419aa71",
                      "name": "generic term def",
                      "kind": "checkbox",
                      "created_at": "2025-07-01T20:22:16Z",
                      "agreement_type_id": "14b66500-56b9-11f0-8b2c-37c8d62eeae8"
                    },
                    {
                      "id": "14e069ea-56b9-11f0-8b2c-dbdb02f5a5c1",
                      "name": "generic term cde",
                      "kind": "string",
                      "created_at": "2025-07-01T20:22:16Z",
                      "agreement_type_id": null
                    }
                  ],
                  "total_count": 4,
                  "_links": {
                    "next": {
                      "href": "http://www.example.com/api/analyze/v2/term_types?include=embedded&page=2&page_size=2&sort_by=-name"
                    }
                  },
                  "_embedded": {
                    "agreement_types": [
                      {
                        "id": "14b66500-56b9-11f0-8b2c-37c8d62eeae8",
                        "name": "Custom Template"
                      }
                    ]
                  }
                }
              }
            }
          },
          "422": {
            "description": "page_size does not have a valid value",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["message", "error_code"],
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "errors": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field_name": {
                            "type": "string"
                          },
                          "error_code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "message": "Validation Failed",
                  "error_code": "validation_failure",
                  "errors": [
                    {
                      "field_name": "page_size",
                      "error_code": "must_be_int",
                      "message": "page_size must be an integer"
                    }
                  ]
                }
              }
            }
          },
          "403": {
            "description": "inactive user",
            "content": {
              "application/json": {
                "example": {
                  "message": "User is not active",
                  "error_code": "forbidden"
                },
                "schema": {
                  "type": "object",
                  "required": ["message"],
                  "properties": {
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AnalyzeAgreement": {
        "type": "object",
        "required": [
          "id",
          "original_name",
          "name",
          "type",
          "terms",
          "tags",
          "uploaded_by",
          "upload_date",
          "updated_date",
          "parent_agreement_id",
          "finalize_agreement_id",
          "child_agreements"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "id"
          },
          "original_name": {
            "type": "string",
            "description": "original file name"
          },
          "name": {
            "type": "string",
            "description": "agreement name"
          },
          "type": {
            "type": "object",
            "description": "agreement type",
            "required": ["id", "name"],
            "properties": {
              "id": {
                "type": "string",
                "description": "type id"
              },
              "name": {
                "type": "string",
                "description": "type name"
              }
            }
          },
          "terms": {
            "type": "array",
            "description": "agreement terms",
            "items": {
              "type": "object",
              "properties": {
                "value": {
                  "type": "string",
                  "description": "value"
                },
                "name": {
                  "type": "string",
                  "description": "term type name"
                },
                "status": {
                  "type": "string",
                  "description": "status"
                },
                "kind": {
                  "type": "string",
                  "description": "term type kind"
                }
              }
            }
          },
          "tags": {
            "type": "array",
            "description": "tags",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "name"
                }
              }
            }
          },
          "uploaded_by": {
            "type": "string",
            "description": "full name of uploading user"
          },
          "upload_date": {
            "type": "string",
            "description": "uploaded date"
          },
          "updated_date": {
            "type": "string",
            "description": "updated date"
          },
          "parent_agreement_id": {
            "type": "string",
            "description": "parent agreement id"
          },
          "finalize_agreement_id": {
            "type": "string",
            "description": "finalize agreement id"
          },
          "child_agreements": {
            "type": "array",
            "description": "child agreements",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "child agreement id"
                }
              }
            }
          }
        }
      },
      "AnalyzeAgreementHierarchy": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Agreement Name (Parent)",
            "example": "Example Master Agreement"
          },
          "effective_date": {
            "type": "string",
            "nullable": true,
            "description": "Effective Date of Agreement",
            "example": "2021-09-23"
          },
          "agreement_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the Agreement"
          },
          "upload_date": {
            "type": "string",
            "description": "Upload Date of the Agreement",
            "example": "2022-10-23"
          },
          "children": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Name of the Child Agreement",
                  "example": "Example Child Agreement Name"
                },
                "effective_date": {
                  "type": "string",
                  "nullable": true,
                  "description": "Effective Date of Child Agreement",
                  "example": "2020-04-23"
                },
                "agreement_id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "UUID of the Child Agreement"
                },
                "upload_date": {
                  "type": "string",
                  "description": "Upload Date of the Child Agreement",
                  "example": "2022-03-23"
                },
                "children": {
                  "type": "array",
                  "nullable": true,
                  "items": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "description": "Name of the Grandchild Agreement",
                        "example": "Example Child Agreement Name"
                      },
                      "effective_date": {
                        "type": "string",
                        "nullable": true,
                        "description": "Effective Date of Grandchild Agreement",
                        "example": "2021-01-23"
                      },
                      "agreement_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "UUID of the Grandchild Agreement"
                      },
                      "upload_date": {
                        "type": "string",
                        "description": "Upload Date of the Grandchild Agreement",
                        "example": "2022-12-23"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "required": [
          "name",
          "effective_date",
          "agreement_id",
          "upload_date",
          "children"
        ]
      },
      "AnalyzeAgreementTag": {
        "type": "object",
        "required": ["id", "name"],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "AnalyzeAgreementTerm": {
        "type": "object",
        "required": ["id", "name", "kind", "status"],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer"
              }
            ]
          },
          "kind": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "AnalyzeCreateAgreement": {
        "type": "object",
        "properties": {
          "upload_id": {
            "type": "string",
            "description": "UUID of the Upload",
            "example": "372028f5-602c-4ee6-9a37-c0edb46d0660"
          },
          "name": {
            "type": "string",
            "description": "The custom name of the document being uploaded",
            "example": "Example Agreement Name"
          },
          "type": {
            "type": "string",
            "description": "The Agreement Type of the Upload",
            "example": "Master Agreement"
          },
          "file_name": {
            "type": "string",
            "description": "The name of the file being uploaded",
            "example": "example_agreement_name.pdf"
          },
          "status": {
            "type": "string",
            "description": "Status of the Upload",
            "example": "Initialized"
          },
          "url": {
            "type": "string",
            "description": "AWS Presigned Upload URL",
            "example": "https://linksquares-agreement-api-upload-test.s3.amazonaws.com/3f4f51c8-15d9-11ee-8c7f-1f7f5cacceef/4037a5e0-15d9-11ee-8c7f-9ffe3bde9219/new%20file%20name.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIARONR2CMFGDRHHB3F%2F20230628%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230628T172852Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Security-Token=unused-test-session-key&X-Amz-Signature=2d3739f49a682547d1f52c3ab0b32709ec39df9954b8a05e1abb2588414276cf"
          },
          "parent_agreement_id": {
            "type": "string",
            "nullable": true,
            "description": "UUID of the Parent Agreement",
            "example": "caa92465-4cf7-47cd-977b-24c568fe2697"
          },
          "tags": {
            "type": "array",
            "nullable": true,
            "minItems": 0,
            "items": {
              "type": "string",
              "description": "Tag Name"
            }
          },
          "terms": {
            "type": "array",
            "nullable": true,
            "minItems": 0,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The name of the term",
                  "example": "Effective Date"
                },
                "value": {
                  "type": "string",
                  "description": "The value of the term",
                  "example": "2022-12-25",
                  "nullable": true
                }
              }
            }
          }
        },
        "required": [
          "upload_id",
          "name",
          "file_name",
          "type",
          "status",
          "url",
          "tags",
          "terms",
          "parent_agreement_id"
        ]
      },
      "AnalyzeCreateAgreementAttachment": {
        "type": "object",
        "required": ["attachment_upload_url"],
        "properties": {
          "attachment_upload_url": {
            "type": "string"
          }
        }
      },
      "AnalyzeAgreementType": {
        "type": "object",
        "required": ["id", "name", "is_smart"],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "is_smart": {
            "type": "boolean"
          }
        }
      },
      "AnalyzeClause": {
        "type": "object",
        "required": [
          "id",
          "name",
          "text",
          "clause_category_id",
          "note",
          "agreement_id",
          "author_name",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "clause_category_id": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "agreement_id": {
            "type": "string"
          },
          "author_name": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        }
      },
      "AnalyzeClauseCategory": {
        "type": "object",
        "required": ["id", "name", "created_at", "updated_at"],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        }
      },
      "AnalyzeUpload": {
        "type": "object",
        "properties": {
          "upload_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of Upload",
            "example": "0d797b42-15f7-11ee-ae77-67008a40b00c"
          },
          "status": {
            "type": "string",
            "description": "Status of the Upload",
            "example": "success"
          },
          "agreement_id": {
            "type": "string",
            "format": "uuid",
            "description": "UUID of the related Agreement"
          },
          "updated_date": {
            "type": "string",
            "description": "Last Updated Date of the Upload",
            "example": "2022-10-23"
          },
          "message": {
            "type": "string",
            "nullable": true,
            "description": "Additional information about the Upload status",
            "example": "2021-09-23"
          }
        },
        "required": [
          "upload_id",
          "status",
          "agreement_id",
          "updated_date",
          "message"
        ]
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "name": "x-api-key",
        "in": "header"
      }
    }
  }
}
