Authentication
Official documentation for authenticating with our API
Introduction
This section provides the official documentation for authenticating with our API via Postman. It includes detailed instructions on the authentication process, supported methods, and best practices to ensure secure access to the API.
🔑 Authentication
To access any Lovi API endpoint, you must first authenticate and obtain an access token using your email and password. This token must then be included in the Authorization
header of all subsequent requests.
Token Rotation: We recommend periodically rotating tokens and storing them securely.
Method: POST Format: JSON
Endpoint
Query Parameters
Parameter | Required | Fixed Value | Description |
---|---|---|---|
grant_type | Yes | password | Indicates that you’re using authentication via email and password. |
Request Headers
Inform the server of the type of content you are sending:
Key | Value | Description |
---|---|---|
Content-Type | application/json | Indicates that the request body is in JSON format. |
Request Body
This is where you provide your personal credentials (your email and password):
You should replace:
- “your-email@example.com” with your actual email address.
- “your-secure-password” with your password.
Response
The server will respond with a token that you will need to authenticate in future API calls. The response will look like this:
⚠️ Save your access_token
— you’ll use it to interact with the rest of the API.
🧭 Retrieve Company API Keys
Method: POST Format: JSON
Endpoint
Headers
Parameter | Example | Required | Description |
---|---|---|---|
Authorization | Bearer your-access-token | Yes | This header is used for authenticating the request. It contains a Bearer token received after logging in. |
Response
Each object within the validApiKeys
array represents an API key associated with a specific company. The fields included are:
-
company_id
: Unique identifier of the company that owns the API key. -
key
: The API key itself, used to authenticate requests. -
is_active
: Boolean value indicating whether the key is currently active (true) or inactive (false). -
last_used
: Timestamp of the last time the key was used. If the key has never been used, the value will be null. -
company_name
: Name of the company associated with the API key, useful for display in interfaces or logs.
Here’s an example:
Use the key
provided in the response to authenticate future requests and perform operations on behalf of the specified company.
📝Each company will have a unique access key. You must use the correct key depending on which company you’re interacting with.
🔁 Token per Company
Once you identify which company you want to work with, you must authenticate again to generate a company-level token. This is usually required for secured actions like sending notifications or uploading media.
You will use the previously retrieved key
in your query parameters or headers, depending on the endpoint.