Orbitoads
Explorar la documentación

Crear campañas y medios

Una solicitud admite hasta 100 campañas de una cuenta. Elige canales, bots, búsqueda o audiencia y envía una clave de operación. Carga los medios antes y sigue la tarea devuelta.

Markdown

POST /v1/campaigns crea campañas en una cuenta. Requiere una clave con permiso de gestión y la cabecera Idempotency-Key. La respuesta 202 contiene una tarea. Las campañas aparecen cuando esta finaliza.

Ejemplo de creación de una campaña

Ejemplo
curl -s -X POST https://orbitoads.pro/api/v1/campaigns \
  -H "X-API-Key: $ORBITO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "account_id": 53,
    "title": "Crypto channels — notes",
    "text": "Daily market notes in 3 minutes. No noise.",
    "promote_url": "https://t.me/yourchannel",
    "cpm": 1.5,
    "budget": 20,
    "target_type": "channels",
    "channels": ["@durov", "t.me/telegram"]
  }'
Ejemplo
{ "success": true, "data": { "id": 81234, "type": "create", "status": "pending", "account_id": 53, "total": 1, "ad_ids": [] } }

Creación por lotes

Poner las campañas en campaigns (hasta 100). account_id y los campos del grupo permanecen en el nivel superior y se aplican a todos ellos.

Ejemplo
{
  "account_id": 53,
  "new_group_name": "October test",
  "campaigns": [
    { "title": "A", "text": "Variant A", "promote_url": "https://t.me/yourchannel", "cpm": 1.5, "budget": 10,
      "target_type": "channels", "channels": ["@durov"] },
    { "title": "B", "text": "Variant B", "promote_url": "https://t.me/yourchannel", "cpm": 1.5, "budget": 10,
      "target_type": "channels", "channels": ["@telegram"] }
  ]
}

Las campañas se crean una tras otra. Si el primero falla, la tarea se detiene — soluciona la entrada en lugar de repetir el mismo error 100 veces. Cada fallo se enumera en el errors de la tarea con su index en su matriz.

Campos

CampoRequisitosSignifica
titleSíNombre interno, mostrado en el panel.
textSíLa gente del texto de anuncio ve. Se aplican reglas de longitud y contenido propias de Telegram ; una negativa vuelve en la tarea de errors .
promote_urlSíLo que el anuncio abre: https://t.me/channel, t.me/bot?start=ref , @channel o un sitio web URL .
cpmSíBid por 1.000 puntos de vista en la moneda del gabinete, mayor que 0. Demasiado bajo para el objetivo → Telegram ’s mínimo vuelve en el error.
budgetSíEl dinero pasó del balance del gabinete a la campaña: 0 , o por lo menos el min_budget del gabinete ( Cuentas de publicidad ). Con 0 el anuncio se crea pero no puede funcionar hasta que usted agrega presupuesto.
target_typeSíchannels, bots , search o users — ver a continuación.
activeNofalse crea que se apaga. Predeterminado true .
daily_budgetNoGorra de gasto diario.
views_per_userNoCuantas veces una persona puede ver el anuncio, 1–4.
mediaNoImagen o video token de POST /v1/media .
pictureNotrue muestra el avatar del canal ascendido en el anuncio.
buttonNoBotón bajo el anuncio: subscribe, view, read, learn_more, download, open, sign_up, buy, order, play, try, leave_request. Solo donde la cuenta de publicidad features.ad_button Es true.
website_nameNoNombre de marca mostrado por encima de un anuncio del sitio web.
scheduleNoMostrar el anuncio sólo en días y horas elegidos, e.g . días de semana 9:00-18:00. Formato: Calendario . Sin él el anuncio funciona alrededor del reloj.

Nivel superior sólo: account_id (necesitado cuando la clave alcanza varios armarios), group_id (un existente Grupo ) o new_group_name (crea el grupo, o reutiliza uno con ese nombre).

Los campos desconocidos se niegan con 400 VALIDATION_ERROR y el nombre de campo en param — un tipo nunca deja caer silenciosamente un entorno.

Segmentación

channels — mostrar el anuncio en canales específicos

Ejemplo
{ "target_type": "channels", "channels": ["@durov", "t.me/telegram"],
  "languages": ["en"], "topics": [7, 26], "exclude_topics": [2], "add_similar_channels": true }
CampoSignifica
channels1–100 canales públicos: @name , name o t.me/name . Necesario.
languages, topics, exclude_topicsLímite por lenguaje de canal y tema ( Códigos ).
add_similar_channelsTambién añadir canales similares a estos.

bots — mostrar el anuncio en bots

Ejemplo
{ "target_type": "bots", "bots": ["@somebot"] }

bots : 1–100 bots públicos.

search — mostrar el anuncio para Telegram consultas de búsqueda

Ejemplo
{ "target_type": "search", "search_keywords": ["crypto wallet", "bitcoin"] }

search_keywords : 1–100 frases, hasta 64 caracteres cada uno.

users — mostrar el anuncio a un público

Ejemplo
{ "target_type": "users", "countries": ["DE", "AT"], "languages": ["de"],
  "topics": [26], "exclude_topics": [2], "audience_channels": ["@somechannel"] }
CampoSignifica
countriesISO códigos de país.
languagesCódigos de idiomas.
topics, exclude_topicsIntereses por tema id.
audience_channelsGente que leyó estos canales.

Por lo menos uno de estos es requerido. Códigos: Código de meta .

Canales, bots y palabras clave se resuelven a Telegram ’ s propios ids cuando la tarea funciona. Unos Telegram no se puede encontrar son saltados; si no se encuentra ninguno, esa campaña falla — No targets found: … para canales y bots, No valid search queries found para palabras clave — y el errors de la tarea lo dice.

Después de crear la campaña

  1. La encuesta GET /v1/tasks/{id} hasta completed . ad_ids mantiene las nuevas campañas.
  2. Telegram reseñas cada nuevo anuncio: comienza In Review , luego se convierte en Active (o Declined ). Un Webhook le dice cuándo.
  3. Cambiar, financiar o pausar con Gestión de campañas .

Subir archivos multimedia

POST /v1/media carga una imagen o vídeo en un armario y devuelve un token de media para POST /v1/campaigns , PATCH y copia. El token pertenece a ese gabinete — subir en el gabinete en el que crearás.

Ejemplo
curl -s -X POST "https://orbitoads.pro/api/v1/media?account_id=53" \
  -H "X-API-Key: $ORBITO_API_KEY" \
  -F "file=@banner.jpg"
Ejemplo
{ "success": true, "data": { "media": "BQACAgIAAx0…", "account_id": 53 } }
  • JPG, PNG , GIF , WEBP o MP4, hasta 10 MB , enviado como multipart/form-data en el campo file .
  • Algunos armarios aceptan sólo 16:9 imágenes por lo menos 640 px de ancho; si un archivo no cabe, Telegram ’ la razón vuelve en error .

Errores

Códigocuando
VALIDATION_ERRORFalta un campo, desconocido, del tipo equivocado, o no pertenece a este target_type — param dice cuál.
IDEMPOTENCY_KEY_REQUIREDNo Idempotency-Key.
ACCOUNT_ID_REQUIRED / ACCOUNT_NOT_FOUNDDiga qué armario / que gabinete no es accesible.
VIEW_ONLY_ACCESSTiene acceso de Viewer a este armario.
QUEUE_FULL5 crea ya apagado en este armario.
CABINET_LOCKED, SUBSCRIPTION_REQUIREDEl gabinete no puede tomar cambios manuales ahora mismo.

Las fallas individuales de la campaña (Telegram rechazaron un texto, una oferta, un enlace) no fallan en la solicitud — aparecen en el errors de la tarea.

Referencia de la API

El contrato publicitario completo requiere una credencial del proveedor dedicada al espacio de trabajo. El cliente usa su clave API de Orbito. Pedidos, aprovisionamiento y facturación externa siguen procesos separados.

POST /api/v1/campaigns

Programa la creación de una campaña o hasta 100 en una cuenta.

ParámetroUbicaciónFormatoObligatorio
Idempotency-KeyheaderstringSí
X-API-KeyheaderstringSí
cURL
curl -X POST https://orbitoads.pro/api/v1/campaigns \
  -H 'X-API-Key: YOUR_ORBITO_KEY' \
  -H 'Idempotency-Key: 2033d50c-b32b-44aa-8e40-3e236c474805' \
  -H 'Content-Type: application/json' \
  --data '{
  "title": "November club · draft",
  "text": "Explore this month’s language club schedule.",
  "promote_url": "https://school.example/club",
  "cpm": 1.25,
  "budget": 0,
  "active": false,
  "target_type": "users",
  "countries": [
    "GB"
  ],
  "languages": [
    "en"
  ],
  "account_id": 7401,
  "group_id": 516
}'
HTTP 202
{
  "success": true,
  "data": {
    "id": 96203,
    "type": "create",
    "status": "pending",
    "account_id": 7401,
    "total": 1,
    "ad_ids": []
  }
}
Esquema del cuerpo
JSON Schema
{
  "oneOf": [
    {
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "active": {
          "default": true,
          "type": "boolean"
        },
        "add_similar_channels": {
          "type": "boolean"
        },
        "audience_channels": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "bots": {
          "items": {
            "type": "string"
          },
          "maxItems": 100,
          "minItems": 1,
          "type": "array"
        },
        "budget": {
          "minimum": 0,
          "type": "number"
        },
        "button": {
          "enum": [
            "subscribe",
            "view",
            "read",
            "learn_more",
            "download",
            "open",
            "sign_up",
            "buy",
            "order",
            "play",
            "try",
            "leave_request"
          ],
          "type": "string"
        },
        "channels": {
          "items": {
            "type": "string"
          },
          "maxItems": 100,
          "minItems": 1,
          "type": "array"
        },
        "countries": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "cpm": {
          "exclusiveMinimum": 0,
          "type": "number"
        },
        "daily_budget": {
          "minimum": 0,
          "type": "number"
        },
        "exclude_topics": {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        "group_id": {
          "type": "integer"
        },
        "languages": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "media": {
          "type": "string"
        },
        "new_group_name": {
          "maxLength": 100,
          "type": "string"
        },
        "picture": {
          "type": "boolean"
        },
        "promote_url": {
          "maxLength": 2048,
          "type": "string"
        },
        "schedule": {
          "additionalProperties": false,
          "properties": {
            "days": {
              "additionalProperties": false,
              "properties": {
                "fri": {
                  "items": {
                    "maximum": 23,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxItems": 24,
                  "type": "array"
                },
                "mon": {
                  "items": {
                    "maximum": 23,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxItems": 24,
                  "type": "array"
                },
                "sat": {
                  "items": {
                    "maximum": 23,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxItems": 24,
                  "type": "array"
                },
                "sun": {
                  "items": {
                    "maximum": 23,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxItems": 24,
                  "type": "array"
                },
                "thu": {
                  "items": {
                    "maximum": 23,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxItems": 24,
                  "type": "array"
                },
                "tue": {
                  "items": {
                    "maximum": 23,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxItems": 24,
                  "type": "array"
                },
                "wed": {
                  "items": {
                    "maximum": 23,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "maxItems": 24,
                  "type": "array"
                }
              },
              "type": "object"
            },
            "timezone": {
              "type": "string"
            }
          },
          "required": [
            "days",
            "timezone"
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "search_keywords": {
          "items": {
            "maxLength": 64,
            "type": "string"
          },
          "maxItems": 100,
          "minItems": 1,
          "type": "array"
        },
        "target_type": {
          "enum": [
            "channels",
            "bots",
            "search",
            "users"
          ],
          "type": "string"
        },
        "text": {
          "maxLength": 4096,
          "type": "string"
        },
        "title": {
          "maxLength": 255,
          "type": "string"
        },
        "topics": {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        "views_per_user": {
          "maximum": 4,
          "minimum": 1,
          "type": "integer"
        },
        "website_name": {
          "maxLength": 255,
          "type": "string"
        }
      },
      "required": [
        "title",
        "text",
        "promote_url",
        "cpm",
        "budget",
        "target_type"
      ],
      "type": "object"
    },
    {
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "campaigns": {
          "items": {
            "properties": {
              "active": {
                "default": true,
                "type": "boolean"
              },
              "add_similar_channels": {
                "type": "boolean"
              },
              "audience_channels": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "bots": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              "budget": {
                "minimum": 0,
                "type": "number"
              },
              "button": {
                "enum": [
                  "subscribe",
                  "view",
                  "read",
                  "learn_more",
                  "download",
                  "open",
                  "sign_up",
                  "buy",
                  "order",
                  "play",
                  "try",
                  "leave_request"
                ],
                "type": "string"
              },
              "channels": {
                "items": {
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              "countries": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "cpm": {
                "exclusiveMinimum": 0,
                "type": "number"
              },
              "daily_budget": {
                "minimum": 0,
                "type": "number"
              },
              "exclude_topics": {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "languages": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "media": {
                "type": "string"
              },
              "picture": {
                "type": "boolean"
              },
              "promote_url": {
                "maxLength": 2048,
                "type": "string"
              },
              "schedule": {
                "additionalProperties": false,
                "properties": {
                  "days": {
                    "additionalProperties": false,
                    "properties": {
                      "fri": {
                        "items": {
                          "maximum": 23,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxItems": 24,
                        "type": "array"
                      },
                      "mon": {
                        "items": {
                          "maximum": 23,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxItems": 24,
                        "type": "array"
                      },
                      "sat": {
                        "items": {
                          "maximum": 23,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxItems": 24,
                        "type": "array"
                      },
                      "sun": {
                        "items": {
                          "maximum": 23,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxItems": 24,
                        "type": "array"
                      },
                      "thu": {
                        "items": {
                          "maximum": 23,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxItems": 24,
                        "type": "array"
                      },
                      "tue": {
                        "items": {
                          "maximum": 23,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxItems": 24,
                        "type": "array"
                      },
                      "wed": {
                        "items": {
                          "maximum": 23,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "maxItems": 24,
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  "timezone": {
                    "type": "string"
                  }
                },
                "required": [
                  "days",
                  "timezone"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "search_keywords": {
                "items": {
                  "maxLength": 64,
                  "type": "string"
                },
                "maxItems": 100,
                "minItems": 1,
                "type": "array"
              },
              "target_type": {
                "enum": [
                  "channels",
                  "bots",
                  "search",
                  "users"
                ],
                "type": "string"
              },
              "text": {
                "maxLength": 4096,
                "type": "string"
              },
              "title": {
                "maxLength": 255,
                "type": "string"
              },
              "topics": {
                "items": {
                  "type": "integer"
                },
                "type": "array"
              },
              "views_per_user": {
                "maximum": 4,
                "minimum": 1,
                "type": "integer"
              },
              "website_name": {
                "maxLength": 255,
                "type": "string"
              }
            },
            "required": [
              "title",
              "text",
              "promote_url",
              "cpm",
              "budget",
              "target_type"
            ],
            "type": "object"
          },
          "maxItems": 100,
          "minItems": 1,
          "type": "array"
        },
        "group_id": {
          "type": "integer"
        },
        "new_group_name": {
          "maxLength": 100,
          "type": "string"
        }
      },
      "required": [
        "campaigns"
      ],
      "type": "object"
    }
  ]
}
Resultados y campos de respuesta
APIHTTPSignificado
VALIDATION_ERROR400Revisa los campos y corrige los valores antes de reintentar.
IDEMPOTENCY_KEY_REQUIRED400Incluye la cabecera obligatoria Idempotency-Key en la escritura.
VIEW_ONLY_ACCESS403El rol Viewer permite consultar la cuenta. Para cambiarla se requiere escritura.
QUEUE_FULL429La cuenta ya tiene cinco trabajos de creación en cola. Espera a que haya espacio.

POST /api/v1/media

Sube un archivo creativo y obtiene un token de esa cuenta.

ParámetroUbicaciónFormatoObligatorio
account_idqueryinteger—
X-API-KeyheaderstringSí
Idempotency-Keyheaderstring—
cURL
curl -X POST 'https://orbitoads.pro/api/v1/media?account_id=7401' \
  -H 'X-API-Key: YOUR_ORBITO_KEY' \
  -F file=@./club-cover.png
HTTP 200
{
  "success": true,
  "data": {
    "media": "example-media-718",
    "account_id": 7401
  }
}
Esquema del cuerpo
JSON Schema
{
  "properties": {
    "account_id": {
      "type": "integer"
    },
    "file": {
      "format": "binary",
      "type": "string"
    }
  },
  "required": [
    "file"
  ],
  "type": "object"
}
Ejemplo · JSON
{
  "account_id": 7401,
  "new_group_name": "Language club variants",
  "campaigns": [
    {
      "title": "November club · draft",
      "text": "Explore this month’s language club schedule.",
      "promote_url": "https://school.example/club",
      "cpm": 1.25,
      "budget": 0,
      "active": false,
      "target_type": "users",
      "countries": [
        "GB"
      ],
      "languages": [
        "en"
      ]
    },
    {
      "title": "Conversation club · second draft",
      "text": "Explore this month’s language club schedule.",
      "promote_url": "https://school.example/club?from=variant2",
      "cpm": 1.25,
      "budget": 0,
      "active": false,
      "target_type": "users",
      "countries": [
        "GB"
      ],
      "languages": [
        "en"
      ]
    }
  ]
}

Notas de implementación

Una campaña o un lote

Para una campaña coloca title, text, promote_url, cpm, budget y target_type en la raíz. Para un lote usa entre 1 y 100 en campaigns, con cuenta y grupo compartidos en la raíz. El presupuesto es cero o al menos min_budget.

Segmentación y archivos

Usa channels, bots, search o users. Canales, bots y búsquedas admiten 1–100 entradas y frases de hasta 64 caracteres. La audiencia requiere algún filtro. JPG, PNG, GIF, WebP y MP4 de hasta 10 MB se vinculan a la cuenta de carga.

Aceptación y finalización

Crear, copiar y operar en lote devuelve HTTP 202 con un id. Consulta GET /api/v1/tasks/{id} respetando Retry-After. Revisa failed y errors incluso si el estado es completed.

Operaciones y campos

POST /api/v1/campaigns POST /api/v1/media channels bots search users

  • POST /api/v1/campaigns
  • POST /api/v1/media
  • channels
  • bots
  • search
  • users

Ejemplo de solicitud

GET /api/v1/targeting HTTP/1.1 Host: orbitoads.pro X-API-Key: {key}

Campos y límites del esquema

La tabla procede del contrato público v1. Los nombres de campos y parámetros distinguen mayúsculas. Los códigos HTTP separan el resultado correcto, la validación de entrada y el control de acceso. La especificación enlazada define las estructuras completas.

Ajustes de prueba de audiencias

El esquema de creación distingue cuatro modos. Los canales van en channels, los bots en bots y los términos en search_keywords. Los filtros de países, idiomas y temas describen la audiencia de usuarios. Consulta las capacidades de la cuenta antes de probar.

Referencia del protocolo

MétodoRutaParámetrosContenido de la solicitudCódigos de respuesta
POST/api/v1/campaignsIdempotency-Keyapplication/json · CreateSingleRequest | CreateBatchRequest202, 400, 401, 403, 404, 409, 422, 429, 503
POST/api/v1/mediaaccount_idmultipart/form-data · file, account_id200, 400, 401, 403, 413
GET/api/v1/targeting——200, 401
GET/api/v1/tasks/{id}id—200, 400, 401, 404

Fuente · Fuente de datos

Campos y límites del esquema · Crear campañas y medios

CampoValor documentado
target_typechannels | bots | search | users
campaigns[]1 … 100
active =true
views_per_user1 … 4
budget≥ 0
Idempotency-KeyUUID

Fuente · Fuente de datos

CampaignInput

CampoTipo de campo
titlestring
textstring
promote_urlstring
cpmnumber
daily_budgetnumber · 0 … ∞
views_per_userinteger · 1 … 4
mediastring
pictureboolean
buttonsubscribe | view | read | learn_more | download | open | sign_up | buy | order | play | try | leave_request
website_namestring
scheduleSchedule
budgetnumber · 0 … ∞
activeboolean · = true
target_typechannels | bots | search | users
channelsarray · [string] · 1 … 100
botsarray · [string] · 1 … 100
search_keywordsarray · [string] · 1 … 100
countriesarray · [string]
languagesarray · [string]
topicsarray · [integer]
exclude_topicsarray · [integer]
audience_channelsarray · [string]
add_similar_channelsboolean

Fuente · Fuente de datos

CreateBatchRequest

CampoTipo de campo
account_idinteger
group_idinteger
new_group_namestring
campaignsarray · [CampaignInput] · 1 … 100

Fuente · Fuente de datos

CreativeFields

CampoTipo de campo
titlestring
textstring
promote_urlstring
cpmnumber
daily_budgetnumber · 0 … ∞
views_per_userinteger · 1 … 4
mediastring
pictureboolean
buttonsubscribe | view | read | learn_more | download | open | sign_up | buy | order | play | try | leave_request
website_namestring
scheduleSchedule

Fuente · Fuente de datos

Revisión de la referencia

Pro Panel
Pro Panel