Appearance
Account
APIs for managing your Lindris account.
As a reminder, all requests must be authenticated and use the base URL: https://api.lindris.com
Get account details
GETapi/accountRetrieve details about the account associated with the authenticated API key. This endpoint is useful for integration services to verify account information and display relevant account details in their interface.
Response Fields
dataarrayidinteger optional - The unique identifier for the account. Example: 12345companystring optional - The account company name. Example: Awesome Companyemailstring optional - The account's primary email address. No-examplephonestring optional - The account's primary phone number. Example: +1234567890statusstring optional - The account's billing status, or null when billing has never been synced for the account. Enum: active,cancelling,cancelled,expired,failing,pending,suspended Example: activecreatedAtstring optional - ISO 8601 datetime when the account was created. Example: 2024-01-19T08:30:00Ztimezonestring optional - The account's timezone in IANA format. Example: America/New_Yorkplanstring[] optional - The account's marketing plan data. Example:logoUrlstring optional - The account's logo URL. Empty string if no logo is set. Example: https://example.com/uploads/logos/logo.png
Request
bash
curl --request GET \
--get "https://api.lindris.com/api/account" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/account';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/account"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Responses
json
{
"data": {
"id": "123aBc",
"company": "Awesome Company",
"email": "[email protected]",
"phone": "+1234567890",
"status": "active",
"createdAt": "2024-01-19T08:30:00Z",
"timezone": "America/New_York",
"logoUrl": "https://cdn.lindris.com/uploads/logos/company-logo.png",
"plan": {
"marketing": "free"
}
}
}json
{
"message": "Unauthenticated"
}json
{
"message": "This API key has expired. Create a new key in Settings → API Keys.",
"code": "api_key_expired",
"documentation_url": "https://developers.lindris.com/guides/api/authentication"
}Verify connection and authentication
GETapi/authenticatedThis endpoint allows you to verify that you have successfully connected to the API and are authenticated.
Request
bash
curl --request GET \
--get "https://api.lindris.com/api/authenticated" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/authenticated';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/authenticated"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Responses
json
{
"data": {
"authenticated": true
}
}json
{
"message": "This API key has expired. Create a new key in Settings → API Keys.",
"code": "api_key_expired",
"documentation_url": "https://developers.lindris.com/guides/api/authentication"
}Delete the calling API key
DELETEapi/auth/tokenPermanently delete the API key used to authenticate this request. Other keys on the account are not affected. WordPress plugin keys, and keys bound to a site, can't be deleted here; disconnect the site from the Lindris plugin in WP admin instead.
An expired key can't delete itself: it fails authentication with a 401 carrying code: api_key_expired, and stays on the account until it is removed in Settings → API Keys. A 401 without code means the key was not recognized, for example because it was already deleted.
Request
bash
curl --request DELETE \
"https://api.lindris.com/api/auth/token" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/auth/token';
$response = $client->delete(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/auth/token"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Responses
text
(No response body)json
{
"message": "The request is unauthorized. The API key is missing, does not exist or is not active. Please check your API key and try again.",
"documentation_url": "https://developers.lindris.com/guides/api/authentication"
}json
{
"message": "This API key has expired. Run `lindris auth login` to sign in again.",
"code": "api_key_expired",
"documentation_url": "https://developers.lindris.com/guides/api/authentication"
}json
{
"message": "This API key has expired. Create a new key in Settings → API Keys.",
"code": "api_key_expired",
"documentation_url": "https://developers.lindris.com/guides/api/authentication"
}json
{
"message": "This key belongs to a WordPress site. Disconnect the site from the Lindris plugin in WP admin instead."
}Get website tracker javascript
GETapi/account/website-tracker/{mode?}This endpoint gives you the website tracker javascript code and details. Returns the appropriate JavaScript snippet based on your needs, defaulting to the modern mode.
URL Parameters
modestring optional - The mode of the tracker code to return:- modern (default): Smaller modularized build using ES modules. Best for modern browsers.
- legacy: Larger build compatible with older browsers.
- compat: Most compatible mode that auto-selects between modern/legacy based on browser support using module/nomodule pattern. Example:
modern
- Must be one of:
modernlegacycompat
Request
bash
curl --request GET \
--get "https://api.lindris.com/api/account/website-tracker/modern" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json"php
$client = new \GuzzleHttp\Client();
$url = 'https://api.lindris.com/api/account/website-tracker/modern';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));javascript
const url = new URL(
"https://api.lindris.com/api/account/website-tracker/modern"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Response
json
{
"data": {
"mode": "modern",
"snippet": "<script>...",
"lastEventTrackedAt": 1709306226
}
}