Get the allowed date range

If you need to limit the date selection for a specific object (a campaign, banner, or site), request the allowed date range:

GET /api/v2/reports/available-dates?level=campaign&id=12345

Query parameters

Parameter

Type

Required status

Description

level

string

Yes

Supported report levels:

  • owner: A general report.
  • supercampaign: At the supercampaign level.
  • campaign: At the campaign level.
  • banner: At the banner level.
  • site: At the site level.
  • section: At the section level.
  • place: At the placement level.

objectId

string

Yes

Object ID exactly as it appears in the user interface for this level (string). Numeric IDs can be sent as a digit string.

ownerId

string (positive integer)

Optional for admins and assistants. Required for advertisers and website owners.

Website owner account (see Authorization).

Successful response

Field

Type

Description

result

object

result.level

string

level echoed back in lowercase (campaign / banner / site).

result.id

string

Echo of the passed id.

result.dateRange

object

result.dateRange.from

string

Lower limit. The format is defined by the data source — typically a compact date string.

result.dateRange.to

string

Upper limit.

Sample request

curl -H 'Authorization: OAuth <token>' \
  'https://adfox.yandex.ru/api/v2/reports/available-dates?level=campaign&objectId=12345&ownerId=67890'

Response example

{
  "result": {
    "level": "campaign",
    "id": "12345",
    "dateRange": {
      "from": "2023-01-01",
      "to": "2024-06-30"
    }
  }
}

Error

For error codes, see the Error codes page.