Lockally Contacts API

Contact records (internal and external)

GitHub OpenAPI

Operations 10

GET /v1/contacts List contacts #
POST /v1/contacts Create a contact #
GET /v1/contacts/{id} Get a contact #
PATCH /v1/contacts/{id} Update a contact #
DELETE /v1/contacts/{id} Delete a contact #
GET /v1/contacts/{id}/lists Get lists a contact belongs to #
PUT /v1/contacts/external/{system}/{external_id} Create or update a contact by its id in another system #
GET /v1/contacts/external/{system}/{external_id} Get a contact by its id in another system #
DELETE /v1/contacts/external/{system}/{external_id} Delete a contact by its id in another system #
PUT /v1/contacts/external/{system} Create or update up to 500 contacts by their ids in another system #

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-contacts-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-contacts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: lockally control plane Contacts 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: Contacts
  description: Contact records (internal and external)
paths:
  /v1/contacts:
    get:
      tags:
      - Contacts
      operationId: listContacts
      x-required-scope: mailboxes:read
      summary: List contacts
      parameters:
      - name: q
        in: query
        schema:
          type: string
        description: Free-text search across name, email, company
      - name: type
        in: query
        schema:
          type: string
        description: Filter by contact_type
      - name: department
        in: query
        schema:
          type: string
        description: Filter by department
      - name: status
        in: query
        schema:
          type: string
        description: Filter by status
      - name: source
        in: query
        schema:
          type: string
        description: Filter by source
      responses:
        '200':
          description: List of contacts
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Contact'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
    post:
      tags:
      - Contacts
      operationId: createContact
      x-required-scope: mailboxes:write
      summary: Create a contact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              - email
              properties:
                name:
                  type: string
                email:
                  type: string
                  format: email
                phone:
                  type: string
                company:
                  type: string
                notes:
                  type: string
                contact_type:
                  type: string
                  enum:
                  - internal
                  - external
                  default: external
                department:
                  type: string
                role:
                  type: string
      responses:
        '201':
          description: Contact created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/ProblemBadRequest'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
  /v1/contacts/{id}:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    get:
      tags:
      - Contacts
      operationId: getContact
      x-required-scope: mailboxes:read
      summary: Get a contact
      responses:
        '200':
          description: Contact details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
        '404':
          $ref: '#/components/responses/ProblemNotFound'
    patch:
      tags:
      - Contacts
      operationId: updateContact
      x-required-scope: mailboxes:write
      summary: Update a contact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                  format: email
                phone:
                  type: string
                company:
                  type: string
                notes:
                  type: string
                contact_type:
                  type: string
                  enum:
                  - internal
                  - external
                department:
                  type: string
                role:
                  type: string
                status:
                  type: string
                  enum:
                  - active
                  - disabled
      responses:
        '200':
          description: Contact updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/ProblemBadRequest'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
        '404':
          $ref: '#/components/responses/ProblemNotFound'
    delete:
      tags:
      - Contacts
      operationId: deleteContact
      x-required-scope: mailboxes:write
      summary: Delete a contact
      responses:
        '204':
          description: Contact deleted
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
        '404':
          $ref: '#/components/responses/ProblemNotFound'
  /v1/contacts/{id}/lists:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    get:
      tags:
      - Contacts
      operationId: getContactLists
      x-required-scope: mailboxes:read
      summary: Get lists a contact belongs to
      responses:
        '200':
          description: Lists containing this contact
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          format: uuid
                        name:
                          type: string
                        visibility:
                          type: string
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
        '404':
          $ref: '#/components/responses/ProblemNotFound'
  /v1/contacts/external/{system}/{external_id}:
    parameters:
    - name: system
      in: path
      required: true
      description: 'Your label for the system the record comes from, for example `salesforce`, `hubspot` or `odoo`. 1 to 64 characters: lowercase letters, digits, dot, underscore or hyphen (upper case is folded).'
      schema:
        type: string
        pattern: ^[a-z0-9][a-z0-9._-]{0,63}$
    - name: external_id
      in: path
      required: true
      description: The record's id in that system, kept exactly as given (case matters). 1 to 255 characters, no spaces. URL-encode it.
      schema:
        type: string
        maxLength: 255
    put:
      tags:
      - Contacts
      operationId: upsertExternalContact
      x-required-scope: contacts:write
      summary: Create or update a contact by its id in another system
      description: 'Idempotent: the path is the identity, so sending the same request twice cannot create a second contact, and you never need to store our id. Returns 201 when the contact was created and 200 when it already existed. The body is the full representation: a field you leave out is cleared. Email is an ordinary attribute, not a key, so changing it updates the same contact. `mailboxes:write` is also accepted.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalContactInput'
      responses:
        '200':
          description: The contact already existed and was updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '201':
          description: The contact was created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          $ref: '#/components/responses/ProblemBadRequest'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
    get:
      tags:
      - Contacts
      operationId: getExternalContact
      x-required-scope: contacts:read
      summary: Get a contact by its id in another system
      responses:
        '200':
          description: Contact details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
        '404':
          $ref: '#/components/responses/ProblemNotFound'
    delete:
      tags:
      - Contacts
      operationId: deleteExternalContact
      x-required-scope: contacts:write
      summary: Delete a contact by its id in another system
      responses:
        '204':
          description: Contact deleted
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
        '404':
          $ref: '#/components/responses/ProblemNotFound'
  /v1/contacts/external/{system}:
    parameters:
    - name: system
      in: path
      required: true
      schema:
        type: string
        pattern: ^[a-z0-9][a-z0-9._-]{0,63}$
    put:
      tags:
      - Contacts
      operationId: bulkUpsertExternalContacts
      x-required-scope: contacts:write
      summary: Create or update up to 500 contacts by their ids in another system
      description: 'For a sync. Each row stands alone: a bad row is reported in `results` with its index and the rest are stored, so the response is 200 whenever the request itself is well formed. Read `failed` and `results`. Two rows with the same `external_id` in one request are refused (the later one), because which is current cannot be known. Rerunning the same payload updates rather than duplicates.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - contacts
              properties:
                contacts:
                  type: array
                  minItems: 1
                  maxItems: 500
                  items:
                    allOf:
                    - $ref: '#/components/schemas/ExternalContactInput'
                    - type: object
                      required:
                      - external_id
                      properties:
                        external_id:
                          type: string
                          maxLength: 255
      responses:
        '200':
          description: Per-row results
          content:
            application/json:
              schema:
                type: object
                required:
                - created
                - updated
                - failed
                - results
                properties:
                  created:
                    type: integer
                  updated:
                    type: integer
                  failed:
                    type: integer
                  results:
                    type: array
                    items:
                      type: object
                      required:
                      - index
                      - external_id
                      - status
                      properties:
                        index:
                          type: integer
                        external_id:
                          type: string
                        status:
                          type: string
                          enum:
                          - created
                          - updated
                          - error
                        contact:
                          $ref: '#/components/schemas/Contact'
                        error:
                          type: string
        '400':
          $ref: '#/components/responses/ProblemBadRequest'
        '401':
          $ref: '#/components/responses/ProblemUnauthorized'
        '403':
          $ref: '#/components/responses/ProblemForbidden'
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:
    ExternalContactInput:
      type: object
      required:
      - email
      properties:
        email:
          type: string
          format: email
        name:
          type: string
          description: Defaults to the email address when empty.
        phone:
          type: string
        company:
          type: string
        notes:
          type: string
        contact_type:
          type: string
          enum:
          - internal
          - external
          default: external
        department:
          type: string
        role:
          type: string
        status:
          type: string
          enum:
          - active
          - disabled
          default: active
    Contact:
      type: object
      required:
      - id
      - tenant_id
      - name
      - email
      - contact_type
      - status
      - created_at
      - updated_at
      properties:
        id:
          type: string
          format: uuid
        tenant_id:
          type: string
          format: uuid
        name:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        company:
          type: string
        notes:
          type: string
        contact_type:
          type: string
          enum:
          - internal
          - external
        source:
          type: string
        department:
          type: string
        role:
          type: string
        status:
          type: string
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        external_system:
          type: string
          description: The system that owns this contact's external id. Absent on contacts made by hand.
        external_id:
          type: string
          description: The contact's id in `external_system`. Absent on contacts made by hand.
    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