Методы API
DEVELOPER PLATFORM · v1

API, с которым удобно работать

CRM, кампании, аналитика и интеграции. Точные контракты, понятные примеры и подписанные вебхуки.

Скачать OpenAPI

Private preview: API доступен с проектным ключом. Публичные SLA и сроки поддержки ещё не установлены.

GET

Текущая аудитория Campaign

/api/v1/developer/campaigns/{campaignId}/audience

Возвращает aggregate summary только snapshot, на который сейчас ссылается Campaign; audience равна null до freeze и никогда не содержит recipient identities.

Право доступаcampaigns.read

Authorization: Bearer YOUR_PROJECT_TOKEN

Параметры

campaignIdобязательно · path

stringminLength: 1 · maxLength: 160

JSON Schema
{
  "type": "string",
  "minLength": 1,
  "maxLength": 160
}

Примеры запроса

curl --request GET   'https://YOUR_NOVA_HOST/api/v1/developer/campaigns/CAMPAIGN_ID/audience'   --header 'Authorization: Bearer YOUR_PROJECT_TOKEN'

Ответы

200 Current frozen Campaign audience aggregate
application/json

object

audienceобязательно
object | null
Вложенная схема

object | null

filterобязательно
object
Вложенная схема

object

contactStatusобязательно
stringenum: ["active","archived","all"]
segmentId
string | nullminLength: 1 · maxLength: 160 · default: null
providerTypesобязательно
arraymaxItems: 100
Вложенная схема

arraymaxItems: 100

stringminLength: 1 · maxLength: 160

JSON Schema
{
  "type": "string",
  "minLength": 1,
  "maxLength": 160
}
JSON Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "minLength": 1,
    "maxLength": 160
  },
  "maxItems": 100
}
requiredTagsобязательно
arraymaxItems: 100
Вложенная схема

arraymaxItems: 100

stringminLength: 1 · maxLength: 160

JSON Schema
{
  "type": "string",
  "minLength": 1,
  "maxLength": 160
}
JSON Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "minLength": 1,
    "maxLength": 160
  },
  "maxItems": 100
}
stageIdsобязательно
arraymaxItems: 100
Вложенная схема

arraymaxItems: 100

stringminLength: 1 · maxLength: 160

JSON Schema
{
  "type": "string",
  "minLength": 1,
  "maxLength": 160
}
JSON Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "minLength": 1,
    "maxLength": 160
  },
  "maxItems": 100
}
loyaltyCardRequired
booleandefault: false
loyaltyLevelIds
arraymaxItems: 100 · default: []
Вложенная схема

arraymaxItems: 100 · default: []

stringminLength: 1 · maxLength: 160

JSON Schema
{
  "type": "string",
  "minLength": 1,
  "maxLength": 160
}
JSON Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "minLength": 1,
    "maxLength": 160
  },
  "maxItems": 100,
  "default": []
}
minimumLoyaltyBalance
integer | nullminimum: 0 · maximum: 1000000000 · default: null
readyStampOfferIds
arraymaxItems: 100 · default: []
Вложенная схема

arraymaxItems: 100 · default: []

stringminLength: 1 · maxLength: 160

JSON Schema
{
  "type": "string",
  "minLength": 1,
  "maxLength": 160
}
JSON Schema
{
  "type": "array",
  "items": {
    "type": "string",
    "minLength": 1,
    "maxLength": 160
  },
  "maxItems": 100,
  "default": []
}
JSON Schema
{
  "type": "object",
  "properties": {
    "contactStatus": {
      "type": "string",
      "enum": [
        "active",
        "archived",
        "all"
      ]
    },
    "segmentId": {
      "type": [
        "string",
        "null"
      ],
      "minLength": 1,
      "maxLength": 160,
      "default": null
    },
    "providerTypes": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160
      },
      "maxItems": 100
    },
    "requiredTags": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160
      },
      "maxItems": 100
    },
    "stageIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160
      },
      "maxItems": 100
    },
    "loyaltyCardRequired": {
      "type": "boolean",
      "default": false
    },
    "loyaltyLevelIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160
      },
      "maxItems": 100,
      "default": []
    },
    "minimumLoyaltyBalance": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0,
      "maximum": 1000000000,
      "default": null
    },
    "readyStampOfferIds": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 160
      },
      "maxItems": 100,
      "default": []
    }
  },
  "required": [
    "contactStatus",
    "providerTypes",
    "requiredTags",
    "stageIds"
  ]
}
candidateCountобязательно
integerminimum: 0
eligibleCountобязательно
integerminimum: 0
exclusionsобязательно
object
Вложенная схема

object

consent_not_grantedобязательно
integerminimum: 0
suppressedобязательно
integerminimum: 0
mergedобязательно
integerminimum: 0
filter_mismatchобязательно
integerminimum: 0
channel_unavailableобязательно
integerminimum: 0
duplicateобязательно
integerminimum: 0
JSON Schema
{
  "type": "object",
  "properties": {
    "consent_not_granted": {
      "type": "integer",
      "minimum": 0
    },
    "suppressed": {
      "type": "integer",
      "minimum": 0
    },
    "merged": {
      "type": "integer",
      "minimum": 0
    },
    "filter_mismatch": {
      "type": "integer",
      "minimum": 0
    },
    "channel_unavailable": {
      "type": "integer",
      "minimum": 0
    },
    "duplicate": {
      "type": "integer",
      "minimum": 0
    }
  },
  "required": [
    "consent_not_granted",
    "suppressed",
    "merged",
    "filter_mismatch",
    "channel_unavailable",
    "duplicate"
  ]
}
JSON Schema
{
  "type": [
    "object",
    "null"
  ],
  "properties": {
    "filter": {
      "type": "object",
      "properties": {
        "contactStatus": {
          "type": "string",
          "enum": [
            "active",
            "archived",
            "all"
          ]
        },
        "segmentId": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "maxLength": 160,
          "default": null
        },
        "providerTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "maxItems": 100
        },
        "requiredTags": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "maxItems": 100
        },
        "stageIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "maxItems": 100
        },
        "loyaltyCardRequired": {
          "type": "boolean",
          "default": false
        },
        "loyaltyLevelIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "maxItems": 100,
          "default": []
        },
        "minimumLoyaltyBalance": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "maximum": 1000000000,
          "default": null
        },
        "readyStampOfferIds": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "maxItems": 100,
          "default": []
        }
      },
      "required": [
        "contactStatus",
        "providerTypes",
        "requiredTags",
        "stageIds"
      ]
    },
    "candidateCount": {
      "type": "integer",
      "minimum": 0
    },
    "eligibleCount": {
      "type": "integer",
      "minimum": 0
    },
    "exclusions": {
      "type": "object",
      "properties": {
        "consent_not_granted": {
          "type": "integer",
          "minimum": 0
        },
        "suppressed": {
          "type": "integer",
          "minimum": 0
        },
        "merged": {
          "type": "integer",
          "minimum": 0
        },
        "filter_mismatch": {
          "type": "integer",
          "minimum": 0
        },
        "channel_unavailable": {
          "type": "integer",
          "minimum": 0
        },
        "duplicate": {
          "type": "integer",
          "minimum": 0
        }
      },
      "required": [
        "consent_not_granted",
        "suppressed",
        "merged",
        "filter_mismatch",
        "channel_unavailable",
        "duplicate"
      ]
    }
  },
  "required": [
    "filter",
    "candidateCount",
    "eligibleCount",
    "exclusions"
  ]
}
JSON Schema
{
  "type": "object",
  "properties": {
    "audience": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "filter": {
          "type": "object",
          "properties": {
            "contactStatus": {
              "type": "string",
              "enum": [
                "active",
                "archived",
                "all"
              ]
            },
            "segmentId": {
              "type": [
                "string",
                "null"
              ],
              "minLength": 1,
              "maxLength": 160,
              "default": null
            },
            "providerTypes": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "maxItems": 100
            },
            "requiredTags": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "maxItems": 100
            },
            "stageIds": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "maxItems": 100
            },
            "loyaltyCardRequired": {
              "type": "boolean",
              "default": false
            },
            "loyaltyLevelIds": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "maxItems": 100,
              "default": []
            },
            "minimumLoyaltyBalance": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "maximum": 1000000000,
              "default": null
            },
            "readyStampOfferIds": {
              "type": "array",
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 160
              },
              "maxItems": 100,
              "default": []
            }
          },
          "required": [
            "contactStatus",
            "providerTypes",
            "requiredTags",
            "stageIds"
          ]
        },
        "candidateCount": {
          "type": "integer",
          "minimum": 0
        },
        "eligibleCount": {
          "type": "integer",
          "minimum": 0
        },
        "exclusions": {
          "type": "object",
          "properties": {
            "consent_not_granted": {
              "type": "integer",
              "minimum": 0
            },
            "suppressed": {
              "type": "integer",
              "minimum": 0
            },
            "merged": {
              "type": "integer",
              "minimum": 0
            },
            "filter_mismatch": {
              "type": "integer",
              "minimum": 0
            },
            "channel_unavailable": {
              "type": "integer",
              "minimum": 0
            },
            "duplicate": {
              "type": "integer",
              "minimum": 0
            }
          },
          "required": [
            "consent_not_granted",
            "suppressed",
            "merged",
            "filter_mismatch",
            "channel_unavailable",
            "duplicate"
          ]
        }
      },
      "required": [
        "filter",
        "candidateCount",
        "eligibleCount",
        "exclusions"
      ]
    }
  },
  "required": [
    "audience"
  ],
  "additionalProperties": false,
  "$ref": "#/components/schemas/DeveloperCampaignAudienceCurrentResponse"
}
400 Invalid Campaign identifier
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
401 Invalid developer credential
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
403 Campaign directory unavailable
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
404 Campaign not found
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
429 Developer API rate limit exceeded
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}
503 Developer API rate limiter unavailable
application/problem+json

object

type
stringformat: "uri" · default: "about:blank"
titleобязательно
string
statusобязательно
integerminimum: 100 · maximum: 599
detail
string
instance
string
errors
object
JSON Schema
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "format": "uri",
      "default": "about:blank"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 100,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "errors": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "title",
    "status"
  ]
}