{
 "openapi": "3.1.0",
 "info": {
  "title": "EnemoAi Data API",
  "version": "1",
  "description": "Send your business's own data to EnemoAi so its answers, cash forecast and warnings use your figures. EnemoAi only reads this data: it never moves money or acts on an account. Scopes per data type: accounts, transactions, ledger, invoices, bills, payroll, sales, inventory, counterparties, kpis, documents."
 },
 "servers": [
  {
   "url": "https://api.enemo.ai"
  }
 ],
 "security": [
  {
   "bearer": []
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "description": "An org API key (eai_live_…) from Account → Your business data."
   }
  },
  "schemas": {
   "Error": {
    "type": "object",
    "properties": {
     "detail": {
      "type": "string"
     },
     "errors": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "index": {
         "type": "integer"
        },
        "external_id": {
         "type": [
          "string",
          "null"
         ]
        },
        "field": {
         "type": [
          "string",
          "null"
         ]
        },
        "message": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "UpsertResult": {
    "type": "object",
    "properties": {
     "type": {
      "type": "string"
     },
     "schema_version": {
      "type": "integer"
     },
     "received": {
      "type": "integer"
     },
     "created": {
      "type": "integer"
     },
     "updated": {
      "type": "integer"
     },
     "idempotent_replay": {
      "type": "boolean"
     }
    }
   },
   "Deletes": {
    "type": "object",
    "required": [
     "external_ids"
    ],
    "properties": {
     "external_ids": {
      "type": "array",
      "maxItems": 1000,
      "items": {
       "type": "string"
      }
     }
    }
   },
   "Accounts": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "name",
     "type",
     "balance",
     "balance_as_of"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "name": {
      "type": "string",
      "maxLength": 200
     },
     "type": {
      "type": "string",
      "enum": [
       "bank",
       "card",
       "loan",
       "credit_line",
       "investment",
       "other"
      ]
     },
     "institution": {
      "type": "string",
      "maxLength": 200
     },
     "last4": {
      "type": "string",
      "pattern": "^[0-9]{4}$",
      "description": "Only the last 4 digits; never a full number."
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "default": "USD"
     },
     "balance": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "balance_as_of": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "available": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "credit_limit": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "interest_rate_pct": {
      "type": "number"
     },
     "rate_type": {
      "type": "string",
      "enum": [
       "fixed",
       "floating"
      ]
     },
     "maturity_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "payment_amount": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "payment_due_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "payment_frequency": {
      "type": "string",
      "enum": [
       "weekly",
       "biweekly",
       "monthly",
       "quarterly",
       "annual"
      ]
     },
     "covenants": {
      "type": "array",
      "maxItems": 20,
      "items": {
       "type": "object",
       "required": [
        "name",
        "metric",
        "threshold"
       ],
       "additionalProperties": false,
       "properties": {
        "name": {
         "type": "string"
        },
        "metric": {
         "type": "string",
         "enum": [
          "min_cash",
          "min_liquidity",
          "max_utilization",
          "max_leverage",
          "min_dscr",
          "min_current_ratio",
          "min_ebitda",
          "other"
         ]
        },
        "threshold": {
         "type": "number",
         "description": "Dollars for min_cash/min_liquidity; percent for max_utilization; a ratio otherwise."
        },
        "test_date": {
         "type": "string",
         "format": "date"
        },
        "current_value": {
         "type": "number"
        },
        "frequency": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "Transactions": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "date",
     "amount"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "account_external_id": {
      "type": "string",
      "maxLength": 200
     },
     "date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "amount": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "description": {
      "type": "string",
      "maxLength": 2000
     },
     "counterparty": {
      "type": "string",
      "maxLength": 200
     },
     "category": {
      "type": "string",
      "maxLength": 200
     },
     "status": {
      "type": "string",
      "enum": [
       "posted",
       "pending"
      ]
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "default": "USD"
     }
    }
   },
   "GlEntries": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "date",
     "account_code"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "account_code": {
      "type": "string",
      "maxLength": 200
     },
     "account_name": {
      "type": "string",
      "maxLength": 200
     },
     "debit": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "credit": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "memo": {
      "type": "string",
      "maxLength": 2000
     },
     "journal_id": {
      "type": "string",
      "maxLength": 200
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "default": "USD"
     }
    }
   },
   "ChartOfAccounts": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "code",
     "name",
     "type"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "code": {
      "type": "string",
      "maxLength": 200
     },
     "name": {
      "type": "string",
      "maxLength": 200
     },
     "type": {
      "type": "string",
      "enum": [
       "asset",
       "liability",
       "equity",
       "income",
       "cogs",
       "expense",
       "other"
      ]
     },
     "parent_code": {
      "type": "string",
      "maxLength": 200
     }
    }
   },
   "Invoices": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "customer",
     "issue_date",
     "due_date",
     "amount",
     "balance_due"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "number": {
      "type": "string",
      "maxLength": 200
     },
     "customer": {
      "type": "string",
      "maxLength": 200
     },
     "issue_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "amount": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "balance_due": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "default": "USD"
     },
     "status": {
      "type": "string",
      "enum": [
       "draft",
       "open",
       "partial",
       "paid",
       "void",
       "written_off"
      ]
     },
     "paid_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     }
    }
   },
   "Bills": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "supplier",
     "issue_date",
     "due_date",
     "amount",
     "balance_due"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "number": {
      "type": "string",
      "maxLength": 200
     },
     "supplier": {
      "type": "string",
      "maxLength": 200
     },
     "issue_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "due_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "amount": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "balance_due": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "default": "USD"
     },
     "status": {
      "type": "string",
      "enum": [
       "draft",
       "open",
       "partial",
       "paid",
       "void"
      ]
     },
     "paid_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "category": {
      "type": "string",
      "maxLength": 200
     }
    }
   },
   "Payroll": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "period_start",
     "period_end",
     "pay_date",
     "gross_wages"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "period_start": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "period_end": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "pay_date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "gross_wages": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "employer_taxes": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "benefits": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "net_pay_total": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "headcount": {
      "type": "integer",
      "minimum": 0
     },
     "contractors_total": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "department": {
      "type": "string",
      "maxLength": 200
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "default": "USD"
     }
    }
   },
   "Sales": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "date",
     "amount"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "amount": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "channel": {
      "type": "string",
      "maxLength": 200
     },
     "category": {
      "type": "string",
      "maxLength": 200
     },
     "product": {
      "type": "string",
      "maxLength": 200
     },
     "quantity": {
      "type": "number"
     },
     "customer": {
      "type": "string",
      "maxLength": 200
     },
     "status": {
      "type": "string",
      "enum": [
       "completed",
       "refunded",
       "pending"
      ]
     },
     "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$",
      "default": "USD"
     }
    }
   },
   "Inventory": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "sku",
     "as_of",
     "quantity"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "sku": {
      "type": "string",
      "maxLength": 200
     },
     "name": {
      "type": "string",
      "maxLength": 200
     },
     "as_of": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "quantity": {
      "type": "number"
     },
     "unit_cost": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "value": {
      "oneOf": [
       {
        "type": "number"
       },
       {
        "type": "string",
        "pattern": "^-?[0-9,]+(\\.[0-9]+)?$"
       }
      ],
      "description": "U.S. dollars, e.g. 1234.56 or \"1234.56\". Stored to the cent."
     },
     "location": {
      "type": "string",
      "maxLength": 200
     },
     "reorder_point": {
      "type": "number"
     }
    }
   },
   "Counterparties": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "name",
     "role"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "name": {
      "type": "string",
      "maxLength": 200
     },
     "role": {
      "type": "string",
      "enum": [
       "customer",
       "supplier",
       "lender",
       "landlord",
       "partner",
       "other"
      ]
     },
     "entity_type": {
      "type": "string",
      "enum": [
       "business",
       "government",
       "nonprofit"
      ]
     },
     "state": {
      "type": "string",
      "maxLength": 200
     },
     "country": {
      "type": "string",
      "maxLength": 200
     },
     "website": {
      "type": "string",
      "maxLength": 200
     }
    }
   },
   "Kpis": {
    "type": "object",
    "additionalProperties": false,
    "required": [
     "external_id",
     "series",
     "date",
     "value"
    ],
    "properties": {
     "external_id": {
      "type": "string",
      "maxLength": 200
     },
     "series": {
      "type": "string",
      "maxLength": 200
     },
     "date": {
      "type": "string",
      "format": "date",
      "examples": [
       "2026-11-01"
      ]
     },
     "value": {
      "type": "number"
     },
     "unit": {
      "type": "string",
      "maxLength": 200
     }
    }
   },
   "Batch": {
    "type": "object",
    "required": [
     "records"
    ],
    "properties": {
     "schema_version": {
      "type": "integer",
      "const": 1
     },
     "records": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1000,
      "items": {
       "oneOf": [
        {
         "$ref": "#/components/schemas/Accounts"
        },
        {
         "$ref": "#/components/schemas/Transactions"
        },
        {
         "$ref": "#/components/schemas/GlEntries"
        },
        {
         "$ref": "#/components/schemas/ChartOfAccounts"
        },
        {
         "$ref": "#/components/schemas/Invoices"
        },
        {
         "$ref": "#/components/schemas/Bills"
        },
        {
         "$ref": "#/components/schemas/Payroll"
        },
        {
         "$ref": "#/components/schemas/Sales"
        },
        {
         "$ref": "#/components/schemas/Inventory"
        },
        {
         "$ref": "#/components/schemas/Counterparties"
        },
        {
         "$ref": "#/components/schemas/Kpis"
        }
       ]
      },
      "description": "Records of the type named in the path; all are validated before any is stored."
     }
    }
   }
  }
 },
 "paths": {
  "/v1/data/schemas": {
   "get": {
    "summary": "Every data type and its fields (no key needed)",
    "security": [],
    "responses": {
     "200": {
      "description": "Schemas"
     }
    }
   }
  },
  "/v1/data/whoami": {
   "get": {
    "summary": "The key's name and scopes",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/data/documents": {
   "post": {
    "summary": "Add or replace a document (contract, board deck, loan agreement…) by external_id",
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "file",
         "external_id"
        ],
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         },
         "external_id": {
          "type": "string"
         },
         "doc_type": {
          "type": "string",
          "enum": [
           "contract",
           "board_deck",
           "financial_statement",
           "loan_agreement",
           "policy",
           "other"
          ]
         },
         "title": {
          "type": "string"
         },
         "date": {
          "type": "string",
          "format": "date"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Stored"
     },
     "401": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "415": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "summary": "List documents",
    "responses": {
     "200": {
      "description": "Documents"
     }
    }
   }
  },
  "/v1/data/documents/{external_id}": {
   "delete": {
    "summary": "Delete a document",
    "parameters": [
     {
      "name": "external_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Deleted"
     }
    }
   }
  },
  "/v1/data/{kind}": {
   "post": {
    "summary": "Upsert a batch by external_id (all or nothing)",
    "parameters": [
     {
      "name": "kind",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "accounts",
        "transactions",
        "gl_entries",
        "chart_of_accounts",
        "invoices",
        "bills",
        "payroll",
        "sales",
        "inventory",
        "counterparties",
        "kpis"
       ]
      }
     },
     {
      "name": "Idempotency-Key",
      "in": "header",
      "required": false,
      "schema": {
       "type": "string",
       "maxLength": 200
      },
      "description": "Retries with the same key and body return the first result; a different body is a 409."
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Batch"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Stored",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/UpsertResult"
        }
       }
      }
     },
     "400": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "429": {
      "description": "Problem",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "get": {
    "summary": "List what EnemoAi holds of this type",
    "parameters": [
     {
      "name": "kind",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "accounts",
        "transactions",
        "gl_entries",
        "chart_of_accounts",
        "invoices",
        "bills",
        "payroll",
        "sales",
        "inventory",
        "counterparties",
        "kpis"
       ]
      }
     },
     {
      "name": "limit",
      "in": "query",
      "schema": {
       "type": "integer",
       "maximum": 1000
      }
     },
     {
      "name": "cursor",
      "in": "query",
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "updated_since",
      "in": "query",
      "schema": {
       "type": "string",
       "format": "date"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Records"
     }
    }
   },
   "delete": {
    "summary": "Delete by external_id",
    "parameters": [
     {
      "name": "kind",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "accounts",
        "transactions",
        "gl_entries",
        "chart_of_accounts",
        "invoices",
        "bills",
        "payroll",
        "sales",
        "inventory",
        "counterparties",
        "kpis"
       ]
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Deletes"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Deleted"
     }
    }
   }
  },
  "/v1/data/{kind}/delete": {
   "post": {
    "summary": "Delete by external_id (for clients that can't send a body with DELETE)",
    "parameters": [
     {
      "name": "kind",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "accounts",
        "transactions",
        "gl_entries",
        "chart_of_accounts",
        "invoices",
        "bills",
        "payroll",
        "sales",
        "inventory",
        "counterparties",
        "kpis"
       ]
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/Deletes"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Deleted"
     }
    }
   }
  },
  "/v1/data/{kind}/{external_id}": {
   "delete": {
    "summary": "Delete one record",
    "parameters": [
     {
      "name": "kind",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "accounts",
        "transactions",
        "gl_entries",
        "chart_of_accounts",
        "invoices",
        "bills",
        "payroll",
        "sales",
        "inventory",
        "counterparties",
        "kpis"
       ]
      }
     },
     {
      "name": "external_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Deleted"
     }
    }
   }
  }
 }
}
