Preferencias de privacidad

Funciones necesarias

Necesarias para la seguridad y las funciones básicas del sitio.

Siempre activas

Diagnósticos de Landing y grabación con contenido oculto

Mide las visitas públicas, el abandono y las interacciones con enlaces de registro mediante un ID anónimo exclusivo de esta pestaña, sin vincular cuentas. Se oculta todo el texto y se bloquean los formularios.

Analítica opcional de uso

¿Permitir analítica de uso de PostHog? Puedes cambiar tu elección en el pie de página cuando quieras.

Permitir también la grabación de sesiones en este sitio web público

La grabación de sesiones en el modo opcional entre sitios muestra las páginas públicas y las interacciones, con los datos introducidos y el contenido privado ocultos. La grabación de sesiones en la aplicación es una opción independiente.

Requiere analítica opcional; la grabación en este modo entre sitios está desactivada por defecto. El modo Landing de arriba funciona por separado.

Los análisis del navegador no activan los de la cuenta.

La búsqueda solo se carga cuando la usas. Explora todas las categorías a continuación.

Publicidad

Preparar acción publicitaria

Inmoviliza un comando campaign/adset/ad/creative/saved-audience exacto y sus efectos revisados. Las creaciones empiezan en PAUSED; la activación o los efectos presupuestarios requieren una autorización independiente para operaciones reales.

POST /advertising-api/actions/prepare

Contrato revisado: · sha256:9aedef8d43dd4514

Descripción general

Inmoviliza un comando campaign/adset/ad/creative/saved-audience exacto y sus efectos revisados. Las creaciones empiezan en PAUSED; la activación o los efectos presupuestarios requieren una autorización independiente para operaciones reales.

Una respuesta HTTP exitosa puede indicar aceptación, no finalización. Para trabajo en segundo plano, guarda el ID devuelto y consulta la misma operación hasta que termine. Una publicación programada o aceptada solo está publicada cuando la plataforma lo confirma; un tiempo de espera agotado en el cliente no determina el resultado.

Autenticación y permisos

Clases de credenciales aceptadas
user_session, delegated_oauth, personal_access_token
Capacidad delegada
agent:advertising_manage
Rol mínimo del espacio de trabajo
editor
Alcance del acceso
Recursos a los que este usuario está autorizado a acceder
Se requiere consentimiento para todos los espacios de trabajo
No
Cambia el estado
Sí
Cuando la operación se completa
synchronous_http_response

Un token solo puede usar los derechos de su propietario. Cada solicitud comprueba pertenencia al espacio, propiedad del recurso, espacios elegidos y capacidades concedidas. Los perfiles core y full cambian qué herramientas se muestran; no conceden acceso.

Campos de solicitud

Obligatorio significa obligatorio dentro del objeto principal y la rama elegida. Un campo secundario obligatorio no convierte en obligatorio un objeto principal opcional. Las reglas y nombres de campos siguientes se copian del contrato.

Campos de solicitud
Campo / ramaTipo / obligatorioRestricciones
$objectObligatorio en el objeto principal
  • additionalProperties: false
workspace_idstringObligatorio en el objeto principal
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
advertising_account_idstringObligatorio en el objeto principal
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
mutation_idstringObligatorio en el objeto principal
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
commandobjectObligatorio en el objeto principal—
commandoneOf 1objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 1stringObligatorio en el objeto principal
  • const: "create_campaign"
command.nameoneOf 1stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
command.budgetoneOf 1objectOpcional / elemento
  • additionalProperties: false
command.budget.kindoneOf 1stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
command.budget.amount_minoroneOf 1stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
command.objectiveoneOf 1stringObligatorio en el objeto principal
  • enum: ["OUTCOME_AWARENESS","OUTCOME_ENGAGEMENT","OUTCOME_LEADS","OUTCOME_SALES","OUTCOME_TRAFFIC","OUTCOME_APP_PROMOTION"]
command.special_ad_categoriesoneOf 1arrayOpcional / elemento
  • maxItems: 4
  • default: []
command.special_ad_categories[]oneOf 1stringOpcional / elemento
  • enum: ["CREDIT","EMPLOYMENT","HOUSING","ISSUES_ELECTIONS_POLITICS"]
command.statusoneOf 1stringOpcional / elemento
  • const: "PAUSED"
  • default: "PAUSED"
commandoneOf 2objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 2stringObligatorio en el objeto principal
  • const: "update_campaign"
command.object_idoneOf 2stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
command.nameoneOf 2stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
command.budgetoneOf 2objectOpcional / elemento
  • additionalProperties: false
command.budget.kindoneOf 2stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
command.budget.amount_minoroneOf 2stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
command.statusoneOf 2stringOpcional / elemento
  • enum: ["ACTIVE","PAUSED","ARCHIVED"]
commandoneOf 3objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 3stringObligatorio en el objeto principal
  • const: "create_adset"
command.campaign_idoneOf 3stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
command.nameoneOf 3stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
command.budgetoneOf 3objectOpcional / elemento
  • additionalProperties: false
command.budget.kindoneOf 3stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
command.budget.amount_minoroneOf 3stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
command.targetingoneOf 3objectObligatorio en el objeto principal
  • additionalProperties: false
command.targeting.geo_locationsoneOf 3objectObligatorio en el objeto principal
  • additionalProperties: false
command.targeting.geo_locations.countriesoneOf 3arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 25
command.targeting.geo_locations.countries[]oneOf 3stringOpcional / elemento
  • pattern: "^[A-Z]{2}$"
command.targeting.age_minoneOf 3integerOpcional / elemento
  • minimum: 18
  • maximum: 65
  • default: 18
command.targeting.age_maxoneOf 3integerOpcional / elemento
  • minimum: 18
  • maximum: 65
  • default: 65
command.targeting.gendersoneOf 3arrayOpcional / elemento
  • minItems: 1
  • maxItems: 2
command.targeting.genders[]oneOf 3numberOpcional / elemento—
command.targeting.genders[]oneOf 3 / anyOf 1numberOpcional / elemento
  • const: 1
command.targeting.genders[]oneOf 3 / anyOf 2numberOpcional / elemento
  • const: 2
command.targeting.localesoneOf 3arrayOpcional / elemento
  • maxItems: 25
command.targeting.locales[]oneOf 3integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
command.targeting.publisher_platformsoneOf 3arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 3
command.targeting.publisher_platforms[]oneOf 3stringOpcional / elemento
  • enum: ["facebook","instagram","threads"]
command.targeting.facebook_positionsoneOf 3arrayOpcional / elemento
  • maxItems: 4
command.targeting.facebook_positions[]oneOf 3stringOpcional / elemento
  • enum: ["feed","story","facebook_reels","video_feeds"]
command.targeting.instagram_positionsoneOf 3arrayOpcional / elemento
  • maxItems: 4
command.targeting.instagram_positions[]oneOf 3stringOpcional / elemento
  • enum: ["stream","story","reels","explore"]
command.targeting.threads_positionsoneOf 3arrayOpcional / elemento
  • maxItems: 1
command.targeting.threads_positions[]oneOf 3stringOpcional / elemento
  • const: "threads_stream"
command.targeting.custom_audience_idsoneOf 3arrayOpcional / elemento
  • maxItems: 4
command.targeting.custom_audience_ids[]oneOf 3stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.targeting.excluded_custom_audience_idsoneOf 3arrayOpcional / elemento
  • maxItems: 4
command.targeting.excluded_custom_audience_ids[]oneOf 3stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.billing_eventoneOf 3stringObligatorio en el objeto principal
  • enum: ["IMPRESSIONS","LINK_CLICKS"]
command.optimization_goaloneOf 3stringObligatorio en el objeto principal
  • enum: ["REACH","IMPRESSIONS","LINK_CLICKS","LANDING_PAGE_VIEWS","OFFSITE_CONVERSIONS","LEAD_GENERATION"]
command.bid_strategyoneOf 3stringOpcional / elemento
  • const: "LOWEST_COST_WITHOUT_CAP"
  • default: "LOWEST_COST_WITHOUT_CAP"
command.start_timeoneOf 3stringOpcional / elemento
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
command.end_timeoneOf 3stringOpcional / elemento
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
command.promoted_objectoneOf 3objectOpcional / elemento
  • additionalProperties: false
command.promoted_object.page_idoneOf 3stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.promoted_object.pixel_idoneOf 3stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.promoted_object.custom_event_typeoneOf 3stringOpcional / elemento
  • enum: ["PURCHASE","LEAD","COMPLETE_REGISTRATION","ADD_TO_CART"]
command.statusoneOf 3stringOpcional / elemento
  • const: "PAUSED"
  • default: "PAUSED"
commandoneOf 4objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 4stringObligatorio en el objeto principal
  • const: "update_adset"
command.object_idoneOf 4stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
command.nameoneOf 4stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
command.budgetoneOf 4objectOpcional / elemento
  • additionalProperties: false
command.budget.kindoneOf 4stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
command.budget.amount_minoroneOf 4stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
command.statusoneOf 4stringOpcional / elemento
  • enum: ["ACTIVE","PAUSED","ARCHIVED"]
command.targetingoneOf 4objectOpcional / elemento
  • additionalProperties: false
command.targeting.geo_locationsoneOf 4objectObligatorio en el objeto principal
  • additionalProperties: false
command.targeting.geo_locations.countriesoneOf 4arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 25
command.targeting.geo_locations.countries[]oneOf 4stringOpcional / elemento
  • pattern: "^[A-Z]{2}$"
command.targeting.age_minoneOf 4integerOpcional / elemento
  • minimum: 18
  • maximum: 65
  • default: 18
command.targeting.age_maxoneOf 4integerOpcional / elemento
  • minimum: 18
  • maximum: 65
  • default: 65
command.targeting.gendersoneOf 4arrayOpcional / elemento
  • minItems: 1
  • maxItems: 2
command.targeting.genders[]oneOf 4numberOpcional / elemento—
command.targeting.genders[]oneOf 4 / anyOf 1numberOpcional / elemento
  • const: 1
command.targeting.genders[]oneOf 4 / anyOf 2numberOpcional / elemento
  • const: 2
command.targeting.localesoneOf 4arrayOpcional / elemento
  • maxItems: 25
command.targeting.locales[]oneOf 4integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
command.targeting.publisher_platformsoneOf 4arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 3
command.targeting.publisher_platforms[]oneOf 4stringOpcional / elemento
  • enum: ["facebook","instagram","threads"]
command.targeting.facebook_positionsoneOf 4arrayOpcional / elemento
  • maxItems: 4
command.targeting.facebook_positions[]oneOf 4stringOpcional / elemento
  • enum: ["feed","story","facebook_reels","video_feeds"]
command.targeting.instagram_positionsoneOf 4arrayOpcional / elemento
  • maxItems: 4
command.targeting.instagram_positions[]oneOf 4stringOpcional / elemento
  • enum: ["stream","story","reels","explore"]
command.targeting.threads_positionsoneOf 4arrayOpcional / elemento
  • maxItems: 1
command.targeting.threads_positions[]oneOf 4stringOpcional / elemento
  • const: "threads_stream"
command.targeting.custom_audience_idsoneOf 4arrayOpcional / elemento
  • maxItems: 4
command.targeting.custom_audience_ids[]oneOf 4stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.targeting.excluded_custom_audience_idsoneOf 4arrayOpcional / elemento
  • maxItems: 4
command.targeting.excluded_custom_audience_ids[]oneOf 4stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.start_timeoneOf 4stringOpcional / elemento
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
command.end_timeoneOf 4stringOpcional / elemento
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
commandoneOf 5objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 5stringObligatorio en el objeto principal
  • const: "create_ad"
command.nameoneOf 5stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
command.adset_idoneOf 5stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
command.creative_idoneOf 5stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
command.statusoneOf 5stringOpcional / elemento
  • const: "PAUSED"
  • default: "PAUSED"
commandoneOf 6objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 6stringObligatorio en el objeto principal
  • const: "update_ad"
command.object_idoneOf 6stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
command.nameoneOf 6stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
command.creative_idoneOf 6stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.statusoneOf 6stringOpcional / elemento
  • enum: ["ACTIVE","PAUSED","ARCHIVED"]
commandoneOf 7objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 7stringObligatorio en el objeto principal
  • const: "create_creative"
command.nameoneOf 7stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
command.object_story_speconeOf 7objectOpcional / elemento
  • additionalProperties: false
command.object_story_spec.page_idoneOf 7stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
command.object_story_spec.instagram_user_idoneOf 7stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.object_story_spec.link_dataoneOf 7objectObligatorio en el objeto principal
  • additionalProperties: false
command.object_story_spec.link_data.linkoneOf 7stringObligatorio en el objeto principal
  • format: "uri"
  • maxLength: 2048
command.object_story_spec.link_data.messageoneOf 7stringObligatorio en el objeto principal
  • maxLength: 5000
command.object_story_spec.link_data.nameoneOf 7stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
command.object_story_spec.link_data.image_hashoneOf 7stringObligatorio en el objeto principal
  • pattern: "^[a-fA-F0-9]{16,128}$"
command.object_story_spec.link_data.call_to_actiononeOf 7stringOpcional / elemento
  • enum: ["LEARN_MORE","SHOP_NOW","SIGN_UP","CONTACT_US"]
command.object_story_idoneOf 7stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}_[1-9]\\d{1,24}$"
commandoneOf 8objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 8stringObligatorio en el objeto principal
  • const: "create_saved_audience"
command.nameoneOf 8stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
command.targetingoneOf 8objectObligatorio en el objeto principal
  • additionalProperties: false
command.targeting.geo_locationsoneOf 8objectObligatorio en el objeto principal
  • additionalProperties: false
command.targeting.geo_locations.countriesoneOf 8arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 25
command.targeting.geo_locations.countries[]oneOf 8stringOpcional / elemento
  • pattern: "^[A-Z]{2}$"
command.targeting.age_minoneOf 8integerOpcional / elemento
  • minimum: 18
  • maximum: 65
  • default: 18
command.targeting.age_maxoneOf 8integerOpcional / elemento
  • minimum: 18
  • maximum: 65
  • default: 65
command.targeting.gendersoneOf 8arrayOpcional / elemento
  • minItems: 1
  • maxItems: 2
command.targeting.genders[]oneOf 8numberOpcional / elemento—
command.targeting.genders[]oneOf 8 / anyOf 1numberOpcional / elemento
  • const: 1
command.targeting.genders[]oneOf 8 / anyOf 2numberOpcional / elemento
  • const: 2
command.targeting.localesoneOf 8arrayOpcional / elemento
  • maxItems: 25
command.targeting.locales[]oneOf 8integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
command.targeting.publisher_platformsoneOf 8arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 3
command.targeting.publisher_platforms[]oneOf 8stringOpcional / elemento
  • enum: ["facebook","instagram","threads"]
command.targeting.facebook_positionsoneOf 8arrayOpcional / elemento
  • maxItems: 4
command.targeting.facebook_positions[]oneOf 8stringOpcional / elemento
  • enum: ["feed","story","facebook_reels","video_feeds"]
command.targeting.instagram_positionsoneOf 8arrayOpcional / elemento
  • maxItems: 4
command.targeting.instagram_positions[]oneOf 8stringOpcional / elemento
  • enum: ["stream","story","reels","explore"]
command.targeting.threads_positionsoneOf 8arrayOpcional / elemento
  • maxItems: 1
command.targeting.threads_positions[]oneOf 8stringOpcional / elemento
  • const: "threads_stream"
command.targeting.custom_audience_idsoneOf 8arrayOpcional / elemento
  • maxItems: 4
command.targeting.custom_audience_ids[]oneOf 8stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.targeting.excluded_custom_audience_idsoneOf 8arrayOpcional / elemento
  • maxItems: 4
command.targeting.excluded_custom_audience_ids[]oneOf 8stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
commandoneOf 9objectObligatorio en el objeto principal
  • additionalProperties: false
command.operationoneOf 9stringObligatorio en el objeto principal
  • const: "update_saved_audience"
command.object_idoneOf 9stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
command.nameoneOf 9stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
command.targetingoneOf 9objectOpcional / elemento
  • additionalProperties: false
command.targeting.geo_locationsoneOf 9objectObligatorio en el objeto principal
  • additionalProperties: false
command.targeting.geo_locations.countriesoneOf 9arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 25
command.targeting.geo_locations.countries[]oneOf 9stringOpcional / elemento
  • pattern: "^[A-Z]{2}$"
command.targeting.age_minoneOf 9integerOpcional / elemento
  • minimum: 18
  • maximum: 65
  • default: 18
command.targeting.age_maxoneOf 9integerOpcional / elemento
  • minimum: 18
  • maximum: 65
  • default: 65
command.targeting.gendersoneOf 9arrayOpcional / elemento
  • minItems: 1
  • maxItems: 2
command.targeting.genders[]oneOf 9numberOpcional / elemento—
command.targeting.genders[]oneOf 9 / anyOf 1numberOpcional / elemento
  • const: 1
command.targeting.genders[]oneOf 9 / anyOf 2numberOpcional / elemento
  • const: 2
command.targeting.localesoneOf 9arrayOpcional / elemento
  • maxItems: 25
command.targeting.locales[]oneOf 9integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
command.targeting.publisher_platformsoneOf 9arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 3
command.targeting.publisher_platforms[]oneOf 9stringOpcional / elemento
  • enum: ["facebook","instagram","threads"]
command.targeting.facebook_positionsoneOf 9arrayOpcional / elemento
  • maxItems: 4
command.targeting.facebook_positions[]oneOf 9stringOpcional / elemento
  • enum: ["feed","story","facebook_reels","video_feeds"]
command.targeting.instagram_positionsoneOf 9arrayOpcional / elemento
  • maxItems: 4
command.targeting.instagram_positions[]oneOf 9stringOpcional / elemento
  • enum: ["stream","story","reels","explore"]
command.targeting.threads_positionsoneOf 9arrayOpcional / elemento
  • maxItems: 1
command.targeting.threads_positions[]oneOf 9stringOpcional / elemento
  • const: "threads_stream"
command.targeting.custom_audience_idsoneOf 9arrayOpcional / elemento
  • maxItems: 4
command.targeting.custom_audience_ids[]oneOf 9stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
command.targeting.excluded_custom_audience_idsoneOf 9arrayOpcional / elemento
  • maxItems: 4
command.targeting.excluded_custom_audience_ids[]oneOf 9stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
JSON Schema completo
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "advertising_account_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "mutation_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "command": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "create_campaign"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "budget": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "daily",
                    "lifetime"
                  ]
                },
                "amount_minor": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{0,11}$"
                }
              },
              "required": [
                "kind",
                "amount_minor"
              ],
              "additionalProperties": false
            },
            "objective": {
              "type": "string",
              "enum": [
                "OUTCOME_AWARENESS",
                "OUTCOME_ENGAGEMENT",
                "OUTCOME_LEADS",
                "OUTCOME_SALES",
                "OUTCOME_TRAFFIC",
                "OUTCOME_APP_PROMOTION"
              ]
            },
            "special_ad_categories": {
              "default": [],
              "maxItems": 4,
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "CREDIT",
                  "EMPLOYMENT",
                  "HOUSING",
                  "ISSUES_ELECTIONS_POLITICS"
                ]
              }
            },
            "status": {
              "default": "PAUSED",
              "type": "string",
              "const": "PAUSED"
            }
          },
          "required": [
            "operation",
            "name",
            "objective"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "update_campaign"
            },
            "object_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "budget": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "daily",
                    "lifetime"
                  ]
                },
                "amount_minor": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{0,11}$"
                }
              },
              "required": [
                "kind",
                "amount_minor"
              ],
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "PAUSED",
                "ARCHIVED"
              ]
            }
          },
          "required": [
            "operation",
            "object_id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "create_adset"
            },
            "campaign_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "budget": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "daily",
                    "lifetime"
                  ]
                },
                "amount_minor": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{0,11}$"
                }
              },
              "required": [
                "kind",
                "amount_minor"
              ],
              "additionalProperties": false
            },
            "targeting": {
              "type": "object",
              "properties": {
                "geo_locations": {
                  "type": "object",
                  "properties": {
                    "countries": {
                      "minItems": 1,
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    }
                  },
                  "required": [
                    "countries"
                  ],
                  "additionalProperties": false
                },
                "age_min": {
                  "default": 18,
                  "type": "integer",
                  "minimum": 18,
                  "maximum": 65
                },
                "age_max": {
                  "default": 65,
                  "type": "integer",
                  "minimum": 18,
                  "maximum": 65
                },
                "genders": {
                  "minItems": 1,
                  "maxItems": 2,
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 1
                      },
                      {
                        "type": "number",
                        "const": 2
                      }
                    ]
                  }
                },
                "locales": {
                  "maxItems": 25,
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "publisher_platforms": {
                  "minItems": 1,
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "facebook",
                      "instagram",
                      "threads"
                    ]
                  }
                },
                "facebook_positions": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "feed",
                      "story",
                      "facebook_reels",
                      "video_feeds"
                    ]
                  }
                },
                "instagram_positions": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "stream",
                      "story",
                      "reels",
                      "explore"
                    ]
                  }
                },
                "threads_positions": {
                  "maxItems": 1,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "const": "threads_stream"
                  }
                },
                "custom_audience_ids": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[1-9]\\d{1,24}$"
                  }
                },
                "excluded_custom_audience_ids": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[1-9]\\d{1,24}$"
                  }
                }
              },
              "required": [
                "geo_locations",
                "publisher_platforms"
              ],
              "additionalProperties": false
            },
            "billing_event": {
              "type": "string",
              "enum": [
                "IMPRESSIONS",
                "LINK_CLICKS"
              ]
            },
            "optimization_goal": {
              "type": "string",
              "enum": [
                "REACH",
                "IMPRESSIONS",
                "LINK_CLICKS",
                "LANDING_PAGE_VIEWS",
                "OFFSITE_CONVERSIONS",
                "LEAD_GENERATION"
              ]
            },
            "bid_strategy": {
              "default": "LOWEST_COST_WITHOUT_CAP",
              "type": "string",
              "const": "LOWEST_COST_WITHOUT_CAP"
            },
            "start_time": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "end_time": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "promoted_object": {
              "type": "object",
              "properties": {
                "page_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "pixel_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "custom_event_type": {
                  "type": "string",
                  "enum": [
                    "PURCHASE",
                    "LEAD",
                    "COMPLETE_REGISTRATION",
                    "ADD_TO_CART"
                  ]
                }
              },
              "additionalProperties": false
            },
            "status": {
              "default": "PAUSED",
              "type": "string",
              "const": "PAUSED"
            }
          },
          "required": [
            "operation",
            "campaign_id",
            "name",
            "targeting",
            "billing_event",
            "optimization_goal"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "update_adset"
            },
            "object_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "budget": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "daily",
                    "lifetime"
                  ]
                },
                "amount_minor": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{0,11}$"
                }
              },
              "required": [
                "kind",
                "amount_minor"
              ],
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "PAUSED",
                "ARCHIVED"
              ]
            },
            "targeting": {
              "type": "object",
              "properties": {
                "geo_locations": {
                  "type": "object",
                  "properties": {
                    "countries": {
                      "minItems": 1,
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    }
                  },
                  "required": [
                    "countries"
                  ],
                  "additionalProperties": false
                },
                "age_min": {
                  "default": 18,
                  "type": "integer",
                  "minimum": 18,
                  "maximum": 65
                },
                "age_max": {
                  "default": 65,
                  "type": "integer",
                  "minimum": 18,
                  "maximum": 65
                },
                "genders": {
                  "minItems": 1,
                  "maxItems": 2,
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 1
                      },
                      {
                        "type": "number",
                        "const": 2
                      }
                    ]
                  }
                },
                "locales": {
                  "maxItems": 25,
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "publisher_platforms": {
                  "minItems": 1,
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "facebook",
                      "instagram",
                      "threads"
                    ]
                  }
                },
                "facebook_positions": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "feed",
                      "story",
                      "facebook_reels",
                      "video_feeds"
                    ]
                  }
                },
                "instagram_positions": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "stream",
                      "story",
                      "reels",
                      "explore"
                    ]
                  }
                },
                "threads_positions": {
                  "maxItems": 1,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "const": "threads_stream"
                  }
                },
                "custom_audience_ids": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[1-9]\\d{1,24}$"
                  }
                },
                "excluded_custom_audience_ids": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[1-9]\\d{1,24}$"
                  }
                }
              },
              "required": [
                "geo_locations",
                "publisher_platforms"
              ],
              "additionalProperties": false
            },
            "start_time": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            "end_time": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            }
          },
          "required": [
            "operation",
            "object_id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "create_ad"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "adset_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            "creative_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            "status": {
              "default": "PAUSED",
              "type": "string",
              "const": "PAUSED"
            }
          },
          "required": [
            "operation",
            "name",
            "adset_id",
            "creative_id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "update_ad"
            },
            "object_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "creative_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            "status": {
              "type": "string",
              "enum": [
                "ACTIVE",
                "PAUSED",
                "ARCHIVED"
              ]
            }
          },
          "required": [
            "operation",
            "object_id"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "create_creative"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "object_story_spec": {
              "type": "object",
              "properties": {
                "page_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "instagram_user_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "link_data": {
                  "type": "object",
                  "properties": {
                    "link": {
                      "type": "string",
                      "maxLength": 2048,
                      "format": "uri"
                    },
                    "message": {
                      "type": "string",
                      "maxLength": 5000
                    },
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    },
                    "image_hash": {
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{16,128}$"
                    },
                    "call_to_action": {
                      "type": "string",
                      "enum": [
                        "LEARN_MORE",
                        "SHOP_NOW",
                        "SIGN_UP",
                        "CONTACT_US"
                      ]
                    }
                  },
                  "required": [
                    "link",
                    "message",
                    "image_hash"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "page_id",
                "link_data"
              ],
              "additionalProperties": false
            },
            "object_story_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}_[1-9]\\d{1,24}$"
            }
          },
          "required": [
            "operation",
            "name"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "create_saved_audience"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "targeting": {
              "type": "object",
              "properties": {
                "geo_locations": {
                  "type": "object",
                  "properties": {
                    "countries": {
                      "minItems": 1,
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    }
                  },
                  "required": [
                    "countries"
                  ],
                  "additionalProperties": false
                },
                "age_min": {
                  "default": 18,
                  "type": "integer",
                  "minimum": 18,
                  "maximum": 65
                },
                "age_max": {
                  "default": 65,
                  "type": "integer",
                  "minimum": 18,
                  "maximum": 65
                },
                "genders": {
                  "minItems": 1,
                  "maxItems": 2,
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 1
                      },
                      {
                        "type": "number",
                        "const": 2
                      }
                    ]
                  }
                },
                "locales": {
                  "maxItems": 25,
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "publisher_platforms": {
                  "minItems": 1,
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "facebook",
                      "instagram",
                      "threads"
                    ]
                  }
                },
                "facebook_positions": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "feed",
                      "story",
                      "facebook_reels",
                      "video_feeds"
                    ]
                  }
                },
                "instagram_positions": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "stream",
                      "story",
                      "reels",
                      "explore"
                    ]
                  }
                },
                "threads_positions": {
                  "maxItems": 1,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "const": "threads_stream"
                  }
                },
                "custom_audience_ids": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[1-9]\\d{1,24}$"
                  }
                },
                "excluded_custom_audience_ids": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[1-9]\\d{1,24}$"
                  }
                }
              },
              "required": [
                "geo_locations",
                "publisher_platforms"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "operation",
            "name",
            "targeting"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "operation": {
              "type": "string",
              "const": "update_saved_audience"
            },
            "object_id": {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "targeting": {
              "type": "object",
              "properties": {
                "geo_locations": {
                  "type": "object",
                  "properties": {
                    "countries": {
                      "minItems": 1,
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[A-Z]{2}$"
                      }
                    }
                  },
                  "required": [
                    "countries"
                  ],
                  "additionalProperties": false
                },
                "age_min": {
                  "default": 18,
                  "type": "integer",
                  "minimum": 18,
                  "maximum": 65
                },
                "age_max": {
                  "default": 65,
                  "type": "integer",
                  "minimum": 18,
                  "maximum": 65
                },
                "genders": {
                  "minItems": 1,
                  "maxItems": 2,
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "number",
                        "const": 1
                      },
                      {
                        "type": "number",
                        "const": 2
                      }
                    ]
                  }
                },
                "locales": {
                  "maxItems": 25,
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "exclusiveMinimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "publisher_platforms": {
                  "minItems": 1,
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "facebook",
                      "instagram",
                      "threads"
                    ]
                  }
                },
                "facebook_positions": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "feed",
                      "story",
                      "facebook_reels",
                      "video_feeds"
                    ]
                  }
                },
                "instagram_positions": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "stream",
                      "story",
                      "reels",
                      "explore"
                    ]
                  }
                },
                "threads_positions": {
                  "maxItems": 1,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "const": "threads_stream"
                  }
                },
                "custom_audience_ids": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[1-9]\\d{1,24}$"
                  }
                },
                "excluded_custom_audience_ids": {
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "pattern": "^[1-9]\\d{1,24}$"
                  }
                }
              },
              "required": [
                "geo_locations",
                "publisher_platforms"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "operation",
            "object_id"
          ],
          "additionalProperties": false
        }
      ]
    }
  },
  "required": [
    "workspace_id",
    "advertising_account_id",
    "mutation_id",
    "command"
  ],
  "additionalProperties": false
}

Respuesta y finalización

Estados HTTP de éxito: 200. Cuando la operación se completa: synchronous_http_response.

Una respuesta HTTP exitosa puede indicar aceptación, no finalización. Para trabajo en segundo plano, guarda el ID devuelto y consulta la misma operación hasta que termine. Una publicación programada o aceptada solo está publicada cuando la plataforma lo confirma; un tiempo de espera agotado en el cliente no determina el resultado.

Obligatorio significa obligatorio dentro del objeto principal y la rama elegida. Un campo secundario obligatorio no convierte en obligatorio un objeto principal opcional. Las reglas y nombres de campos siguientes se copian del contrato.

Respuesta y finalización
Campo / ramaTipo / obligatorioRestricciones
$objectObligatorio en el objeto principal—
contract_versionstringObligatorio en el objeto principal
  • const: "advertising/v1"
prepare_tokenstringObligatorio en el objeto principal
  • minLength: 32
  • maxLength: 128
expires_atstringObligatorio en el objeto principal
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
actionobjectObligatorio en el objeto principal—
action.idstringObligatorio en el objeto principal
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
action.workspace_idstringObligatorio en el objeto principal
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
action.advertising_account_idstringObligatorio en el objeto principal
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
action.mutation_idstringObligatorio en el objeto principal
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
action.statusstringObligatorio en el objeto principal
  • enum: ["prepared","queued","processing","succeeded","failed","unknown","cancelled"]
action.commandobjectObligatorio en el objeto principal—
action.commandoneOf 1objectObligatorio en el objeto principal—
action.command.operationoneOf 1stringObligatorio en el objeto principal
  • const: "create_campaign"
action.command.nameoneOf 1stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
action.command.budgetoneOf 1objectOpcional / elemento—
action.command.budget.kindoneOf 1stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
action.command.budget.amount_minoroneOf 1stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
action.command.objectiveoneOf 1stringObligatorio en el objeto principal
  • enum: ["OUTCOME_AWARENESS","OUTCOME_ENGAGEMENT","OUTCOME_LEADS","OUTCOME_SALES","OUTCOME_TRAFFIC","OUTCOME_APP_PROMOTION"]
action.command.special_ad_categoriesoneOf 1arrayObligatorio en el objeto principal
  • maxItems: 4
  • default: []
action.command.special_ad_categories[]oneOf 1stringOpcional / elemento
  • enum: ["CREDIT","EMPLOYMENT","HOUSING","ISSUES_ELECTIONS_POLITICS"]
action.command.statusoneOf 1stringObligatorio en el objeto principal
  • const: "PAUSED"
  • default: "PAUSED"
action.commandoneOf 2objectObligatorio en el objeto principal—
action.command.operationoneOf 2stringObligatorio en el objeto principal
  • const: "update_campaign"
action.command.object_idoneOf 2stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.command.nameoneOf 2stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
action.command.budgetoneOf 2objectOpcional / elemento—
action.command.budget.kindoneOf 2stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
action.command.budget.amount_minoroneOf 2stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
action.command.statusoneOf 2stringOpcional / elemento
  • enum: ["ACTIVE","PAUSED","ARCHIVED"]
action.commandoneOf 3objectObligatorio en el objeto principal—
action.command.operationoneOf 3stringObligatorio en el objeto principal
  • const: "create_adset"
action.command.campaign_idoneOf 3stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.command.nameoneOf 3stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
action.command.budgetoneOf 3objectOpcional / elemento—
action.command.budget.kindoneOf 3stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
action.command.budget.amount_minoroneOf 3stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
action.command.targetingoneOf 3objectObligatorio en el objeto principal—
action.command.targeting.geo_locationsoneOf 3objectObligatorio en el objeto principal—
action.command.targeting.geo_locations.countriesoneOf 3arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 25
action.command.targeting.geo_locations.countries[]oneOf 3stringOpcional / elemento
  • pattern: "^[A-Z]{2}$"
action.command.targeting.age_minoneOf 3integerObligatorio en el objeto principal
  • minimum: 18
  • maximum: 65
  • default: 18
action.command.targeting.age_maxoneOf 3integerObligatorio en el objeto principal
  • minimum: 18
  • maximum: 65
  • default: 65
action.command.targeting.gendersoneOf 3arrayOpcional / elemento
  • minItems: 1
  • maxItems: 2
action.command.targeting.genders[]oneOf 3numberOpcional / elemento—
action.command.targeting.genders[]oneOf 3 / anyOf 1numberOpcional / elemento
  • const: 1
action.command.targeting.genders[]oneOf 3 / anyOf 2numberOpcional / elemento
  • const: 2
action.command.targeting.localesoneOf 3arrayOpcional / elemento
  • maxItems: 25
action.command.targeting.locales[]oneOf 3integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
action.command.targeting.publisher_platformsoneOf 3arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 3
action.command.targeting.publisher_platforms[]oneOf 3stringOpcional / elemento
  • enum: ["facebook","instagram","threads"]
action.command.targeting.facebook_positionsoneOf 3arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.facebook_positions[]oneOf 3stringOpcional / elemento
  • enum: ["feed","story","facebook_reels","video_feeds"]
action.command.targeting.instagram_positionsoneOf 3arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.instagram_positions[]oneOf 3stringOpcional / elemento
  • enum: ["stream","story","reels","explore"]
action.command.targeting.threads_positionsoneOf 3arrayOpcional / elemento
  • maxItems: 1
action.command.targeting.threads_positions[]oneOf 3stringOpcional / elemento
  • const: "threads_stream"
action.command.targeting.custom_audience_idsoneOf 3arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.custom_audience_ids[]oneOf 3stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.targeting.excluded_custom_audience_idsoneOf 3arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.excluded_custom_audience_ids[]oneOf 3stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.billing_eventoneOf 3stringObligatorio en el objeto principal
  • enum: ["IMPRESSIONS","LINK_CLICKS"]
action.command.optimization_goaloneOf 3stringObligatorio en el objeto principal
  • enum: ["REACH","IMPRESSIONS","LINK_CLICKS","LANDING_PAGE_VIEWS","OFFSITE_CONVERSIONS","LEAD_GENERATION"]
action.command.bid_strategyoneOf 3stringObligatorio en el objeto principal
  • const: "LOWEST_COST_WITHOUT_CAP"
  • default: "LOWEST_COST_WITHOUT_CAP"
action.command.start_timeoneOf 3stringOpcional / elemento
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
action.command.end_timeoneOf 3stringOpcional / elemento
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
action.command.promoted_objectoneOf 3objectOpcional / elemento—
action.command.promoted_object.page_idoneOf 3stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.promoted_object.pixel_idoneOf 3stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.promoted_object.custom_event_typeoneOf 3stringOpcional / elemento
  • enum: ["PURCHASE","LEAD","COMPLETE_REGISTRATION","ADD_TO_CART"]
action.command.statusoneOf 3stringObligatorio en el objeto principal
  • const: "PAUSED"
  • default: "PAUSED"
action.commandoneOf 4objectObligatorio en el objeto principal—
action.command.operationoneOf 4stringObligatorio en el objeto principal
  • const: "update_adset"
action.command.object_idoneOf 4stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.command.nameoneOf 4stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
action.command.budgetoneOf 4objectOpcional / elemento—
action.command.budget.kindoneOf 4stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
action.command.budget.amount_minoroneOf 4stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
action.command.statusoneOf 4stringOpcional / elemento
  • enum: ["ACTIVE","PAUSED","ARCHIVED"]
action.command.targetingoneOf 4objectOpcional / elemento—
action.command.targeting.geo_locationsoneOf 4objectObligatorio en el objeto principal—
action.command.targeting.geo_locations.countriesoneOf 4arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 25
action.command.targeting.geo_locations.countries[]oneOf 4stringOpcional / elemento
  • pattern: "^[A-Z]{2}$"
action.command.targeting.age_minoneOf 4integerObligatorio en el objeto principal
  • minimum: 18
  • maximum: 65
  • default: 18
action.command.targeting.age_maxoneOf 4integerObligatorio en el objeto principal
  • minimum: 18
  • maximum: 65
  • default: 65
action.command.targeting.gendersoneOf 4arrayOpcional / elemento
  • minItems: 1
  • maxItems: 2
action.command.targeting.genders[]oneOf 4numberOpcional / elemento—
action.command.targeting.genders[]oneOf 4 / anyOf 1numberOpcional / elemento
  • const: 1
action.command.targeting.genders[]oneOf 4 / anyOf 2numberOpcional / elemento
  • const: 2
action.command.targeting.localesoneOf 4arrayOpcional / elemento
  • maxItems: 25
action.command.targeting.locales[]oneOf 4integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
action.command.targeting.publisher_platformsoneOf 4arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 3
action.command.targeting.publisher_platforms[]oneOf 4stringOpcional / elemento
  • enum: ["facebook","instagram","threads"]
action.command.targeting.facebook_positionsoneOf 4arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.facebook_positions[]oneOf 4stringOpcional / elemento
  • enum: ["feed","story","facebook_reels","video_feeds"]
action.command.targeting.instagram_positionsoneOf 4arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.instagram_positions[]oneOf 4stringOpcional / elemento
  • enum: ["stream","story","reels","explore"]
action.command.targeting.threads_positionsoneOf 4arrayOpcional / elemento
  • maxItems: 1
action.command.targeting.threads_positions[]oneOf 4stringOpcional / elemento
  • const: "threads_stream"
action.command.targeting.custom_audience_idsoneOf 4arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.custom_audience_ids[]oneOf 4stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.targeting.excluded_custom_audience_idsoneOf 4arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.excluded_custom_audience_ids[]oneOf 4stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.start_timeoneOf 4stringOpcional / elemento
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
action.command.end_timeoneOf 4stringOpcional / elemento
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
action.commandoneOf 5objectObligatorio en el objeto principal—
action.command.operationoneOf 5stringObligatorio en el objeto principal
  • const: "create_ad"
action.command.nameoneOf 5stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
action.command.adset_idoneOf 5stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.command.creative_idoneOf 5stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.command.statusoneOf 5stringObligatorio en el objeto principal
  • const: "PAUSED"
  • default: "PAUSED"
action.commandoneOf 6objectObligatorio en el objeto principal—
action.command.operationoneOf 6stringObligatorio en el objeto principal
  • const: "update_ad"
action.command.object_idoneOf 6stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.command.nameoneOf 6stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
action.command.creative_idoneOf 6stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.statusoneOf 6stringOpcional / elemento
  • enum: ["ACTIVE","PAUSED","ARCHIVED"]
action.commandoneOf 7objectObligatorio en el objeto principal—
action.command.operationoneOf 7stringObligatorio en el objeto principal
  • const: "create_creative"
action.command.nameoneOf 7stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
action.command.object_story_speconeOf 7objectOpcional / elemento—
action.command.object_story_spec.page_idoneOf 7stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.command.object_story_spec.instagram_user_idoneOf 7stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.object_story_spec.link_dataoneOf 7objectObligatorio en el objeto principal—
action.command.object_story_spec.link_data.linkoneOf 7stringObligatorio en el objeto principal
  • format: "uri"
  • maxLength: 2048
action.command.object_story_spec.link_data.messageoneOf 7stringObligatorio en el objeto principal
  • maxLength: 5000
action.command.object_story_spec.link_data.nameoneOf 7stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
action.command.object_story_spec.link_data.image_hashoneOf 7stringObligatorio en el objeto principal
  • pattern: "^[a-fA-F0-9]{16,128}$"
action.command.object_story_spec.link_data.call_to_actiononeOf 7stringOpcional / elemento
  • enum: ["LEARN_MORE","SHOP_NOW","SIGN_UP","CONTACT_US"]
action.command.object_story_idoneOf 7stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}_[1-9]\\d{1,24}$"
action.commandoneOf 8objectObligatorio en el objeto principal—
action.command.operationoneOf 8stringObligatorio en el objeto principal
  • const: "create_saved_audience"
action.command.nameoneOf 8stringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 200
action.command.targetingoneOf 8objectObligatorio en el objeto principal—
action.command.targeting.geo_locationsoneOf 8objectObligatorio en el objeto principal—
action.command.targeting.geo_locations.countriesoneOf 8arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 25
action.command.targeting.geo_locations.countries[]oneOf 8stringOpcional / elemento
  • pattern: "^[A-Z]{2}$"
action.command.targeting.age_minoneOf 8integerObligatorio en el objeto principal
  • minimum: 18
  • maximum: 65
  • default: 18
action.command.targeting.age_maxoneOf 8integerObligatorio en el objeto principal
  • minimum: 18
  • maximum: 65
  • default: 65
action.command.targeting.gendersoneOf 8arrayOpcional / elemento
  • minItems: 1
  • maxItems: 2
action.command.targeting.genders[]oneOf 8numberOpcional / elemento—
action.command.targeting.genders[]oneOf 8 / anyOf 1numberOpcional / elemento
  • const: 1
action.command.targeting.genders[]oneOf 8 / anyOf 2numberOpcional / elemento
  • const: 2
action.command.targeting.localesoneOf 8arrayOpcional / elemento
  • maxItems: 25
action.command.targeting.locales[]oneOf 8integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
action.command.targeting.publisher_platformsoneOf 8arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 3
action.command.targeting.publisher_platforms[]oneOf 8stringOpcional / elemento
  • enum: ["facebook","instagram","threads"]
action.command.targeting.facebook_positionsoneOf 8arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.facebook_positions[]oneOf 8stringOpcional / elemento
  • enum: ["feed","story","facebook_reels","video_feeds"]
action.command.targeting.instagram_positionsoneOf 8arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.instagram_positions[]oneOf 8stringOpcional / elemento
  • enum: ["stream","story","reels","explore"]
action.command.targeting.threads_positionsoneOf 8arrayOpcional / elemento
  • maxItems: 1
action.command.targeting.threads_positions[]oneOf 8stringOpcional / elemento
  • const: "threads_stream"
action.command.targeting.custom_audience_idsoneOf 8arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.custom_audience_ids[]oneOf 8stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.targeting.excluded_custom_audience_idsoneOf 8arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.excluded_custom_audience_ids[]oneOf 8stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.commandoneOf 9objectObligatorio en el objeto principal—
action.command.operationoneOf 9stringObligatorio en el objeto principal
  • const: "update_saved_audience"
action.command.object_idoneOf 9stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.command.nameoneOf 9stringOpcional / elemento
  • minLength: 1
  • maxLength: 200
action.command.targetingoneOf 9objectOpcional / elemento—
action.command.targeting.geo_locationsoneOf 9objectObligatorio en el objeto principal—
action.command.targeting.geo_locations.countriesoneOf 9arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 25
action.command.targeting.geo_locations.countries[]oneOf 9stringOpcional / elemento
  • pattern: "^[A-Z]{2}$"
action.command.targeting.age_minoneOf 9integerObligatorio en el objeto principal
  • minimum: 18
  • maximum: 65
  • default: 18
action.command.targeting.age_maxoneOf 9integerObligatorio en el objeto principal
  • minimum: 18
  • maximum: 65
  • default: 65
action.command.targeting.gendersoneOf 9arrayOpcional / elemento
  • minItems: 1
  • maxItems: 2
action.command.targeting.genders[]oneOf 9numberOpcional / elemento—
action.command.targeting.genders[]oneOf 9 / anyOf 1numberOpcional / elemento
  • const: 1
action.command.targeting.genders[]oneOf 9 / anyOf 2numberOpcional / elemento
  • const: 2
action.command.targeting.localesoneOf 9arrayOpcional / elemento
  • maxItems: 25
action.command.targeting.locales[]oneOf 9integerOpcional / elemento
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
action.command.targeting.publisher_platformsoneOf 9arrayObligatorio en el objeto principal
  • minItems: 1
  • maxItems: 3
action.command.targeting.publisher_platforms[]oneOf 9stringOpcional / elemento
  • enum: ["facebook","instagram","threads"]
action.command.targeting.facebook_positionsoneOf 9arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.facebook_positions[]oneOf 9stringOpcional / elemento
  • enum: ["feed","story","facebook_reels","video_feeds"]
action.command.targeting.instagram_positionsoneOf 9arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.instagram_positions[]oneOf 9stringOpcional / elemento
  • enum: ["stream","story","reels","explore"]
action.command.targeting.threads_positionsoneOf 9arrayOpcional / elemento
  • maxItems: 1
action.command.targeting.threads_positions[]oneOf 9stringOpcional / elemento
  • const: "threads_stream"
action.command.targeting.custom_audience_idsoneOf 9arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.custom_audience_ids[]oneOf 9stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.command.targeting.excluded_custom_audience_idsoneOf 9arrayOpcional / elemento
  • maxItems: 4
action.command.targeting.excluded_custom_audience_ids[]oneOf 9stringOpcional / elemento
  • pattern: "^[1-9]\\d{1,24}$"
action.reviewed_digeststringObligatorio en el objeto principal
  • pattern: "^[a-f0-9]{64}$"
action.effectsobjectObligatorio en el objeto principal—
action.effects.creates_objectbooleanObligatorio en el objeto principal—
action.effects.initial_statusstring | nullObligatorio en el objeto principal—
action.effects.initial_statusanyOf 1stringObligatorio en el objeto principal
  • const: "PAUSED"
action.effects.initial_statusanyOf 2nullObligatorio en el objeto principal—
action.effects.activates_deliverybooleanObligatorio en el objeto principal—
action.effects.changes_budgetbooleanObligatorio en el objeto principal—
action.effects.changes_audiencebooleanObligatorio en el objeto principal—
action.effects.changes_creativebooleanObligatorio en el objeto principal—
action.effects.currencystringObligatorio en el objeto principal
  • pattern: "^[A-Z]{3}$"
action.effects.timezonestringObligatorio en el objeto principal
  • minLength: 1
  • maxLength: 100
action.effects.budgetobject | nullObligatorio en el objeto principal—
action.effects.budgetanyOf 1objectObligatorio en el objeto principal—
action.effects.budget.kindanyOf 1stringObligatorio en el objeto principal
  • enum: ["daily","lifetime"]
action.effects.budget.amount_minoranyOf 1stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{0,11}$"
action.effects.budgetanyOf 2nullObligatorio en el objeto principal—
action.live_approvalobjectObligatorio en el objeto principal—
action.live_approval.requiredbooleanObligatorio en el objeto principal—
action.live_approval.statestringObligatorio en el objeto principal
  • enum: ["not_required","missing","approved","expired","revoked","invalid"]
action.live_approval.reasonstring | nullObligatorio en el objeto principal—
action.live_approval.reasonanyOf 1stringObligatorio en el objeto principal
  • maxLength: 100
action.live_approval.reasonanyOf 2nullObligatorio en el objeto principal—
action.live_approval.expires_atstring | nullObligatorio en el objeto principal—
action.live_approval.expires_atanyOf 1stringObligatorio en el objeto principal
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
action.live_approval.expires_atanyOf 2nullObligatorio en el objeto principal—
action.live_approval.approved_bystring | nullObligatorio en el objeto principal—
action.live_approval.approved_byanyOf 1stringObligatorio en el objeto principal
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
action.live_approval.approved_byanyOf 2nullObligatorio en el objeto principal—
action.provider_object_idstring | nullObligatorio en el objeto principal—
action.provider_object_idanyOf 1stringObligatorio en el objeto principal
  • pattern: "^[1-9]\\d{1,24}$"
action.provider_object_idanyOf 2nullObligatorio en el objeto principal—
action.failure_codestring | nullObligatorio en el objeto principal—
action.failure_codeanyOf 1stringObligatorio en el objeto principal
  • maxLength: 100
action.failure_codeanyOf 2nullObligatorio en el objeto principal—
action.created_atstringObligatorio en el objeto principal
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
action.completed_atstring | nullObligatorio en el objeto principal—
action.completed_atanyOf 1stringObligatorio en el objeto principal
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
action.completed_atanyOf 2nullObligatorio en el objeto principal—
JSON Schema completo
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract_version": {
      "type": "string",
      "const": "advertising/v1"
    },
    "prepare_token": {
      "type": "string",
      "minLength": 32,
      "maxLength": 128
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "action": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "workspace_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "advertising_account_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "mutation_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "status": {
          "type": "string",
          "enum": [
            "prepared",
            "queued",
            "processing",
            "succeeded",
            "failed",
            "unknown",
            "cancelled"
          ]
        },
        "command": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "create_campaign"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "budget": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "daily",
                        "lifetime"
                      ]
                    },
                    "amount_minor": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{0,11}$"
                    }
                  },
                  "required": [
                    "kind",
                    "amount_minor"
                  ]
                },
                "objective": {
                  "type": "string",
                  "enum": [
                    "OUTCOME_AWARENESS",
                    "OUTCOME_ENGAGEMENT",
                    "OUTCOME_LEADS",
                    "OUTCOME_SALES",
                    "OUTCOME_TRAFFIC",
                    "OUTCOME_APP_PROMOTION"
                  ]
                },
                "special_ad_categories": {
                  "default": [],
                  "maxItems": 4,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": [
                      "CREDIT",
                      "EMPLOYMENT",
                      "HOUSING",
                      "ISSUES_ELECTIONS_POLITICS"
                    ]
                  }
                },
                "status": {
                  "default": "PAUSED",
                  "type": "string",
                  "const": "PAUSED"
                }
              },
              "required": [
                "operation",
                "name",
                "objective",
                "special_ad_categories",
                "status"
              ]
            },
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "update_campaign"
                },
                "object_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "budget": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "daily",
                        "lifetime"
                      ]
                    },
                    "amount_minor": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{0,11}$"
                    }
                  },
                  "required": [
                    "kind",
                    "amount_minor"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "ACTIVE",
                    "PAUSED",
                    "ARCHIVED"
                  ]
                }
              },
              "required": [
                "operation",
                "object_id"
              ]
            },
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "create_adset"
                },
                "campaign_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "budget": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "daily",
                        "lifetime"
                      ]
                    },
                    "amount_minor": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{0,11}$"
                    }
                  },
                  "required": [
                    "kind",
                    "amount_minor"
                  ]
                },
                "targeting": {
                  "type": "object",
                  "properties": {
                    "geo_locations": {
                      "type": "object",
                      "properties": {
                        "countries": {
                          "minItems": 1,
                          "maxItems": 25,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          }
                        }
                      },
                      "required": [
                        "countries"
                      ]
                    },
                    "age_min": {
                      "default": 18,
                      "type": "integer",
                      "minimum": 18,
                      "maximum": 65
                    },
                    "age_max": {
                      "default": 65,
                      "type": "integer",
                      "minimum": 18,
                      "maximum": 65
                    },
                    "genders": {
                      "minItems": 1,
                      "maxItems": 2,
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "number",
                            "const": 1
                          },
                          {
                            "type": "number",
                            "const": 2
                          }
                        ]
                      }
                    },
                    "locales": {
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "publisher_platforms": {
                      "minItems": 1,
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "facebook",
                          "instagram",
                          "threads"
                        ]
                      }
                    },
                    "facebook_positions": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "feed",
                          "story",
                          "facebook_reels",
                          "video_feeds"
                        ]
                      }
                    },
                    "instagram_positions": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "stream",
                          "story",
                          "reels",
                          "explore"
                        ]
                      }
                    },
                    "threads_positions": {
                      "maxItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "const": "threads_stream"
                      }
                    },
                    "custom_audience_ids": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d{1,24}$"
                      }
                    },
                    "excluded_custom_audience_ids": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d{1,24}$"
                      }
                    }
                  },
                  "required": [
                    "geo_locations",
                    "age_min",
                    "age_max",
                    "publisher_platforms"
                  ]
                },
                "billing_event": {
                  "type": "string",
                  "enum": [
                    "IMPRESSIONS",
                    "LINK_CLICKS"
                  ]
                },
                "optimization_goal": {
                  "type": "string",
                  "enum": [
                    "REACH",
                    "IMPRESSIONS",
                    "LINK_CLICKS",
                    "LANDING_PAGE_VIEWS",
                    "OFFSITE_CONVERSIONS",
                    "LEAD_GENERATION"
                  ]
                },
                "bid_strategy": {
                  "default": "LOWEST_COST_WITHOUT_CAP",
                  "type": "string",
                  "const": "LOWEST_COST_WITHOUT_CAP"
                },
                "start_time": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                },
                "end_time": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                },
                "promoted_object": {
                  "type": "object",
                  "properties": {
                    "page_id": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{1,24}$"
                    },
                    "pixel_id": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{1,24}$"
                    },
                    "custom_event_type": {
                      "type": "string",
                      "enum": [
                        "PURCHASE",
                        "LEAD",
                        "COMPLETE_REGISTRATION",
                        "ADD_TO_CART"
                      ]
                    }
                  }
                },
                "status": {
                  "default": "PAUSED",
                  "type": "string",
                  "const": "PAUSED"
                }
              },
              "required": [
                "operation",
                "campaign_id",
                "name",
                "targeting",
                "billing_event",
                "optimization_goal",
                "bid_strategy",
                "status"
              ]
            },
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "update_adset"
                },
                "object_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "budget": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "daily",
                        "lifetime"
                      ]
                    },
                    "amount_minor": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{0,11}$"
                    }
                  },
                  "required": [
                    "kind",
                    "amount_minor"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "ACTIVE",
                    "PAUSED",
                    "ARCHIVED"
                  ]
                },
                "targeting": {
                  "type": "object",
                  "properties": {
                    "geo_locations": {
                      "type": "object",
                      "properties": {
                        "countries": {
                          "minItems": 1,
                          "maxItems": 25,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          }
                        }
                      },
                      "required": [
                        "countries"
                      ]
                    },
                    "age_min": {
                      "default": 18,
                      "type": "integer",
                      "minimum": 18,
                      "maximum": 65
                    },
                    "age_max": {
                      "default": 65,
                      "type": "integer",
                      "minimum": 18,
                      "maximum": 65
                    },
                    "genders": {
                      "minItems": 1,
                      "maxItems": 2,
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "number",
                            "const": 1
                          },
                          {
                            "type": "number",
                            "const": 2
                          }
                        ]
                      }
                    },
                    "locales": {
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "publisher_platforms": {
                      "minItems": 1,
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "facebook",
                          "instagram",
                          "threads"
                        ]
                      }
                    },
                    "facebook_positions": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "feed",
                          "story",
                          "facebook_reels",
                          "video_feeds"
                        ]
                      }
                    },
                    "instagram_positions": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "stream",
                          "story",
                          "reels",
                          "explore"
                        ]
                      }
                    },
                    "threads_positions": {
                      "maxItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "const": "threads_stream"
                      }
                    },
                    "custom_audience_ids": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d{1,24}$"
                      }
                    },
                    "excluded_custom_audience_ids": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d{1,24}$"
                      }
                    }
                  },
                  "required": [
                    "geo_locations",
                    "age_min",
                    "age_max",
                    "publisher_platforms"
                  ]
                },
                "start_time": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                },
                "end_time": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                }
              },
              "required": [
                "operation",
                "object_id"
              ]
            },
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "create_ad"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "adset_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "creative_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "status": {
                  "default": "PAUSED",
                  "type": "string",
                  "const": "PAUSED"
                }
              },
              "required": [
                "operation",
                "name",
                "adset_id",
                "creative_id",
                "status"
              ]
            },
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "update_ad"
                },
                "object_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "creative_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "ACTIVE",
                    "PAUSED",
                    "ARCHIVED"
                  ]
                }
              },
              "required": [
                "operation",
                "object_id"
              ]
            },
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "create_creative"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "object_story_spec": {
                  "type": "object",
                  "properties": {
                    "page_id": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{1,24}$"
                    },
                    "instagram_user_id": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{1,24}$"
                    },
                    "link_data": {
                      "type": "object",
                      "properties": {
                        "link": {
                          "type": "string",
                          "maxLength": 2048,
                          "format": "uri"
                        },
                        "message": {
                          "type": "string",
                          "maxLength": 5000
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "image_hash": {
                          "type": "string",
                          "pattern": "^[a-fA-F0-9]{16,128}$"
                        },
                        "call_to_action": {
                          "type": "string",
                          "enum": [
                            "LEARN_MORE",
                            "SHOP_NOW",
                            "SIGN_UP",
                            "CONTACT_US"
                          ]
                        }
                      },
                      "required": [
                        "link",
                        "message",
                        "image_hash"
                      ]
                    }
                  },
                  "required": [
                    "page_id",
                    "link_data"
                  ]
                },
                "object_story_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}_[1-9]\\d{1,24}$"
                }
              },
              "required": [
                "operation",
                "name"
              ]
            },
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "create_saved_audience"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "targeting": {
                  "type": "object",
                  "properties": {
                    "geo_locations": {
                      "type": "object",
                      "properties": {
                        "countries": {
                          "minItems": 1,
                          "maxItems": 25,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          }
                        }
                      },
                      "required": [
                        "countries"
                      ]
                    },
                    "age_min": {
                      "default": 18,
                      "type": "integer",
                      "minimum": 18,
                      "maximum": 65
                    },
                    "age_max": {
                      "default": 65,
                      "type": "integer",
                      "minimum": 18,
                      "maximum": 65
                    },
                    "genders": {
                      "minItems": 1,
                      "maxItems": 2,
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "number",
                            "const": 1
                          },
                          {
                            "type": "number",
                            "const": 2
                          }
                        ]
                      }
                    },
                    "locales": {
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "publisher_platforms": {
                      "minItems": 1,
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "facebook",
                          "instagram",
                          "threads"
                        ]
                      }
                    },
                    "facebook_positions": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "feed",
                          "story",
                          "facebook_reels",
                          "video_feeds"
                        ]
                      }
                    },
                    "instagram_positions": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "stream",
                          "story",
                          "reels",
                          "explore"
                        ]
                      }
                    },
                    "threads_positions": {
                      "maxItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "const": "threads_stream"
                      }
                    },
                    "custom_audience_ids": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d{1,24}$"
                      }
                    },
                    "excluded_custom_audience_ids": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d{1,24}$"
                      }
                    }
                  },
                  "required": [
                    "geo_locations",
                    "age_min",
                    "age_max",
                    "publisher_platforms"
                  ]
                }
              },
              "required": [
                "operation",
                "name",
                "targeting"
              ]
            },
            {
              "type": "object",
              "properties": {
                "operation": {
                  "type": "string",
                  "const": "update_saved_audience"
                },
                "object_id": {
                  "type": "string",
                  "pattern": "^[1-9]\\d{1,24}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "targeting": {
                  "type": "object",
                  "properties": {
                    "geo_locations": {
                      "type": "object",
                      "properties": {
                        "countries": {
                          "minItems": 1,
                          "maxItems": 25,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          }
                        }
                      },
                      "required": [
                        "countries"
                      ]
                    },
                    "age_min": {
                      "default": 18,
                      "type": "integer",
                      "minimum": 18,
                      "maximum": 65
                    },
                    "age_max": {
                      "default": 65,
                      "type": "integer",
                      "minimum": 18,
                      "maximum": 65
                    },
                    "genders": {
                      "minItems": 1,
                      "maxItems": 2,
                      "type": "array",
                      "items": {
                        "anyOf": [
                          {
                            "type": "number",
                            "const": 1
                          },
                          {
                            "type": "number",
                            "const": 2
                          }
                        ]
                      }
                    },
                    "locales": {
                      "maxItems": 25,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "publisher_platforms": {
                      "minItems": 1,
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "facebook",
                          "instagram",
                          "threads"
                        ]
                      }
                    },
                    "facebook_positions": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "feed",
                          "story",
                          "facebook_reels",
                          "video_feeds"
                        ]
                      }
                    },
                    "instagram_positions": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "stream",
                          "story",
                          "reels",
                          "explore"
                        ]
                      }
                    },
                    "threads_positions": {
                      "maxItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "const": "threads_stream"
                      }
                    },
                    "custom_audience_ids": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d{1,24}$"
                      }
                    },
                    "excluded_custom_audience_ids": {
                      "maxItems": 4,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "pattern": "^[1-9]\\d{1,24}$"
                      }
                    }
                  },
                  "required": [
                    "geo_locations",
                    "age_min",
                    "age_max",
                    "publisher_platforms"
                  ]
                }
              },
              "required": [
                "operation",
                "object_id"
              ]
            }
          ]
        },
        "reviewed_digest": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "effects": {
          "type": "object",
          "properties": {
            "creates_object": {
              "type": "boolean"
            },
            "initial_status": {
              "anyOf": [
                {
                  "type": "string",
                  "const": "PAUSED"
                },
                {
                  "type": "null"
                }
              ]
            },
            "activates_delivery": {
              "type": "boolean"
            },
            "changes_budget": {
              "type": "boolean"
            },
            "changes_audience": {
              "type": "boolean"
            },
            "changes_creative": {
              "type": "boolean"
            },
            "currency": {
              "type": "string",
              "pattern": "^[A-Z]{3}$"
            },
            "timezone": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100
            },
            "budget": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "daily",
                        "lifetime"
                      ]
                    },
                    "amount_minor": {
                      "type": "string",
                      "pattern": "^[1-9]\\d{0,11}$"
                    }
                  },
                  "required": [
                    "kind",
                    "amount_minor"
                  ]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "creates_object",
            "initial_status",
            "activates_delivery",
            "changes_budget",
            "changes_audience",
            "changes_creative",
            "currency",
            "timezone",
            "budget"
          ]
        },
        "live_approval": {
          "type": "object",
          "properties": {
            "required": {
              "type": "boolean"
            },
            "state": {
              "type": "string",
              "enum": [
                "not_required",
                "missing",
                "approved",
                "expired",
                "revoked",
                "invalid"
              ]
            },
            "reason": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ]
            },
            "expires_at": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "approved_by": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "required",
            "state",
            "reason",
            "expires_at",
            "approved_by"
          ]
        },
        "provider_object_id": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[1-9]\\d{1,24}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "failure_code": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 100
            },
            {
              "type": "null"
            }
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        "completed_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "workspace_id",
        "advertising_account_id",
        "mutation_id",
        "status",
        "command",
        "reviewed_digest",
        "effects",
        "live_approval",
        "provider_object_id",
        "failure_code",
        "created_at",
        "completed_at"
      ]
    }
  },
  "required": [
    "contract_version",
    "prepare_token",
    "expires_at",
    "action"
  ]
}

Errores y reintentos seguros

Comprueba el estado HTTP y el cuerpo de respuesta. Un error de validación 400 puede contener un ZodError; los errores del controlador usan los campos error, message y code. Conserva request_id o x-request-id para el diagnóstico, sin credenciales. Corrige los errores de acceso 401/403 antes de reintentar y respeta Retry-After para 429. Si una escritura es incierta o devuelve 5xx, consulta primero el resultado existente. Reutiliza una clave de idempotencia solo donde se admita; el comportamiento de reintento varía por operación y no garantiza una entrega exactamente una vez.

Guía de solución de problemas

Ejemplos

Estos ejemplos usan valores ficticios comprobados con los esquemas. Sustituye los IDs por otros autorizados, los archivos multimedia por recursos listos y las fechas por tu hora de publicación confirmada. Comprueba la elegibilidad de la cuenta antes de enviar una escritura. Esta página no envía solicitudes API.

Establece SOSOAPI_ACCESS_TOKEN en tu servidor con una credencial aceptada por esta operación y mantenla fuera del código del navegador. Para un agente de IA, usa sosoapi auth login para iniciar sesión en el navegador y deja a la CLI renovar sus credenciales.

request.json

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "advertising_account_id": "11111111-1111-4111-8111-111111111111",
  "mutation_id": "11111111-1111-4111-8111-111111111111",
  "command": {
    "operation": "create_campaign",
    "name": "example",
    "objective": "OUTCOME_AWARENESS"
  }
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/advertising-api/actions/prepare" \
  -H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

JavaScript

// Server-side JavaScript. Do not print tokens or credential-bearing responses.
const token = process.env.SOSOAPI_ACCESS_TOKEN;
if (!token) throw new Error("Set an accepted credential for this operation");
const response = await fetch("https://gqeshlawtcexsapabaui.supabase.co/functions/v1/advertising-api/actions/prepare", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "advertising_account_id": "11111111-1111-4111-8111-111111111111",
  "mutation_id": "11111111-1111-4111-8111-111111111111",
  "command": {
    "operation": "create_campaign",
    "name": "example",
    "objective": "OUTCOME_AWARENESS"
  }
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /advertising-api/actions/prepare < request.json

Ejemplo de respuesta sintética

{
  "contract_version": "advertising/v1",
  "prepare_token": "exampleaaaaaaaaaaaaaaaaaaaaaaaaa",
  "expires_at": "2099-01-15T09:00:00Z",
  "action": {
    "id": "11111111-1111-4111-8111-111111111111",
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "advertising_account_id": "11111111-1111-4111-8111-111111111111",
    "mutation_id": "11111111-1111-4111-8111-111111111111",
    "status": "prepared",
    "command": {
      "operation": "create_campaign",
      "name": "example",
      "objective": "OUTCOME_AWARENESS",
      "special_ad_categories": [],
      "status": "PAUSED"
    },
    "reviewed_digest": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
    "effects": {
      "creates_object": false,
      "initial_status": null,
      "activates_delivery": false,
      "changes_budget": false,
      "changes_audience": false,
      "changes_creative": false,
      "currency": "USD",
      "timezone": "UTC",
      "budget": null
    },
    "live_approval": {
      "required": false,
      "state": "not_required",
      "reason": null,
      "expires_at": null,
      "approved_by": null
    },
    "provider_object_id": null,
    "failure_code": null,
    "created_at": "2099-01-15T09:00:00Z",
    "completed_at": null
  }
}

MCP: sosoapi_ads_actions_prepare