← Files Glomiq Legal DocumentsARCHIVED FILE

openapi.json

6.72 KB · Nov 3, 2026 · 00:14 UTC

↓ Download file

{
  "openapi": "3.0.1",
  "info": {
    "title": "Glomiq Contract & Document Automation API",
    "description": "Transforms conversational terms and variables into professionally formatted, ready-to-sign Word (.docx) and PDF contracts, agreements, and legal documents.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://glomiq.com"
    }
  ],
  "paths": {
    "/api/integrations/chatgpt/templates": {
      "get": {
        "summary": "List available legal, HR, and business contract templates",
        "description": "Retrieves the public catalog of contract templates with their required variable keys (e.g. mutual NDA, consulting agreement, employment agreement, rental agreement).",
        "operationId": "getTemplates",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Filter by template category (Legal, HR, Finance)",
            "schema": {
              "type": "string",
              "enum": ["Legal", "HR", "Finance"]
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "description": "Filter by jurisdiction region (Global or India)",
            "schema": {
              "type": "string",
              "enum": ["Global", "India"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of available templates with required variable fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": { "type": "integer" },
                    "templates": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": { "type": "string" },
                          "title": { "type": "string" },
                          "category": { "type": "string" },
                          "region": { "type": "string" },
                          "description": { "type": "string" },
                          "requiredVariables": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": { "type": "string" },
                                "label": { "type": "string" },
                                "isDate": { "type": "boolean" },
                                "isAmount": { "type": "boolean" }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations/chatgpt/draft": {
      "post": {
        "summary": "Draft a contract or agreement from conversational variables",
        "description": "Generates a formatted draft from a selected template with user variables applied, returning a live interactive preview link and clause summary.",
        "operationId": "draftContract",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["templateSlug"],
                "properties": {
                  "templateSlug": {
                    "type": "string",
                    "description": "The slug of the template to instantiate (e.g. mutual-nda, freelance-contract, residential-rental-agreement)",
                    "example": "mutual-nda"
                  },
                  "title": {
                    "type": "string",
                    "description": "Optional custom document title",
                    "example": "Mutual NDA - Acme Corp & Beta LLC"
                  },
                  "jurisdiction": {
                    "type": "string",
                    "description": "Governing state, country, or jurisdiction for legal clauses (e.g. State of Delaware, California, United Kingdom, Karnataka)",
                    "example": "State of Delaware, USA"
                  },
                  "variables": {
                    "type": "object",
                    "description": "Key-value dictionary of template variables extracted from the user conversation",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "example": {
                      "PARTY_A_NAME": "Acme Corporation Inc.",
                      "PARTY_B_NAME": "Beta Global Technologies LLC",
                      "DATE": "October 20, 2026",
                      "TERM_MONTHS": "24"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Draft created successfully with interactive preview link",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": { "type": "boolean" },
                    "templateSlug": { "type": "string" },
                    "title": { "type": "string" },
                    "previewUrl": {
                      "type": "string",
                      "format": "uri",
                      "description": "Live interactive link where the user can inspect the document, edit variables, and export clean files."
                    },
                    "summary": { "type": "string" },
                    "details": {
                      "type": "object",
                      "properties": {
                        "category": { "type": "string" },
                        "region": { "type": "string" },
                        "populatedFields": {
                          "type": "array",
                          "items": { "type": "string" }
                        },
                        "missingFields": {
                          "type": "array",
                          "items": { "type": "string" }
                        },
                        "jurisdiction": { "type": "string" }
                      }
                    },
                    "claimInstructions": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid payload or missing templateSlug"
          },
          "404": {
            "description": "Requested templateSlug not found"
          }
        }
      }
    }
  }
}

SHA-256: 66172970fe6e96d4e3746639afb1c0dfcbc2dd1308fa21e4bc4a407084897c0f