Skip to content

REST API reference

Look up HTTP methods, paths, and inputs for platform operations.

Look up an operation’s HTTP method, path, and inputs by feature area. Each endpoint names the corresponding MCP tool; both references come from the same platform tool catalog.

This reference covers authenticated platform operations. For routes called by your own website or backend with a product public key, use public access and the relevant feature guide.

Base URL

Send requests to:

https://api.lepsto.com

Add the path shown for the endpoint. Replace each :name segment with your value: for example, :audienceId in /mail/audiences/:audienceId/contacts is the audience’s ID.

Authentication

Send an Authorization: Bearer <credential> header with every request in this reference.

Credential
Where it comes from
Product access
Platform API key (lsk_…)
A signed-in user creates it on the product’s Developer page or through POST /auth/api/v1/api-keys. Copy the plaintext when shown; it is returned once.
The key’s own product. Naming another product in X-Product-Id returns 403.
Signed-in user session token, including OAuth
User sign-in
Products the caller belongs to.

For a read-only check, set API_KEY to your platform API key in your shell, then list the products available to your identity:

curl https://api.lepsto.com/governance/api/v1/products \
  -H "Authorization: Bearer $API_KEY"

A key can also be exchanged for a one-hour session token. That token has a different product boundary from the raw key; read REST API and keys before using it.

Product public keys (lpk_…) do not authenticate these endpoints. Manage them under Settings → Public Access and use them on the public routes documented by each feature, such as sending email or recording events.

Authentication failure
Status and code
No Authorization header
401 missing_token
Malformed, unknown, or revoked credential
401 invalid_token

Errors

A failed request returns a non-2xx status. Authentication failures use an error object, as in this example:

{
  "error": {
    "code": "invalid_token",
    "message": "Invalid authentication token",
    "step": "token_validation"
  }
}
Field
How to use it
code
Branch on this stable, machine-readable value.
message
Display it to a person; the wording may change.
step
Include the stage that rejected the request when reporting a problem.

Feature-specific failures can use a different body. For example, a Mail plan refusal returns 402 with top-level error and reason fields; management callers also receive usage details. Check the feature guide for its error fields and recovery steps.

The OpenAPI document

Use /openapi.json with a client generator, API explorer, or agent that builds function-calling tool definitions. It contains the operations as an OpenAPI 3.1 document, with path parameters written as {name}.

The document and these pages are produced by the same pipeline run and carry the same catalog_version stamp.

Areas

Was this page helpful?
Esc

Start typing to search the docs.

↑↓navigate↵select