API Key

Lettria authenticates your API requests using your account's API keys.

Who can do this?

Only admins of the project.

Get your API key​

API keys for your development and production environments are created by default when a project is created.

  1. Log in to Lettria. If you don't already have a Lettria account, feel free to create one
  2. Select your project
  3. Check your current environment
  4. Click on Tokens in your menu

api-key-tokens

You can see your current API keys and create a new one.

Caution

A project can have multiple environments and each one has its own API key. Use the appropriate key to perform API requests on your development or production environment.

Use your API key​

All your requests must contain a header called Authorization. The value of the header must be created like so:

LettriaProKey API_KEY.

To make a request using curl,

  1. Replace API_KEY with your personal token.
  2. Replace YOUR_SENTENCE with the text to process.
curl -H "Authorization: LettriaProKey API_KEY" \
-H "Content-Type: application/json" \
-X POST "https://api.lettria.com/" \
-d '{ "text" : "YOUR_SENTENCE" }'