{
  "openapi": "3.0.3",
  "info": {
    "title": "OTB Studio API",
    "version": "1.0.0",
    "description": "The Belgian company register over REST: search, profiles, ownership, filed financials and mandates. Every route needs an `otb_live_` token, and every served reply is charged in credits for the datapoints it carries."
  },
  "servers": [
    {
      "url": "https://api.otbstudio.ai"
    }
  ],
  "security": [
    {
      "token": []
    }
  ],
  "tags": [
    {
      "name": "Companies",
      "description": "One company register, read five ways."
    }
  ],
  "paths": {
    "/v1/companies": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "searchCompanies",
        "summary": "Search companies",
        "description": "Finds companies by name. A match is deliberately thin: pick the one you mean and fetch its profile by enterprise number. Legal, commercial, Dutch and French names are all searched.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "The name to search for.",
            "schema": {
              "type": "string"
            },
            "example": "noordkaap"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many matches to return, 1 to 25. A missing, zero, negative or larger value gives 10.",
            "schema": {
              "type": "integer",
              "default": 10
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The matches, best first. An empty list when nothing matched.",
            "headers": {
              "X-Credits-Cost": {
                "$ref": "#/components/headers/X-Credits-Cost"
              },
              "X-Credits-Remaining": {
                "$ref": "#/components/headers/X-Credits-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchReply"
                },
                "example": {
                  "companies": [
                    {
                      "enterpriseNumber": "BE0734567835",
                      "name": "Noordkaap Warehousing",
                      "employees": 214,
                      "statusCode": "AC"
                    },
                    {
                      "enterpriseNumber": "BE0712345630",
                      "name": "Noordkaap Logistics",
                      "employees": 187,
                      "statusCode": "AC"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "`q` is missing or blank.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueryRequired"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Busy"
          }
        }
      }
    },
    "/v1/companies/{id}": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompany",
        "summary": "Get a company",
        "description": "One company's profile: names, status, legal form, address, contact details, activities, the newest filed figures, and flags saying which other datasets exist for it.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "The profile.",
            "headers": {
              "X-Credits-Cost": {
                "$ref": "#/components/headers/X-Credits-Cost"
              },
              "X-Credits-Remaining": {
                "$ref": "#/components/headers/X-Credits-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Profile"
                },
                "example": {
                  "enterpriseNumber": "BE0712345630",
                  "nameNl": "Noordkaap Logistics",
                  "statusCode": "AC",
                  "juridicalFormCode": "014",
                  "juridicalSituationCode": "000",
                  "typeOfEnterpriseCode": "2",
                  "deleted": false,
                  "startDate": "1998-06-15",
                  "street": "Kaaiweg 14",
                  "zipCode": "9000",
                  "city": "Gent",
                  "website": "noordkaap.example",
                  "activities": "MAIN :: 006 :: 2025 :: 49410;MAIN :: 001 :: 2025 :: 52100",
                  "financials": {
                    "closingDate": "2025-03-31",
                    "reference": "2025-00184417",
                    "schemaType": "full",
                    "employees": 186.4,
                    "equity": 12480310.52,
                    "operatingIncome": 3912774.18,
                    "ebitda": 5240118.66,
                    "resultForPeriod": 2731905.07,
                    "healthIndicator": 10
                  },
                  "has": {
                    "annualAccounts": true,
                    "participations": true,
                    "accountants": true,
                    "valuations": false,
                    "socialBalances": true
                  },
                  "snapshotDate": "2026-04-29"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Busy"
          }
        }
      }
    },
    "/v1/companies/{id}/ownership": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompanyOwnership",
        "summary": "Get ownership",
        "description": "Who holds a stake in this company, and the stakes it holds in others. Both directions use one shape, and every other party's enterprise number can go straight back into this route, so a chain can be walked.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          }
        ],
        "responses": {
          "200": {
            "description": "Both directions. Either list may be empty.",
            "headers": {
              "X-Credits-Cost": {
                "$ref": "#/components/headers/X-Credits-Cost"
              },
              "X-Credits-Remaining": {
                "$ref": "#/components/headers/X-Credits-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ownership"
                },
                "example": {
                  "enterpriseNumber": "BE0712345630",
                  "shareholders": [
                    {
                      "name": "Noordkaap Holding NV",
                      "enterpriseNumber": "BE0723456781",
                      "stakePercent": 72.5,
                      "shareClass": "Gewone aandelen",
                      "asOf": "2025-03-31",
                      "sourceReference": "2025-00184417",
                      "sourceSystem": "NBB",
                      "exact": true
                    }
                  ],
                  "participations": [
                    {
                      "name": "Noordkaap Warehousing",
                      "enterpriseNumber": "BE0734567835",
                      "stakePercent": 100,
                      "asOf": "2025-03-31",
                      "sourceReference": "2025-00184417",
                      "sourceSystem": "NBB",
                      "exact": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Busy"
          }
        }
      }
    },
    "/v1/companies/{id}/financials": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompanyFinancials",
        "summary": "Get filed financials",
        "description": "The filed figures, one row per accounting period, newest first. A correction replaces the filing it corrects and is flagged rather than hidden. Each period is charged, so ten years cost ten times one.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "years",
            "in": "query",
            "required": false,
            "description": "How many periods to return, 1 to 20. A missing, zero, negative or larger value gives 10.",
            "schema": {
              "type": "integer",
              "default": 10
            }
          },
          {
            "name": "detail",
            "in": "query",
            "required": false,
            "description": "`true` adds the cash flow statement and the named balance sheet lines to every period.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The periods. An empty list when the company has filed nothing.",
            "headers": {
              "X-Credits-Cost": {
                "$ref": "#/components/headers/X-Credits-Cost"
              },
              "X-Credits-Remaining": {
                "$ref": "#/components/headers/X-Credits-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FinancialsReply"
                },
                "example": {
                  "periods": [
                    {
                      "closingDate": "2025-03-31",
                      "reference": "2025-00184417",
                      "schemaType": "full",
                      "employees": 186.4,
                      "equity": 12480310.52,
                      "operatingIncome": 3912774.18,
                      "ebitda": 5240118.66,
                      "resultForPeriod": 2731905.07,
                      "healthIndicator": 10,
                      "cashFlow": {
                        "operating": 4410228.35,
                        "investing": -1876340.12,
                        "financing": -1504377.8,
                        "free": 2533888.23,
                        "cashAtPeriodEnd": 1388902.41,
                        "distributionsToOwners": 600000
                      },
                      "balanceSheet": {
                        "operatingProfit": 3480112.9,
                        "depreciation": 1328006.48,
                        "staffCosts": 9876540.21,
                        "totalAssets": 31902554.7,
                        "totalDebt": 8044120.33,
                        "interestPaid": 288410.12
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Busy"
          }
        }
      }
    },
    "/v1/companies/{id}/people": {
      "get": {
        "tags": [
          "Companies"
        ],
        "operationId": "getCompanyPeople",
        "summary": "Get people",
        "description": "Directors and other mandates filed against this company, current ones first, then the history. Political party, remuneration and home addresses are never returned, and people the source marks as hidden are left out.",
        "parameters": [
          {
            "$ref": "#/components/parameters/id"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many mandates to return, 1 to 200. A missing, zero, negative or larger value gives 50.",
            "schema": {
              "type": "integer",
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The mandates. An empty list when none are filed.",
            "headers": {
              "X-Credits-Cost": {
                "$ref": "#/components/headers/X-Credits-Cost"
              },
              "X-Credits-Remaining": {
                "$ref": "#/components/headers/X-Credits-Remaining"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PeopleReply"
                },
                "example": {
                  "people": [
                    {
                      "lastName": "Verhaegen",
                      "firstName": "Lotte",
                      "category": "ADMINISTER",
                      "role": "13",
                      "profession": "Gedelegeerd bestuurder",
                      "startDate": "2024-09-25",
                      "endDate": "2028-09-27",
                      "current": true,
                      "viaCompany": "Verhaegen Consult BV",
                      "viaEnterpriseNumber": "BE1023456797",
                      "sourceSystem": "NBB",
                      "sourceReference": "2025-00184417"
                    },
                    {
                      "lastName": "Peeters",
                      "firstName": "Luc",
                      "category": "OTHERMANDATE",
                      "role": "Aankoper",
                      "current": true,
                      "sourceSystem": "BSDM"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "500": {
            "$ref": "#/components/responses/Internal"
          },
          "503": {
            "$ref": "#/components/responses/Busy"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "token": {
        "type": "http",
        "scheme": "bearer",
        "description": "An `otb_live_` token, minted in the OTB Studio dashboard."
      }
    },
    "parameters": {
      "id": {
        "name": "id",
        "in": "path",
        "required": true,
        "description": "The enterprise number. `0712.345.630`, `BE 0712 345 630` and `BE0712345630` are all accepted.",
        "schema": {
          "type": "string"
        },
        "example": "BE0712345630"
      }
    },
    "headers": {
      "X-Credits-Cost": {
        "description": "What this reply cost, in credits.",
        "schema": {
          "type": "integer"
        }
      },
      "X-Credits-Remaining": {
        "description": "The balance after this reply.",
        "schema": {
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "No token, or a token that is not valid. `missing_token` when there is no `Authorization: Bearer` header, `invalid_token` when the token is unknown, revoked or of the wrong kind.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Unauthorized"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "The organisation has no plan, its balance is empty, or the balance does not cover this reply. When the reply was too expensive, the headers say what it would have cost and what is left.",
        "headers": {
          "X-Credits-Cost": {
            "$ref": "#/components/headers/X-Credits-Cost"
          },
          "X-Credits-Remaining": {
            "$ref": "#/components/headers/X-Credits-Remaining"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PaymentRequired"
            }
          }
        }
      },
      "NotFound": {
        "description": "No company has this enterprise number.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/NotFound"
            }
          }
        }
      },
      "RateLimited": {
        "description": "The organisation is over its rate (10 calls a second, bursts of 20) or has 4 calls running. Retry after `Retry-After`.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/RateLimited"
            }
          }
        }
      },
      "Internal": {
        "description": "Something failed on our side.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Internal"
            }
          }
        }
      },
      "Busy": {
        "description": "The data could not be read within 15 seconds. Retry after `Retry-After`.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Busy"
            }
          }
        }
      }
    },
    "schemas": {
      "SearchReply": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "companies"
        ],
        "properties": {
          "companies": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Match"
            }
          }
        }
      },
      "Match": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enterpriseNumber",
          "name"
        ],
        "properties": {
          "enterpriseNumber": {
            "type": "string",
            "description": "The key for every other route."
          },
          "name": {
            "type": "string",
            "description": "The name that matched, which is not always the one you know the company by."
          },
          "employees": {
            "type": "number",
            "description": "Average full-time equivalents over the newest accounting period, not headcount. It is not a whole number."
          },
          "statusCode": {
            "type": "string",
            "description": "The raw KBO/BCE status code, such as `AC` for active."
          }
        }
      },
      "Profile": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enterpriseNumber",
          "deleted",
          "has"
        ],
        "properties": {
          "enterpriseNumber": {
            "type": "string"
          },
          "nameNl": {
            "type": "string",
            "description": "The Dutch name."
          },
          "nameFr": {
            "type": "string",
            "description": "The French name."
          },
          "abbreviationNl": {
            "type": "string"
          },
          "commercialName": {
            "type": "string"
          },
          "statusCode": {
            "type": "string",
            "description": "Raw KBO/BCE code, unlabelled."
          },
          "juridicalFormCode": {
            "type": "string",
            "description": "Raw KBO/BCE code for the legal form, unlabelled."
          },
          "juridicalSituationCode": {
            "type": "string",
            "description": "Raw KBO/BCE code, unlabelled."
          },
          "typeOfEnterpriseCode": {
            "type": "string",
            "description": "Raw KBO/BCE code, unlabelled."
          },
          "deleted": {
            "type": "boolean",
            "description": "The company no longer exists. Returned rather than hidden."
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date"
          },
          "street": {
            "type": "string"
          },
          "zipCode": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "telephone": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "website": {
            "type": "string"
          },
          "activities": {
            "type": "string",
            "description": "A packed string: `MAIN :: 006 :: 2025 :: 58120`, repeated and separated by `;`. The last part is the NACE code and the third part is a year. The first two parts are source codes with no published meaning."
          },
          "financials": {
            "$ref": "#/components/schemas/Period"
          },
          "has": {
            "$ref": "#/components/schemas/Available"
          },
          "snapshotDate": {
            "type": "string",
            "format": "date",
            "description": "When this company was last refreshed from the source. Every answer is an answer as of a date."
          }
        }
      },
      "Available": {
        "type": "object",
        "additionalProperties": false,
        "description": "Which other datasets the source holds for this company. An upper bound: a true flag means the source has the dataset, not that a call will return rows.",
        "required": [
          "annualAccounts",
          "participations",
          "accountants",
          "valuations",
          "socialBalances"
        ],
        "properties": {
          "annualAccounts": {
            "type": "boolean",
            "description": "Readable through the financials route."
          },
          "participations": {
            "type": "boolean",
            "description": "Readable through the ownership route."
          },
          "accountants": {
            "type": "boolean",
            "description": "Filed, not served by this API yet."
          },
          "valuations": {
            "type": "boolean",
            "description": "Filed, not served by this API yet."
          },
          "socialBalances": {
            "type": "boolean",
            "description": "Filed, not served by this API yet."
          }
        }
      },
      "FinancialsReply": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "periods"
        ],
        "properties": {
          "periods": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Period"
            }
          }
        }
      },
      "Period": {
        "type": "object",
        "additionalProperties": false,
        "description": "One accounting period, as filed. Amounts are in euro.",
        "required": [
          "closingDate"
        ],
        "properties": {
          "closingDate": {
            "type": "string",
            "format": "date"
          },
          "reference": {
            "type": "string",
            "description": "The filing's reference at the National Bank of Belgium, so a figure can be checked against the source document."
          },
          "schemaType": {
            "type": "string",
            "description": "The filing schema, such as `full` or `abbreviated`. A company that changes schema reports a different level of detail."
          },
          "corrected": {
            "type": "boolean",
            "description": "This filing replaced an earlier one for the same period. It is the authoritative figure."
          },
          "comparative": {
            "type": "boolean",
            "description": "These figures come from the prior-year column of a later filing, not from a filing of their own. The reference cannot be looked up."
          },
          "employees": {
            "type": "number",
            "description": "Average full-time equivalents over the period, not headcount."
          },
          "equity": {
            "type": "number"
          },
          "operatingIncome": {
            "type": "number"
          },
          "ebitda": {
            "type": "number",
            "description": "The source's derived figure. Belgian annual accounts have no EBITDA line."
          },
          "resultForPeriod": {
            "type": "number"
          },
          "healthIndicator": {
            "type": "number",
            "description": "The source's score, a whole number from 1 to 10. The method is not published."
          },
          "cashFlow": {
            "$ref": "#/components/schemas/CashFlow"
          },
          "balanceSheet": {
            "$ref": "#/components/schemas/BalanceSheet"
          }
        }
      },
      "CashFlow": {
        "type": "object",
        "additionalProperties": false,
        "description": "The filed cash flow statement. Only with `detail=true`.",
        "properties": {
          "operating": {
            "type": "number"
          },
          "investing": {
            "type": "number"
          },
          "financing": {
            "type": "number"
          },
          "free": {
            "type": "number"
          },
          "cashAtPeriodEnd": {
            "type": "number"
          },
          "distributionsToOwners": {
            "type": "number",
            "description": "Dividends and other distributions to owners, as filed."
          }
        }
      },
      "BalanceSheet": {
        "type": "object",
        "additionalProperties": false,
        "description": "The balance sheet lines asked for by name. Only with `detail=true`.",
        "properties": {
          "operatingProfit": {
            "type": "number"
          },
          "depreciation": {
            "type": "number"
          },
          "staffCosts": {
            "type": "number"
          },
          "totalAssets": {
            "type": "number",
            "description": "The balance sheet total."
          },
          "totalDebt": {
            "type": "number"
          },
          "interestPaid": {
            "type": "number",
            "description": "The cost of debt for the period."
          }
        }
      },
      "Ownership": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enterpriseNumber",
          "shareholders",
          "participations"
        ],
        "properties": {
          "enterpriseNumber": {
            "type": "string"
          },
          "shareholders": {
            "type": "array",
            "description": "Stakes held in this company.",
            "items": {
              "$ref": "#/components/schemas/Stake"
            }
          },
          "participations": {
            "type": "array",
            "description": "Stakes this company holds in others.",
            "items": {
              "$ref": "#/components/schemas/Stake"
            }
          }
        }
      },
      "Stake": {
        "type": "object",
        "additionalProperties": false,
        "description": "One ownership link, read from either end.",
        "required": [
          "exact"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "The other party."
          },
          "enterpriseNumber": {
            "type": "string",
            "description": "The other party's number. Not always Belgian."
          },
          "stakePercent": {
            "type": "number",
            "description": "The direct stake, 50 for half."
          },
          "indirectPercent": {
            "type": "number",
            "description": "A stake held through another entity, on the same scale."
          },
          "shareClass": {
            "type": "string",
            "description": "The share class as filed, in the language it was filed in."
          },
          "asOf": {
            "type": "string",
            "format": "date",
            "description": "The end of the period the filing covers."
          },
          "sourceReference": {
            "type": "string",
            "description": "The filing the stake was read from."
          },
          "sourceSystem": {
            "type": "string",
            "description": "`NBB` for National Bank filings, whose references can be looked up."
          },
          "exact": {
            "type": "boolean",
            "description": "The source's own confidence that this link is precisely sourced. False is the sign of a stale or inferred entry."
          }
        }
      },
      "PeopleReply": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "people"
        ],
        "properties": {
          "people": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Mandate"
            }
          }
        }
      },
      "Mandate": {
        "type": "object",
        "additionalProperties": false,
        "description": "One role a person holds, or held, at this company.",
        "required": [
          "current"
        ],
        "properties": {
          "lastName": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "description": "`ADMINISTER`, `SHAREHOLDER`, `LOCALPOLITICALMANDATE` or `OTHERMANDATE`."
          },
          "role": {
            "type": "string",
            "description": "For `ADMINISTER`, an unlabelled source code such as `13`. For the other categories, the role in words, in the language it was filed in."
          },
          "profession": {
            "type": "string"
          },
          "startDate": {
            "type": "string",
            "format": "date"
          },
          "endDate": {
            "type": "string",
            "format": "date",
            "description": "Usually the end of the term, not the day the person left."
          },
          "current": {
            "type": "boolean",
            "description": "Whether the mandate is held today. Read this rather than the dates."
          },
          "viaCompany": {
            "type": "string",
            "description": "Set when the mandate is held through a company, with this person as its permanent representative."
          },
          "viaEnterpriseNumber": {
            "type": "string"
          },
          "sourceSystem": {
            "type": "string"
          },
          "sourceReference": {
            "type": "string"
          }
        }
      },
      "QueryRequired": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "query_required"
            ]
          }
        }
      },
      "Unauthorized": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "missing_token",
              "invalid_token"
            ]
          }
        }
      },
      "PaymentRequired": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "insufficient_credits"
            ]
          }
        }
      },
      "NotFound": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "not_found"
            ]
          }
        }
      },
      "RateLimited": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "rate_limited"
            ]
          }
        }
      },
      "Internal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "internal"
            ]
          }
        }
      },
      "Busy": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code"
        ],
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "busy"
            ]
          }
        }
      }
    }
  }
}
