Welcome to the Konbert API documentation!
Introduction
API requests are made to the following endpoint prefix:
https://konbert.com/api/v1
The API accepts requests in the following formats:
- application/x-www-form-urlencoded
- multipart/form-data
- application/json
Responses will always be in JSON format, unless otherwise specified.
Example of a success response:
{
"status": "ok",
"message": "file created",
"data": {}
}
Example of an error response:
{
"status": "error",
"message": "size required",
"data": {}
}
Authentication
Head over to the account page to find your API key, you must log in or register if you don't have an account yet.
To authenticate your requests, use the Authorization
header:
$ curl https://konbert.com/api/v1/files \
-H "Authorization: Bearer ${API_KEY}"
Remember to replace ${API_KEY}
with your own API key.
Conversion
Convert files using the https://konbert.com/api/v1/convert
endpoint.
The endpoint can receive data as input from three sources: a URL, a file in multi-part form data format, or a string of data.
input
required
Configure all options related to the input data.
You must define a file or HTTP input.
input.file
file
Define a file to use as an input source. The file should follow the specifications of RFC 2388 (which defines file transfers for the multipart/form-data protocol).
input.http
object
Define a HTTP source to use as input.
input.http.url
string
required
The URL to fetch the data from.
input.http.method
string
optional
HTTP method to use when requesting the resource. It can be GET (default) or POST.
input.http.headers
object
optional
HTTP headers to send when requesing the resource.
input.format
string
optional
Define the format of the input data. It will be automatically detected if not specified.
It can be one of:
json
ndjson
csv
tsv
input.options
object
optional
Set the parsing preferences for the format. Depending on the chosen format, different options will be accepted.
CSV parsing options
input.options.delimiter
string
optional
The delimiter to use for each value or cell in a row of data. The default value is a comma (,
).
output
object
required
Configure all options related to the output.
output.format
string
required
Define the output format. The input data will be converted to this format.
It can be one of:
json
csv
sql
output.options
object
optional
Set the writing preferences for the format. Depending on the chosen format, different options will be accepted.
CSV output options
input.options.delimiter
string
optional
The delimiter to use for each value or cell in a row of data. The default value is a comma (,
).
SQL output options
input.options.syntax
string
optional
The dialect of SQL to use.
It can be one of:
sqlite
mysql
postgres
sync
boolean
optional
Enable or disable synchronous mode. The default value is false
When async is false, the conversion will happen in the background, the response will be a run ID, which you'll have to make a different request to check the conversion status.
When sync is true, the request will block until the conversion is finished, then the converted data will be returned in the request itself.