
How an API works
An API defines which questions one program may ask another and in what form the answer comes back. You can think of it as the counter at a public office: anyone who wants something fills in a specific form, hands it in at the right counter and receives an answer in a known format. Nobody needs to know what happens behind the counter, which database is used or how the files are organised.
Technically, every call consists of a request and a response. The request names an address (the so-called endpoint), an action such as “read” or “create” and, where necessary, data. The response contains the requested data or an error message with a status code. Because both are precisely described, programs from different vendors can work together as long as they stick to the description.
- Request
The program sends a request to the endpoint, for example “give me all contacts that have changed since yesterday”.
- Check
The other side checks the key sent along with it: is it valid, and is it allowed to read this data?
- Processing
Only then is the data looked up or the action carried out.
- Response
The response comes back in a structured form, usually in JSON format, with a status code such as 200 for “OK” or 403 for “no permission”.
REST API: the usual form on the web
Most business applications now offer a REST API. REST is not a program but a design principle: every type of record has its own address, and the action follows from the HTTP method. The same technology a browser uses to load web pages thus also carries business data. That makes REST APIs easy to test and usable with almost any programming language.
| Method | Meaning | Example |
|---|---|---|
| GET | Read data | Fetch the list of open invoices |
| POST | Create a new record | Record a lead from a web form |
| PATCH or PUT | Change an existing record | Correct a contact’s phone number |
| DELETE | Delete a record | Remove a test entry |
Besides REST there are other forms, such as GraphQL, where the caller orders exactly the fields it needs, or older SOAP interfaces using XML, which are still found in banking and government environments. For connections between SME programs, REST is the norm. It is often complemented by webhooks, which do not wait for a request but report an event of their own accord.
Security: keys, permissions and limits
An API opens a route to business data. Access is therefore at least as important as the technology. Good interfaces work with keys that have only the permissions a connection really needs: a web form that delivers leads does not need to be able to read invoices. Connections made on behalf of a person, such as an AI assistant, often use OAuth instead of a fixed key, so that the person grants access themselves and can withdraw it again.
- One key per connection: If a connection is no longer needed, only that key is deleted.
- Least privilege: Grant read and write permissions separately and only open the areas that are needed.
- HTTPS only: Keys and data are transmitted in encrypted form.
- Expiry date and limits: Keys with a validity date and a cap on calls per minute protect against misuse.
- Never put keys in emails or spreadsheets: Anyone who knows a key has its permissions.
In Switzerland, the Federal Act on Data Protection (FADP, in German DSG) applies to personal data even when it flows through an API. Anyone passing customer data to another program should know where that program stores the data and what it uses it for.
How to recognise a good API
Whether a program is easy to connect to shows not in its advertising but in its documentation. Before a business introduces a program that other systems are later meant to dock onto, a quick look behind the scenes is worthwhile. The following points help even people without programming knowledge to assess the quality of an interface.
- Public documentation: All endpoints, fields and error codes are described, with examples of requests and responses.
- Fine-grained permissions: Keys can be limited to individual areas and to reading or writing.
- Versioning: Changes appear in a new version so that existing connections do not suddenly break.
- Limits and clear errors: The API states how many calls are allowed and explains errors in plain terms.
- Events: Besides queries, there are webhooks, so nobody has to keep asking.
Just as important is what an API cannot do. Some programs only allow reading, others only expose part of the data. If you know that you will later want to create invoices from another system, check exactly that before you buy. For data protection, an API is an additional route to personal data and therefore belongs in your overview of which programs receive which data.
What an SME needs an API for
Many businesses use APIs without noticing: the online shop reports orders to the accounting, the website sends enquiries to the CRM, the calendar shows appointments from the job planning. Custom programming is worthwhile when the same copying is regularly done by hand or when data in two programs drifts apart.
- Automatically record enquiries from an existing web form as a lead.
- Take over contact details from an industry solution instead of maintaining them twice.
- Pull open invoices into your own report or a dashboard.
- Pass new customers on to a newsletter or ticketing system.
Before the first call, it is worth reading the interface documentation: what data is available, which permissions are needed, how many calls are allowed? For one-off transfers, a CSV file is often simpler than an API.
A practical example
Example: a fiduciary office in Aarau connects its enquiry form
The invented fiduciary office Muster & Partner GmbH in Aarau receives enquiries through a form on its existing website. Until now, the assistant copied every enquiry from the email inbox into the CRM, a good twenty a month on average.
The office’s web developer creates an API key in the CRM that has only the permission “create leads”. The form sends every enquiry by POST to the REST API. The lead appears immediately in the pipeline with name, company, request and source, and the assistant no longer has to type anything. When the website is replaced a year later, the office deletes the old key and creates a new one for the new form.
Invented example for illustration.
How VoxCRM helps
yesVoxCRM has a REST API with API keys whose permissions you assign individually: read and create contacts, companies and leads, and read products, quotes and invoices. Quotes, invoices and projects cannot currently be created or changed through the API. Events are reported by webhooks. More under Integrations and API.
