File Upload API

Learn how to send us your data via our API

Sending us your customer data via API can be easier and more flexible than SFTP or manual file upload. Here we’ll guide you to creating your API token, requesting permission to deliver a file, and sending that file.

Note: you can also send us files via Secure File Upload drag and drop from Integrate.

API Token

API tokens can be created within Lexer Integrate. Click on the ‘API Tokens’ tile and ‘New API Token’. Once you provide a description and click ‘Save’ the token will be made visible to you. Ensure you save the token at this point because it cannot be viewed again.

Note: your account can have up to 5 active API tokens.

Upload Files

Sending your file is done in two steps. First you must authenticate and request permission to send your file, which responds with a destination URL. Next you use this URL to send us your data file.

1. Request permission to send your file

Run the following command after replacing <TOKEN> with your API Token retrieved from Integrate, and updating <FILE_NAME> with your .csv or .json file.

curl -XPOST -H 'Auth-Api-Token: <TOKEN>' https://api.lexer.io/v1/uploads -H 'Content-type: application/json' -d '{"filename": "<FILE_NAME>"}'

A successful request will return a response that looks like this:

{ id: 123, url: "https://lexer-client-upload-au..." }

The URL field is where you will be sending your file. Copy the URL for use in the next step.

2. Send your file

Run the command below with the URL inserted from the response above, as well as your file name.

curl -XPUT "<URL>" --upload-file <FILE_NAME>

Done! Our team will receive a notification that your file has been received, and we will reach out with any questions or issues. We advise getting in touch to let us know you have sent the file.

File Details

  • File size maximum is 5GB.
  • File format preference is CSV or JSON.