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

# Self-register a cloud edge replica (idempotent by hostname)



## OpenAPI

````yaml https://portal.unicontrol.me/v1/openapi post /v1/edge/register-cloud
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/edge/register-cloud:
    post:
      tags:
        - Edge Runtime
      summary: Self-register a cloud edge replica (idempotent by hostname)
      operationId: postV1EdgeRegister-cloud
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - hostname
              properties:
                hostname:
                  type: string
                  description: 'Identificador único da réplica (ex: hostname do container)'
                name:
                  type: string
                  description: Nome amigável; default = hostname
                capabilities:
                  type: object
                  description: Capacidades da réplica (cpu, mem, etc)
            example:
              hostname: edge-cloud-1
              name: edge-cloud-1
              capabilities:
                region: us-east-1
      responses:
        '200':
          description: Edge registered; same response on subsequent calls
          content:
            application/json:
              schema:
                type: object
                properties:
                  edge:
                    type: object
                  mqtt:
                    type: object
                    properties:
                      username:
                        type: string
                      password:
                        type: string
        '400':
          description: Dados inválidos
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              example:
                message: validation error
        '401':
          description: Não autenticado
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: unauthorized
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````