> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unicontrol.me/llms.txt
> Use this file to discover all available pages before exploring further.

# TTLock webhook receiver

> Receives lock events from TTLock Cloud. Accepts both JSON and form-urlencoded payloads. Events are forwarded via MQTT for worker processing.



## OpenAPI

````yaml https://portal.unicontrol.me/v1/openapi post /v1/webhooks/ttlock
openapi: 3.1.0
info:
  title: Unicontrol API
  description: Welcome
  version: 1.0.0
servers:
  - url: http://0.0.0.0:3000
    description: Local Server
  - url: https://portal.test.flexhome.casa
    description: Development
  - url: https://portal.unicontrol.me
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/webhooks/ttlock:
    post:
      tags:
        - Webhooks
      summary: TTLock webhook receiver
      description: >-
        Receives lock events from TTLock Cloud. Accepts both JSON and
        form-urlencoded payloads. Events are forwarded via MQTT for worker
        processing.
      operationId: postV1WebhooksTtlock
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                lockId:
                  type: integer
                  description: TTLock lock identifier
                lockMac:
                  type: string
                  description: Lock MAC address
                eventType:
                  type: integer
                  description: TTLock event type code
                serverDate:
                  type: integer
                  description: Event timestamp (ms epoch)
            example:
              lockId: 12345678
              lockMac: AA:BB:CC:DD:EE:FF
              eventType: 1
              serverDate: 1700000000000
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                lockId:
                  type: string
                  description: TTLock lock identifier
                lockMac:
                  type: string
                  description: Lock MAC address
                eventType:
                  type: string
                  description: TTLock event type code
                serverDate:
                  type: string
                  description: Event timestamp (ms epoch)
      responses:
        '200':
          description: Events received and forwarded
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
              example:
                status: ok
        '500':
          description: Internal error
          content:
            application/json:
              example:
                error: Internal error
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````