{
  "openapi": "3.0.3",
  "info": {
    "title": "Synvaxis API pública",
    "version": "v1",
    "description": "Referencia revisada el 2026-09-27 contra los handlers locales. Las propiedades de recursos no restringen tipos no garantizados por el contrato. Las claves se crean en /dashboard/developers. Operaciones de escritura pública: únicamente crear contactos."
  },
  "servers": [
    {
      "url": "https://app.synvaxis.com/api/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/_meta": {
      "get": {
        "operationId": "getMeta",
        "summary": "Comprobar identidad, alcance y plan",
        "responses": {
          "200": {
            "description": "Objeto sin sobre data.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Meta"
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/contacts": {
      "get": {
        "operationId": "listContacts",
        "summary": "Listar contacts",
        "description": "Requiere read o write.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Tamaño de página (se ajusta al rango 1–200).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor de la respuesta anterior; conservar filtros.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listado paginado.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contact"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createContact",
        "summary": "Crear un contacto",
        "description": "Requiere alcance write. No envía mensajes. No hay garantía de idempotencia.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "phone"
                ],
                "properties": {
                  "phone": {
                    "type": "string",
                    "minLength": 5,
                    "description": "Se recortan espacios. Recomendado: código de país."
                  },
                  "name": {
                    "type": "string",
                    "default": "Desconocido"
                  }
                }
              },
              "example": {
                "phone": "+12025550123",
                "name": "Contacto de prueba"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Contacto creado; objeto sin sobre data.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permiso de lectura insuficiente para una escritura.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Contacto con teléfono ya existente.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversations": {
      "get": {
        "operationId": "listConversations",
        "summary": "Listar conversations",
        "description": "Requiere read o write.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Tamaño de página (se ajusta al rango 1–200).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor de la respuesta anterior; conservar filtros.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "platform",
            "in": "query",
            "required": false,
            "description": "Valor almacenado del canal.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_bot_active",
            "in": "query",
            "required": false,
            "description": "Filtra estado del bot.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listado paginado.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Conversation"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversations/{id}": {
      "get": {
        "operationId": "getConversation",
        "summary": "Consultar conversations por ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identificador del recurso de esta cuenta."
          }
        ],
        "responses": {
          "200": {
            "description": "Objeto sin sobre data.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso no encontrado para esta cuenta.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/messages": {
      "get": {
        "operationId": "listMessages",
        "summary": "Listar messages",
        "description": "Solo lectura. Orden por created_at e id, cursor filtrado por id: no garantiza una exportación cronológica exhaustiva.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Tamaño de página (se ajusta al rango 1–200).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor de la respuesta anterior; conservar filtros.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversation_id",
            "in": "query",
            "required": true,
            "description": "ID de una conversación de la cuenta.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listado paginado.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Message"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Solicitud inválida.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso no encontrado para esta cuenta.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders": {
      "get": {
        "operationId": "listOrders",
        "summary": "Listar orders",
        "description": "Requiere read o write.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Tamaño de página (se ajusta al rango 1–200).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor de la respuesta anterior; conservar filtros.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Estado operativo.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "payment_status",
            "in": "query",
            "required": false,
            "description": "Estado de pago.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "conversation_id",
            "in": "query",
            "required": false,
            "description": "Conversación asociada.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listado paginado.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Order"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{id}": {
      "get": {
        "operationId": "getOrder",
        "summary": "Consultar orders por ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identificador del recurso de esta cuenta."
          }
        ],
        "responses": {
          "200": {
            "description": "Objeto sin sobre data.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso no encontrado para esta cuenta.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products": {
      "get": {
        "operationId": "listProducts",
        "summary": "Listar products",
        "description": "Requiere read o write.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Tamaño de página (se ajusta al rango 1–200).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor de la respuesta anterior; conservar filtros.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "description": "Filtra productos activos o inactivos.",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listado paginado.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products/{id}": {
      "get": {
        "operationId": "getProduct",
        "summary": "Consultar products por ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identificador del recurso de esta cuenta."
          }
        ],
        "responses": {
          "200": {
            "description": "Objeto sin sobre data.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso no encontrado para esta cuenta.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/appointments": {
      "get": {
        "operationId": "listAppointments",
        "summary": "Listar appointments",
        "description": "Requiere read o write.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Tamaño de página (se ajusta al rango 1–200).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "next_cursor de la respuesta anterior; conservar filtros.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Estado de la cita.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "start_time mayor o igual a esta fecha ISO con zona horaria.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "start_time estrictamente menor a esta fecha ISO con zona horaria.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Listado paginado.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Appointment"
                      }
                    },
                    "next_cursor": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/appointments/{id}": {
      "get": {
        "operationId": "getAppointment",
        "summary": "Consultar appointments por ID",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Identificador del recurso de esta cuenta."
          }
        ],
        "responses": {
          "200": {
            "description": "Objeto sin sobre data.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "x-ratelimit-limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "x-ratelimit-reset": {
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Appointment"
                }
              }
            }
          },
          "401": {
            "description": "Clave ausente, inválida o revocada.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Recurso no encontrado para esta cuenta.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Límite excedido. Respetar retry-after.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              },
              "retry-after": {
                "description": "Segundos antes de reintentar.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Error interno.",
            "headers": {
              "x-request-id": {
                "description": "Identificador de correlación de la solicitud.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "syn_<clave>",
        "description": "Clave privada generada en Desarrolladores. write incluye read."
      }
    },
    "schemas": {
      "Contact": {
        "type": "object",
        "description": "Campos publicados de Contact. Algunos valores pueden ser nulos.",
        "properties": {
          "id": {
            "description": "id",
            "nullable": true
          },
          "phone": {
            "description": "phone",
            "nullable": true
          },
          "name": {
            "description": "name",
            "nullable": true
          },
          "status": {
            "description": "status",
            "nullable": true
          },
          "last_interaction": {
            "description": "last_interaction",
            "nullable": true
          },
          "total_orders": {
            "description": "total_orders",
            "nullable": true
          },
          "created_at": {
            "description": "created_at",
            "nullable": true
          }
        },
        "additionalProperties": true
      },
      "Conversation": {
        "type": "object",
        "description": "Campos publicados de Conversation. Algunos valores pueden ser nulos.",
        "properties": {
          "id": {
            "description": "id",
            "nullable": true
          },
          "contact_phone": {
            "description": "contact_phone",
            "nullable": true
          },
          "contact_name": {
            "description": "contact_name",
            "nullable": true
          },
          "platform": {
            "description": "platform",
            "nullable": true
          },
          "channel_phone_id": {
            "description": "channel_phone_id",
            "nullable": true
          },
          "is_bot_active": {
            "description": "is_bot_active",
            "nullable": true
          },
          "last_message_at": {
            "description": "last_message_at",
            "nullable": true
          },
          "last_message_content": {
            "description": "last_message_content",
            "nullable": true
          },
          "last_message_role": {
            "description": "last_message_role",
            "nullable": true
          },
          "unread_count": {
            "description": "unread_count",
            "nullable": true
          },
          "handoff_active": {
            "description": "handoff_active",
            "nullable": true
          },
          "handoff_reason": {
            "description": "handoff_reason",
            "nullable": true
          },
          "meta_campaign_id": {
            "description": "meta_campaign_id",
            "nullable": true
          },
          "created_at": {
            "description": "created_at",
            "nullable": true
          }
        },
        "additionalProperties": true
      },
      "Message": {
        "type": "object",
        "description": "Campos publicados de Message. Algunos valores pueden ser nulos.",
        "properties": {
          "id": {
            "description": "id",
            "nullable": true
          },
          "conversation_id": {
            "description": "conversation_id",
            "nullable": true
          },
          "role": {
            "description": "role",
            "nullable": true
          },
          "content": {
            "description": "content",
            "nullable": true
          },
          "is_bot": {
            "description": "is_bot",
            "nullable": true
          },
          "platform_message_id": {
            "description": "platform_message_id",
            "nullable": true
          },
          "payload": {
            "description": "payload",
            "nullable": true
          },
          "created_at": {
            "description": "created_at",
            "nullable": true
          }
        },
        "additionalProperties": true
      },
      "Order": {
        "type": "object",
        "description": "Campos publicados de Order. Algunos valores pueden ser nulos.",
        "properties": {
          "id": {
            "description": "id",
            "nullable": true
          },
          "platform": {
            "description": "platform",
            "nullable": true
          },
          "external_id": {
            "description": "external_id",
            "nullable": true
          },
          "status": {
            "description": "status",
            "nullable": true
          },
          "payment_status": {
            "description": "payment_status",
            "nullable": true
          },
          "customer_phone": {
            "description": "customer_phone",
            "nullable": true
          },
          "customer_name": {
            "description": "customer_name",
            "nullable": true
          },
          "total": {
            "description": "total",
            "nullable": true
          },
          "currency": {
            "description": "currency",
            "nullable": true
          },
          "conversation_id": {
            "description": "conversation_id",
            "nullable": true
          },
          "created_at": {
            "description": "created_at",
            "nullable": true
          },
          "updated_at": {
            "description": "updated_at",
            "nullable": true
          }
        },
        "additionalProperties": true
      },
      "Product": {
        "type": "object",
        "description": "Campos publicados de Product. Algunos valores pueden ser nulos.",
        "properties": {
          "id": {
            "description": "id",
            "nullable": true
          },
          "name": {
            "description": "name",
            "nullable": true
          },
          "sku": {
            "description": "sku",
            "nullable": true
          },
          "price": {
            "description": "price",
            "nullable": true
          },
          "price_min": {
            "description": "price_min",
            "nullable": true
          },
          "price_max": {
            "description": "price_max",
            "nullable": true
          },
          "pricing_type": {
            "description": "pricing_type",
            "nullable": true
          },
          "description": {
            "description": "description",
            "nullable": true
          },
          "category": {
            "description": "category",
            "nullable": true
          },
          "item_type": {
            "description": "item_type",
            "nullable": true
          },
          "inventory_quantity": {
            "description": "inventory_quantity",
            "nullable": true
          },
          "is_active": {
            "description": "is_active",
            "nullable": true
          },
          "add_ons": {
            "description": "add_ons",
            "nullable": true
          },
          "knowledge_base": {
            "description": "knowledge_base",
            "nullable": true
          },
          "variants": {
            "description": "variants",
            "nullable": true
          },
          "faqs": {
            "description": "faqs",
            "nullable": true
          },
          "created_at": {
            "description": "created_at",
            "nullable": true
          },
          "updated_at": {
            "description": "updated_at",
            "nullable": true
          },
          "sale_price": {
            "description": "sale_price",
            "nullable": true
          },
          "sale_label": {
            "description": "sale_label",
            "nullable": true
          },
          "sale_ends_at": {
            "description": "sale_ends_at",
            "nullable": true
          },
          "sale_active": {
            "description": "sale_active",
            "nullable": true
          }
        },
        "additionalProperties": true
      },
      "Appointment": {
        "type": "object",
        "description": "Campos publicados de Appointment. Algunos valores pueden ser nulos.",
        "properties": {
          "id": {
            "description": "id",
            "nullable": true
          },
          "conversation_id": {
            "description": "conversation_id",
            "nullable": true
          },
          "customer_name": {
            "description": "customer_name",
            "nullable": true
          },
          "customer_phone": {
            "description": "customer_phone",
            "nullable": true
          },
          "customer_email": {
            "description": "customer_email",
            "nullable": true
          },
          "start_time": {
            "description": "start_time",
            "nullable": true
          },
          "end_time": {
            "description": "end_time",
            "nullable": true
          },
          "status": {
            "description": "status",
            "nullable": true
          },
          "meeting_link": {
            "description": "meeting_link",
            "nullable": true
          },
          "notes": {
            "description": "notes",
            "nullable": true
          },
          "created_at": {
            "description": "created_at",
            "nullable": true
          }
        },
        "additionalProperties": true
      },
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "request_id": {
                "type": "string",
                "description": "Opcional; consultar también x-request-id."
              }
            }
          }
        }
      },
      "Meta": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "string",
            "enum": [
              "v1"
            ]
          },
          "user_id": {
            "type": "string"
          },
          "scope": {
            "type": "string",
            "enum": [
              "read",
              "write"
            ]
          },
          "key_prefix": {
            "type": "string"
          },
          "plan": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "tier": {
                "type": "number"
              },
              "effective_tier": {
                "type": "number"
              },
              "is_trialing": {
                "type": "boolean"
              }
            }
          }
        }
      }
    }
  }
}
