Color theme

OpenAPI

The API's contract, as a document your tools can read.

The document

The API publishes its contract as an OpenAPI 3.1 document. It needs no API key:

https://api.swite.co/v1/openapi.json

It is built from the same code that answers requests, so it lists exactly what the API accepts and returns: every endpoint, every field, every error. Each operation has an operationId, such as leads.create, and each schema a name, such as Lead.

Use it

  • Explore the API in the interactive reference at api.swite.co/docs, where you can send requests with your own key.
  • Import it into Postman, Insomnia or Bruno to get every request ready to send.
  • Generate a client in your language with a generator such as OpenAPI Generator. Its methods and types take their names from the operationIds and schema names.

Versions

The version is in the path: /v1. Within v1 the contract only grows: new endpoints, new optional fields and new error codes. A field, an endpoint or a code is never renamed or removed, and a request that works today keeps working.

Write your code to allow that growth: ignore fields you do not know, and treat an error code you do not know by its status.