Lockally Admins API
Tenant-admin team management (invite, list, disable, delete)
Tenant-admin team management (invite, list, disable, delete)
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-admins-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 Admins 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: admins
description: Tenant-admin team management (invite, list, disable, delete)
paths:
/v1/admins:
get:
operationId: listAdmins
tags:
- admins
summary: List tenant admins
x-required-scope: tenant:admin
responses:
'200':
description: Admin list.
content:
application/json:
schema:
type: object
required:
- data
properties:
data:
type: array
items:
$ref: '#/components/schemas/AdminFull'
'401':
$ref: '#/components/responses/ProblemUnauthorized'
'403':
$ref: '#/components/responses/ProblemForbidden'
post:
operationId: inviteAdmin
tags:
- admins
summary: Invite a new admin
description: 'Creates a new tenant admin. If `password` is omitted, lockally
generates a 16-char password and returns it ONCE in the response.
Email is case-insensitive and unique per tenant.'
x-required-scope: tenant:admin
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- email
properties:
email:
type: string
format: email
password:
type: string
format: password
minLength: 8
display_name:
type: string
role:
type: string
enum:
- admin
- viewer
default: admin
responses:
'201':
description: Created. `password` populated ONLY if generated.
content:
application/json:
schema:
$ref: '#/components/schemas/AdminFull'
'400':
$ref: '#/components/responses/ProblemBadRequest'
'401':
$ref: '#/components/responses/ProblemUnauthorized'
'403':
$ref: '#/components/responses/ProblemForbidden'
'409':
description: Email already an admin on this tenant.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
/v1/admins/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: string
format: uuid
patch:
operationId: updateAdmin
tags:
- admins
summary: Update an admin
description: 'Supply at least one of `password`, `display_name`, `role`, `disabled`.
**Safety rails.** A session bearer (adm_sess_*) cannot disable
itself, use another admin or an API key (which bypasses the
self-rail). Disabling the last active admin returns 409 to prevent
orphaning the tenant from its console.'
x-required-scope: tenant:admin
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
password:
type: string
format: password
minLength: 8
display_name:
type: string
role:
type: string
enum:
- admin
- viewer
disabled:
type: boolean
responses:
'200':
description: Updated admin.
content:
application/json:
schema:
$ref: '#/components/schemas/AdminFull'
'400':
$ref: '#/components/responses/ProblemBadRequest'
'401':
$ref: '#/components/responses/ProblemUnauthorized'
'403':
$ref: '#/components/responses/ProblemForbidden'
'404':
$ref: '#/components/responses/ProblemNotFound'
'409':
description: Self-disable on session bearer, or last-admin safeguard.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
delete:
operationId: deleteAdmin
tags:
- admins
summary: Delete an admin
description: 'Hard-delete. Cascade-drops the admin''s sessions (immediate
revocation). Same safety rails as PATCH disabled=true.'
x-required-scope: tenant:admin
responses:
'204':
description: Deleted.
'401':
$ref: '#/components/responses/ProblemUnauthorized'
'403':
$ref: '#/components/responses/ProblemForbidden'
'404':
$ref: '#/components/responses/ProblemNotFound'
'409':
description: Self-delete on session bearer, or last-admin safeguard.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
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'
ProblemNotFound:
description: Resource not found under the calling tenant.
content:
application/problem+json:
schema:
$ref: '#/components/schemas/Problem'
schemas:
AdminFull:
allOf:
- $ref: '#/components/schemas/Admin'
- type: object
required:
- disabled
properties:
disabled:
type: boolean
disabled_at:
type: string
format: date-time
nullable: true
password:
type: string
description: Present ONLY on POST response when lockally generated the password. Shown once.
Admin:
type: object
required:
- id
- tenant_id
- email
- role
- created_at
properties:
id:
type: string
format: uuid
tenant_id:
type: string
format: uuid
email:
type: string
format: email
display_name:
type: string
role:
type: string
enum:
- admin
- viewer
last_login_at:
type: string
format: date-time
nullable: true
created_at:
type: string
format: date-time
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