Lockally Billing API
Plan, subscription checkout, and send-unit purchases
Plan, subscription checkout, and send-unit purchases
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/lockally-com:lockally-com-billing-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: lockally control plane Billing API
version: 0.1.0
summary: REST API for managing tenants, domains, mailboxes, and outbound mail
description: 'The lockally control plane lets integrators and direct customers manage
everything except actual mail data flow (which uses standard JMAP / IMAP /
SMTP-submission against the data plane endpoints).
**Authentication.** All `/v1/*` endpoints require a Bearer API key in the
`Authorization` header. Keys are formatted `lk_live__`,
or `lk_test_` for a test key. Create keys in the dashboard, or with
`POST /v1/api-keys` using a key that holds `tenant:admin`.
The key''s plan is checked on every request, so a key stops working if the
account moves to a plan without API access, and works again if it moves back.
**Errors.** Failures return RFC 9457
`application/problem+json` documents.
**Scopes.** Each endpoint requires a specific scope on the presented key.
Insufficient scope returns `403` with the required scope name in `detail`.'
contact:
name: lockally support
email: support@lockally.com
license:
name: AGPL-3.0-only OR LicenseRef-LOC-Commercial
identifier: AGPL-3.0-only
servers:
- url: https://api.lockally.com
description: Production
- url: http://127.0.0.1:8081
description: Local development / spike
security:
- bearerAuth: []
tags:
- name: Billing
description: Plan, subscription checkout, and send-unit purchases
paths:
/v1/billing:
get:
tags:
- Billing
summary: Get billing status
operationId: getBilling
x-required-scope: tenant:read
responses:
'200':
description: Current billing status.
content:
application/json:
schema:
$ref: '#/components/schemas/BillingStatus'
'401':
$ref: '#/components/responses/ProblemUnauthorized'
'403':
$ref: '#/components/responses/ProblemForbidden'
/v1/billing/checkout:
post:
tags:
- Billing
summary: Create a plan checkout session
operationId: createBillingCheckout
x-required-scope: tenant:admin
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- plan
properties:
plan:
type: string
enum:
- free
- founder
- starter
- pro
- scale
responses:
'200':
description: Checkout URL for payment.
content:
application/json:
schema:
type: object
required:
- authorization_url
- reference
properties:
authorization_url:
type: string
format: uri
reference:
type: string
'400':
$ref: '#/components/responses/ProblemBadRequest'
'401':
$ref: '#/components/responses/ProblemUnauthorized'
'403':
$ref: '#/components/responses/ProblemForbidden'
'503':
$ref: '#/components/responses/ProblemServiceUnavailable'
/v1/billing/units/checkout:
post:
tags:
- Billing
summary: Create a send-units checkout session
operationId: createUnitsCheckout
x-required-scope: tenant:admin
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- bundle
properties:
bundle:
type: string
enum:
- 1k
- 10k
- 50k
- 100k
- 1pkt
- 5pkt
- 10pkt
- 20pkt
responses:
'200':
description: Checkout URL for the selected unit bundle.
content:
application/json:
schema:
type: object
required:
- authorization_url
- reference
- units
properties:
authorization_url:
type: string
format: uri
reference:
type: string
units:
type: integer
'400':
$ref: '#/components/responses/ProblemBadRequest'
'401':
$ref: '#/components/responses/ProblemUnauthorized'
'403':
$ref: '#/components/responses/ProblemForbidden'
'503':
$ref: '#/components/responses/ProblemServiceUnavailable'
components:
responses:
ProblemForbidden:
description: API key lacks the required scope.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
ProblemBadRequest:
description: Malformed request.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
ProblemUnauthorized:
description: Missing, malformed, or invalid API key.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
ProblemServiceUnavailable:
description: Service is temporarily unable to handle the request (e.g. database unreachable).
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
schemas:
UnitBundle:
type: object
required:
- key
- units
- display_name
- price_naira
- display_price
properties:
key:
type: string
units:
type: integer
display_name:
type: string
price_naira:
type: integer
display_price:
type: string
BillingStatus:
type: object
required:
- plan
- display_name
- mode
- rate_cap_per_min
- monthly_included_sends
- msgs_this_period
- status
- price_naira_per_seat
- created_at
- send_units_balance
- unit_bundles
- catalog
properties:
plan:
type: string
display_name:
type: string
mode:
type: string
enum:
- api
- business
- both
rate_cap_per_min:
type: integer
monthly_included_sends:
type: integer
msgs_this_period:
type: integer
status:
type: string
enum:
- active
- suspended
price_naira_per_seat:
type: integer
subscribed_at:
type: string
format: date-time
nullable: true
current_period_end:
type: string
format: date-time
nullable: true
created_at:
type: string
format: date-time
send_units_balance:
type: integer
send_units_next_expiry:
type: string
format: date-time
nullable: true
unit_bundles:
type: array
items:
$ref: '#/components/schemas/UnitBundle'
catalog:
type: array
items:
$ref: '#/components/schemas/PlanCatalogEntry'
PlanCatalogEntry:
type: object
required:
- name
- display_name
- description
- price_naira_per_seat
- rate_cap_per_min
- monthly_included_sends
- has_shared_mailboxes
- has_send_units
- has_ai_units
- has_e2e_encryption
properties:
name:
type: string
display_name:
type: string
description:
type: string
price_naira_per_seat:
type: integer
rate_cap_per_min:
type: integer
monthly_included_sends:
type: integer
has_shared_mailboxes:
type: boolean
has_send_units:
type: boolean
has_ai_units:
type: boolean
has_e2e_encryption:
type: boolean
Problem:
description: RFC 9457 problem-details document.
type: object
required:
- type
- status
- title
properties:
type:
type: string
format: uri
default: about:blank
status:
type: integer
title:
type: string
detail:
type: string
instance:
type: string
format: uri
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: lk_live_<prefix>_<secret>
description: API key, format `lk_live_<8-char-prefix>_<32-char-secret>`.
oauth2:
type: oauth2
description: 'OAuth 2.1 (authorization code + PKCE). The access token is sent as the
`Authorization: Bearer` credential, exactly like an API key, so any SDK
that accepts a bearer token works with OAuth. Discovery:
`/.well-known/oauth-authorization-server`.
'
flows:
authorizationCode:
authorizationUrl: https://api.lockally.com/oauth/authorize
tokenUrl: https://api.lockally.com/oauth/token
scopes:
inboxes:read: Read agent-accessible mailboxes and threads
inboxes:write: Send and act on agent-accessible mailboxes