> ## Documentation Index
> Fetch the complete documentation index at: https://developer.omni.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Crear canal

> Crea un canal nuevo mediante la API

## Conceptos

Crea un canal nuevo. Una vez creado, el canal debe conectarse (desde el panel o con el SDK) para poder empezar a enviar y recibir mensajes.

El `id` devuelto es el `channelId` que se usa en todas las llamadas a la API.

### Tipos disponibles

| Tipo             | Plataforma                     |
| ---------------- | ------------------------------ |
| `META_WHATSAPP`  | WhatsApp (API Oficial de Meta) |
| `Z_API_WHATSAPP` | WhatsApp Web                   |
| `META_INSTAGRAM` | Instagram                      |
| `META_MESSENGER` | Messenger                      |
| `BOT_TELEGRAM`   | Telegram                       |


## OpenAPI

````yaml es/channels/openapi-create.json POST /v1/channels
openapi: 3.1.0
info:
  title: Omni Z-API - Crear canal
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io
security:
  - bearerAuth: []
paths:
  /v1/channels:
    post:
      tags:
        - Canales
      summary: Crear canal
      description: Crea un canal nuevo.
      operationId: createChannel
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateChannelRequest'
            example:
              name: Mi canal de WhatsApp
              type: META_WHATSAPP
      responses:
        '200':
          description: Canal creado correctamente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateChannelResponse'
              example:
                id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    CreateChannelRequest:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          description: Nombre del canal
        type:
          type: string
          description: Tipo de canal (plataforma)
          enum:
            - META_WHATSAPP
            - Z_API_WHATSAPP
            - META_INSTAGRAM
            - META_MESSENGER
            - BOT_TELEGRAM
    CreateChannelResponse:
      type: object
      properties:
        id:
          type: string
          description: ID del canal creado (channelId)
    Error:
      type: object
      properties:
        error:
          type: integer
        message:
          type: string
  responses:
    Unauthorized:
      description: Token no válido o ausente.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 401
            message: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key generada en el panel de Seguridad de Omni Z-API

````