{
  "openapi": "3.0.3",
  "info": {
    "title": "Australian Company Licence Records & Changes",
    "version": "1.0.0",
    "description": "Independent, company-only, best-effort API derived from ASIC point-in-time datasets. Exact identifiers only. It never returns named natural-person records and provides no SLA, legal conclusion or compliance decision.\n\nAccess: subscribe through RapidAPI, then send both x-rapidapi-key and x-rapidapi-host. Never publish a consumer key.\n\nContains information provided by the Australian Securities and Investments Commission (ASIC), modified by Orgorin, under the Creative Commons Attribution 3.0 Australia licence: http://creativecommons.org/licenses/by/3.0/au/. Sources: https://data.gov.au/data/dataset/asic-afs-licensee, https://data.gov.au/data/dataset/asic-credit-licensee, and https://data.gov.au/data/dataset/asic-companies. Modifications include selected company-only fields, exact identifier matching, normalised labels, versioned snapshots and change events. ASIC has not endorsed this API."
  },
  "servers": [
    {
      "url": "https://australian-company-licence-records-changes.p.rapidapi.com",
      "description": "RapidAPI gateway"
    }
  ],
  "paths": {
    "/v1/meta": {
      "get": {
        "operationId": "getSnapshotMetadata",
        "summary": "Get snapshot, source-health and scope metadata",
        "responses": {
          "200": {
            "description": "Last-known-good company-only snapshot metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/RapidApiRejected"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/RapidApiHost"
          }
        ]
      }
    },
    "/v1/licences/afs/{licence_number}": {
      "get": {
        "operationId": "getAfsLicence",
        "summary": "Look up an AFS licence number for an ASIC company",
        "description": "Returns a result only when the licence row matches an APTY/APUB company by exact ABN or ACN. AFS source presence means present in ASIC's current AFS licensee snapshot; it is not a separate status code.",
        "parameters": [
          {
            "$ref": "#/components/parameters/RapidApiHost"
          },
          {
            "$ref": "#/components/parameters/LicenceNumber"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/LicenceLookup"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/RapidApiRejected"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/licences/credit/{licence_number}": {
      "get": {
        "operationId": "getCreditLicence",
        "summary": "Look up a credit licence number for an ASIC company",
        "description": "Returns source status APPR (Approved) or SUSP (Suspended) only when the licence row matches an APTY/APUB company by exact ABN or ACN.",
        "parameters": [
          {
            "$ref": "#/components/parameters/RapidApiHost"
          },
          {
            "$ref": "#/components/parameters/LicenceNumber"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/LicenceLookup"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/RapidApiRejected"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/companies/acn/{acn}": {
      "get": {
        "operationId": "getCompanyByAcn",
        "summary": "Look up company registration data and matching licences by exact ACN",
        "parameters": [
          {
            "$ref": "#/components/parameters/RapidApiHost"
          },
          {
            "name": "acn",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{9}$"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CompanyLookup"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/RapidApiRejected"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/companies/abn/{abn}": {
      "get": {
        "operationId": "getCompanyByAbn",
        "summary": "Look up company registration data and matching licences by exact ABN",
        "description": "Company Dataset coverage only; this does not search sole traders, partnerships or the full Australian Business Register.",
        "parameters": [
          {
            "$ref": "#/components/parameters/RapidApiHost"
          },
          {
            "name": "abn",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]{11}$"
            }
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/CompanyLookup"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/RapidApiRejected"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/v1/changes": {
      "get": {
        "operationId": "listSnapshotChanges",
        "summary": "Read retained company-licence snapshot changes",
        "parameters": [
          {
            "$ref": "#/components/parameters/RapidApiHost"
          },
          {
            "name": "since",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "description": "RFC 3339 timestamp or YYYY-MM-DD"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "afs",
                "credit"
              ],
              "default": "all"
            }
          },
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Cursor"
          }
        ],
        "responses": {
          "200": {
            "description": "Company-only added/changed/removed-from-snapshot events",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ChangeEvent"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/RapidApiRejected"
          },
          "409": {
            "$ref": "#/components/responses/CursorExpired"
          },
          "410": {
            "description": "Requested history is no longer retained"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "LicenceNumber": {
        "name": "licence_number",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{1,9}$"
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "default": 50
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "schema": {
          "type": "string",
          "maxLength": 4096
        }
      },
      "RapidApiHost": {
        "name": "x-rapidapi-host",
        "in": "header",
        "required": true,
        "description": "RapidAPI gateway host for this API.",
        "schema": {
          "type": "string",
          "enum": [
            "australian-company-licence-records-changes.p.rapidapi.com"
          ],
          "default": "australian-company-licence-records-changes.p.rapidapi.com"
        },
        "example": "australian-company-licence-records-changes.p.rapidapi.com"
      }
    },
    "responses": {
      "LicenceLookup": {
        "description": "Exact company-only licence result; empty does not prove invalidity or cessation",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "results": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LicenceRecord"
                  }
                }
              }
            }
          }
        }
      },
      "CompanyLookup": {
        "description": "Exact company registration record with matching company-only licences",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "companies": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CompanyRecord"
                  }
                },
                "afsLicences": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LicenceRecord"
                  }
                },
                "creditLicences": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/LicenceRecord"
                  }
                }
              }
            }
          }
        }
      },
      "BadRequest": {
        "description": "Invalid parameter",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "CursorExpired": {
        "description": "Cursor does not match the current snapshot/query",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "Provider secret, storage, complete snapshot, upstream source or required shard is unavailable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RapidApiRejected": {
        "description": "RapidAPI rejected missing or invalid consumer authentication headers.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object"
            }
          }
        }
      }
    },
    "schemas": {
      "CompanyRecord": {
        "type": "object",
        "required": [
          "acn",
          "abn",
          "name",
          "typeCode",
          "classCode",
          "subClassCode",
          "statusCode",
          "statusLabel",
          "registrationDate",
          "deregistrationDate"
        ],
        "properties": {
          "acn": {
            "type": "string",
            "pattern": "^[0-9]{9}$"
          },
          "abn": {
            "type": "string",
            "pattern": "^[0-9]{11}$",
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "ASIC legal-company name; not a natural-person record."
          },
          "typeCode": {
            "type": "string",
            "enum": [
              "APTY",
              "APUB"
            ]
          },
          "classCode": {
            "type": "string"
          },
          "subClassCode": {
            "type": "string"
          },
          "statusCode": {
            "type": "string"
          },
          "statusLabel": {
            "type": "string"
          },
          "registrationDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "deregistrationDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          }
        }
      },
      "LicenceRecord": {
        "type": "object",
        "required": [
          "kind",
          "recordKey",
          "licenceNumber",
          "sourceStatusCode",
          "sourceStatusLabel",
          "issuedDate",
          "ceasedDate",
          "linkedAfslNumber",
          "company"
        ],
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "afs",
              "credit"
            ]
          },
          "recordKey": {
            "type": "string"
          },
          "licenceNumber": {
            "type": "string"
          },
          "sourceStatusCode": {
            "type": "string"
          },
          "sourceStatusLabel": {
            "type": "string"
          },
          "issuedDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "ceasedDate": {
            "type": "string",
            "format": "date",
            "nullable": true
          },
          "linkedAfslNumber": {
            "type": "string",
            "nullable": true
          },
          "company": {
            "$ref": "#/components/schemas/CompanyRecord"
          }
        }
      },
      "ChangeEvent": {
        "type": "object",
        "required": [
          "changeType",
          "kind",
          "recordKey",
          "sourceSnapshot",
          "observedAt",
          "before",
          "after"
        ],
        "properties": {
          "changeType": {
            "type": "string",
            "enum": [
              "added_to_snapshot",
              "changed_in_snapshot",
              "removed_from_snapshot"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "afs",
              "credit"
            ]
          },
          "recordKey": {
            "type": "string"
          },
          "sourceSnapshot": {
            "type": "string"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "before": {
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenceRecord"
              }
            ],
            "nullable": true
          },
          "after": {
            "type": "object",
            "allOf": [
              {
                "$ref": "#/components/schemas/LicenceRecord"
              }
            ],
            "nullable": true
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "RapidApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-rapidapi-key",
        "description": "RapidAPI consumer key. Subscribe to this API on RapidAPI before calling it."
      }
    }
  },
  "security": [
    {
      "RapidApiKey": []
    }
  ]
}
