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

# Crear un cliente

> Crear un cliente



## OpenAPI

````yaml es/openapi.json POST /v1/customers
openapi: 3.1.0
info:
  title: Watahub API
  version: 0.2.0
  description: >-
    API para clientes de Watahub, gateway multiempresa de WhatsApp Cloud API.
    Autentica cada solicitud con `Authorization: Bearer <key>` o `X-API-Key:
    <key>`. Los contratos propios son cerrados; los registros de Meta conservan
    campos adicionales. El proxy `/vN.N` conserva el cuerpo y estado de Meta;
    acepta la versión de la ruta, pero la ignora.
servers:
  - url: https://cloud.watahub.dev
security:
  - bearerApiKey: []
  - headerApiKey: []
tags:
  - name: Messages
  - name: Media
  - name: Templates
  - name: Graph-compatible proxy
    description: >-
      Compatibilidad con Graph de Meta en tres rutas. Devuelve la respuesta de
      Meta sin cambios.
  - name: Phones
    description: Teléfonos
  - name: Conversations
    description: Conversaciones
  - name: Connect
    description: Conexión
  - name: Customers
    description: Clientes
  - name: Webhooks
    description: Webhooks
  - name: Logs
    description: Registros
  - name: Health
    description: Estado del servicio
  - name: Message templates
    description: >-
      Plantillas por WABA en caché del gateway, sincronizadas desde Meta y
      necesarias para campañas.
  - name: Broadcasts
    description: >-
      Envía una plantilla aprobada a hasta 500 destinatarios; se procesa en cola
      y en segundo plano.
paths:
  /v1/customers:
    post:
      tags:
        - Customers
      summary: Crear un cliente
      operationId: createCustomer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreate'
      responses:
        '201':
          description: Creado.
          content:
            application/json:
              schema:
                type: object
                required:
                  - customer
                properties:
                  customer:
                    $ref: '#/components/schemas/Customer'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/PaymentRequired'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    CustomerCreate:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 120
        externalCustomerId:
          type:
            - string
            - 'null'
          minLength: 1
          maxLength: 128
          description: Único por cuenta; duplicados devuelven 409.
    Customer:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        externalCustomerId:
          type:
            - string
            - 'null'
        createdAt:
          type: integer
          format: int64
          description: Milisegundos desde Unix epoch.
        updatedAt:
          type: integer
          format: int64
          description: Milisegundos desde Unix epoch.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
  responses:
    BadRequest:
      description: Datos inválidos (validación o ruta no canónica).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Clave API ausente o inválida.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    PaymentRequired:
      description: La cuenta requiere un pago.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: Conflicto.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: >-
        Demasiadas solicitudes (límite de cuenta, 10 claves fallidas/min por IP
        o 20 enlaces de conexión/hora).
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: Gateway pausado, en mantenimiento o sin configuración de la app de Meta.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerApiKey:
      type: http
      scheme: bearer
      description: Clave API de la cuenta.
    headerApiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: Clave API de la cuenta.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.