> ## 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.

# SmartThings webhook receiver

> Receives events from SmartThings cloud. Handles CONFIRMATION challenge-response and EVENT messages.



## OpenAPI

````yaml https://portal.unicontrol.me/v1/openapi post /v1/webhooks/smartthings
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/smartthings:
    post:
      tags:
        - Webhooks
      summary: SmartThings webhook receiver
      description: >-
        Receives events from SmartThings cloud. Handles CONFIRMATION
        challenge-response and EVENT messages.
      operationId: postV1WebhooksSmartthings
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                messageType:
                  type: string
                  enum:
                    - CONFIRMATION
                    - EVENT
                  description: Tipo da mensagem SmartThings
                confirmationUrl:
                  type: string
                  nullable: true
                  description: URL para confirmar sink (apenas CONFIRMATION)
                events:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      deviceEvent:
                        type: object
                        properties:
                          deviceId:
                            type: string
                          componentId:
                            type: string
                          capability:
                            type: string
                          attribute:
                            type: string
                          value:
                            path: /v1/logto/webhook
            example:
              messageType: EVENT
              events:
                - deviceEvent:
                    deviceId: device-uuid-123
                    componentId: main
                    capability: switch
                    attribute: switch
                    value: 'on'
      responses:
        '200':
          description: Webhook processed
          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

````