Lockally Tenant API

Operations on the calling tenant

GitHub OpenAPI

Operations 4

GET /v1/tenant Get the calling tenant #
GET /v1/usage Usage snapshot #
GET /v1/tracking Get the engagement tracking policy #
PUT /v1/tracking Update the engagement tracking policy #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/lockally-com:lockally-com-tenant-api"
All apis
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.

Get an API 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 Specification

lockally-com-tenant-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: lockally control plane Tenant 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: Tenant
  description: Operations on the calling tenant
paths:
  /v1/tenant:
    get:
      operationId: getTenant
      tags:
      - Tenant
      summary: Get the calling tenant
      description: Returns the tenant the presented API key belongs to.
      x-required-scope: tenant:read
      responses:
        '200':
          description: Tenant info
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tenant'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
  /v1/usage:
    get:
      operationId: getUsage
      tags:
      - Tenant
      summary: Usage snapshot
      description: 'Returns the tenant''s current usage + cap consumption. Designed for

        poll-based alerting on the integrator side (e.g. "warn when daily

        quota is 80% used"). Computed live on request, so there is no

        cache, so callers should poll at most once per minute.'
      x-required-scope: tenant:read
      responses:
        '200':
          description: Usage snapshot
          content:
            application/json:
              schema:
                type: object
                required:
                - mailboxes_active
                - generated_at
                properties:
                  mailboxes_active:
                    type: integer
                    description: Mailboxes that are neither disabled nor soft-deleted.
                  mailboxes_total:
                    type: integer
                    description: All mailboxes for this tenant, including disabled/soft-deleted.
                  domains_verified:
                    type: integer
                    description: Domains that have passed DNS verification.
                  domains_total:
                    type: integer
                  messages_sent_last_60s:
                    type: integer
                    description: Sends in the 60-second window ending now. Used by the rate-cap check.
                  messages_sent_today_utc:
                    type: integer
                    description: Sends since 00:00 UTC. Compared against `daily_msg_quota`.
                  messages_sent_last_30d:
                    type: integer
                    description: Rolling 30-day send count (not calendar month).
                  bytes_stored:
                    type: integer
                    format: int64
                    description: Lifetime sum of `messages.size_bytes` for this tenant.
                  rate_cap_per_min:
                    type: integer
                    description: Per-tenant outbound rate cap (sends per minute).
                  daily_msg_quota:
                    type: integer
                    description: Per-tenant daily send quota (UTC day boundary).
                  webhooks_total:
                    type: integer
                  webhooks_paused:
                    type: integer
                    description: Webhook subscriptions auto-paused after 50 consecutive failures (LT2).
                  generated_at:
                    type: string
                    format: date-time
                    description: When this snapshot was generated, RFC 3339 UTC.
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
  /v1/tracking:
    get:
      operationId: getTrackingPolicy
      tags:
      - Tenant
      summary: Get the engagement tracking policy
      description: 'Whether open and click tracking are enabled for this account. **Both

        are off until switched on**, and an account that has never set a policy

        reads as off rather than as an error.


        `configured` reports whether this deployment holds a signing secret.

        Without one no tracking token can be minted or verified, so tracking

        cannot work however the flags are set, and a caller seeing

        `track_opens: true` with nothing arriving deserves to know why.'
      x-required-scope: tenant:admin
      responses:
        '200':
          description: The policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingPolicy'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
    put:
      operationId: updateTrackingPolicy
      tags:
      - Tenant
      summary: Update the engagement tracking policy
      description: 'Enables or disables tracking for the account. Send either flag or both;

        an omitted flag is left unchanged rather than reset.


        **Enabling this changes what Lockally collects about your recipients**,

        who have no relationship with us. You are the controller for them. What

        is collected is a user-agent string, a timestamp, and for a click the

        destination URL: **no IP address**, ever. The change is written to your

        audit log.'
      x-required-scope: tenant:admin
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                track_opens:
                  type: boolean
                track_clicks:
                  type: boolean
      responses:
        '200':
          description: The updated policy.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingPolicy'
        '400':
          $ref: '#/components/responses/ProblemBadRequest'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
components:
  schemas:
    TrackingPolicy:
      type: object
      required:
      - track_opens
      - track_clicks
      - configured
      properties:
        track_opens:
          type: boolean
        track_clicks:
          type: boolean
        updated_at:
          type: string
          format: date-time
          description: Absent until a policy has been set.
        configured:
          type: boolean
          description: Whether this deployment holds a tracking signing secret. False means tracking cannot work whatever the flags say.
    Tenant:
      type: object
      required:
      - id
      - slug
      - display_name
      - status
      - plan
      - rate_cap_per_min
      - daily_msg_quota
      - admin_email
      - created_at
      properties:
        id:
          type: string
          format: uuid
        slug:
          type: string
          example: workgrid
        display_name:
          type: string
          example: WorkGrid
        status:
          type: string
          enum:
          - active
          - suspended
          - closing
          - closed
        plan:
          type: string
          example: starter
        rate_cap_per_min:
          type: integer
          description: Per-tenant share of the per-VPS 5/min outbound cap (L6).
          example: 1
        daily_msg_quota:
          type: integer
          example: 1000
        admin_email:
          type: string
          format: email
        created_at:
          type: string
          format: date-time
        suspended_at:
          type: string
          format: date-time
          nullable: true
        closed_at:
          type: string
          format: date-time
          nullable: true
        hard_delete_after:
          type: string
          format: date-time
          nullable: true
    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
  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'
  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