API Reference
The Veraj Media REST API lets you manage creatives, campaigns, analytics, and ad zones programmatically. All requests use JSON and require authentication.
Overview
The API is organized around REST principles. All requests should be made to:
All request and response bodies are encoded as JSON. Use the Content-Type: application/json header for requests with a body.
The API supports GET, POST, PUT, PATCH, and DELETE methods. All timestamps are returned in UTC as ISO 8601 strings. Resource IDs are prefixed strings (e.g. cr_, cmp_, zn_) and are immutable once created.
Authentication
Authenticate by including your API key in the Authorization header of every request.
API keys can be generated from your account dashboard under Settings → API Keys. Each key is scoped to your organization and can be assigned one of three permission levels:
| Scope | Access |
|---|---|
read | Read-only access to all resources |
write | Read and write access to all resources |
admin | Full access including user management and billing |
Keep your key secret — do not expose it in client-side code. If a key is compromised, revoke it immediately from your dashboard.
Errors
The API uses standard HTTP status codes. Errors return a JSON body with a message field and an optional code for programmatic handling.
| Status | Meaning |
|---|---|
| 200 | Success |
| 201 | Resource created |
| 204 | Deleted successfully (no body returned) |
| 400 | Bad request — check your parameters |
| 401 | Unauthorized — invalid or missing API key |
| 403 | Forbidden — your key lacks the required scope |
| 404 | Resource not found |
| 409 | Conflict — resource already exists or state mismatch |
| 422 | Unprocessable entity — validation failed |
| 429 | Rate limit exceeded |
| 500 | Internal server error |
| 503 | Service unavailable — try again shortly |
Every response includes a X-Request-Id header. Include this value when contacting support about a specific request.
Rate Limits
API requests are rate-limited per API key. The current limits are:
| Plan | Limit | Burst |
|---|---|---|
| Starter | 100 requests / minute | 20 concurrent |
| Growth | 500 requests / minute | 50 concurrent |
| Enterprise | 2,000 requests / minute | 200 concurrent |
Rate limit information is included in every response via headers:
When you exceed the limit, you'll receive a 429 response. The Retry-After header tells you how many seconds to wait before retrying.
Pagination
All list endpoints return paginated results. Use page and per_page query parameters to navigate results.
Every paginated response includes a pagination object:
The default page size is 25. The maximum is 100. Requesting beyond the last page returns an empty data array.
Versioning
The API is versioned via the URL path. The current version is v1. When breaking changes are introduced, a new version will be released and the previous version will remain supported for at least 12 months.
Non-breaking changes (new fields, new endpoints, new optional parameters) are added to the current version without a version bump. Build your integration to tolerate unknown JSON fields.
Creatives
Upload and manage ad creatives — images, HTML5 banners, and video assets. Creatives are the visual content served inside ad zones.
Returns a paginated list of creatives in your account.
Query Parameters
| Name | Type | Description |
|---|---|---|
| page | integer | Optional. Page number (default: 1) |
| per_page | integer | Optional. Results per page (default: 25, max: 100) |
| type | string | Optional. Filter by type: image, html5, video |
| status | string | Optional. Filter: active, archived, pending_review |
| search | string | Optional. Search by name (case-insensitive partial match) |
| sort | string | Optional. Sort field: created_at, name, impressions (default: created_at) |
| order | string | Optional. asc or desc (default: desc) |
Response
Upload a new creative asset. Send as multipart/form-data. Maximum file size is 10 MB for images, 2 MB for HTML5, and 50 MB for video.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Required. Display name (max 120 characters) |
| file | file | Required. The creative file (PNG, JPG, GIF, HTML, MP4, WEBM) |
| click_url | string | Optional. Click-through destination URL |
| tags | array | Optional. Array of string tags for organization |
| alt_text | string | Optional. Accessibility alt text for the creative |
Response
Retrieve a single creative by its ID. Returns the full creative object including all metadata and current delivery status.
Update a creative's metadata. You cannot replace the file itself — upload a new creative instead.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Optional. Updated display name |
| click_url | string | Optional. Updated click-through URL |
| tags | array | Optional. Replace tags (send full array) |
| alt_text | string | Optional. Updated alt text |
Archive a creative. Archived creatives stop serving but are not deleted. Use POST /v1/creatives/:id/unarchive to restore.
Create a copy of an existing creative with a new ID. The file is shared — no additional storage is used. Optionally override metadata in the request body.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Optional. Name for the copy (default: original name + " (copy)") |
Permanently delete a creative and its hosted file. This also removes it from any campaigns it was assigned to. Returns 204 No Content on success. This action cannot be undone.
Campaigns
Create and manage advertising campaigns. A campaign groups creatives, targeting rules, budget, and scheduling into a single deliverable unit.
Returns a paginated list of campaigns.
Query Parameters
| Name | Type | Description |
|---|---|---|
| status | string | Optional. Filter: draft, active, paused, ended |
| search | string | Optional. Search by campaign name |
| page | integer | Optional. Page number |
| per_page | integer | Optional. Results per page (default: 25, max: 100) |
Response
Create a new campaign. Campaigns are created in draft status. Use the activate endpoint to start delivery.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Required. Campaign name |
| creative_ids | array | Required. Array of creative IDs to include |
| zone_ids | array | Optional. Target specific ad zones |
| audience_id | string | Optional. Audience segment to target |
| budget_daily | number | Optional. Daily budget cap in USD |
| budget_total | number | Optional. Total lifetime budget in USD |
| bid_cpm | number | Optional. Maximum CPM bid (default: auto-optimized) |
| start_date | string | Optional. ISO 8601 start date |
| end_date | string | Optional. ISO 8601 end date |
| frequency_cap | object | Optional. { "max": 3, "period": "day" } |
Retrieve a single campaign with full configuration, budget details, and current spend.
Update an existing campaign's settings, creatives, targeting, or budget. Changes to active campaigns take effect within 60 seconds.
Move a campaign from draft or paused to active. The campaign must have at least one approved creative and a valid budget.
Pause an active campaign. Delivery stops immediately. The campaign retains all settings and can be reactivated.
Permanently delete a campaign. Active campaigns must be paused first. Analytics data is retained for 90 days after deletion.
Ad Zones
Manage ad zones — the placement slots on publisher sites where creatives are displayed. Each zone has a fixed size and belongs to a single domain.
Returns all ad zones available in your network.
Query Parameters
| Name | Type | Description |
|---|---|---|
| domain | string | Optional. Filter by publisher domain |
| size | string | Optional. Filter by size, e.g. 300x250 |
| page | integer | Optional. Page number |
Response
Register a new ad zone for a publisher site. An embed code is generated automatically upon creation.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Required. Zone display name |
| size | string | Required. Dimensions, e.g. 300x250, 728x90, 970x250 |
| domain | string | Required. Publisher domain |
| floor_cpm | number | Optional. Minimum CPM price for this zone |
| allowed_types | array | Optional. Allowed creative types: ["image", "html5"] (default: all) |
Retrieve a single ad zone by ID, including its embed code and current fill rate.
Update a zone's name, floor price, or allowed creative types. Size and domain cannot be changed after creation.
Delete an ad zone. The embed code will stop serving ads immediately. Active campaigns targeting this zone will be updated automatically.
Audiences
Define audience segments for campaign targeting. Audiences are built from rules based on geography, device, browser, language, and custom key-value pairs.
Returns all audience segments in your account with estimated reach.
Create a new audience segment using targeting rules.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Required. Audience name |
| rules | array | Required. Array of targeting rule objects |
| match | string | Optional. all (AND) or any (OR) — default: all |
Rule Object
Supported fields: geo.country, geo.region, geo.city, device.type (desktop, mobile, tablet), device.os, browser.name, language, custom.*.
Supported operators: eq, neq, in, not_in, contains, starts_with.
Retrieve a single audience with its rules and current estimated reach.
Update an audience's name or targeting rules. Changes propagate to active campaigns using this audience within 5 minutes.
Delete an audience segment. Campaigns using this audience will fall back to untargeted delivery.
Scheduling
Control when campaigns deliver with dayparting schedules. Assign a schedule to a campaign to restrict delivery to specific hours and days of the week.
Returns all dayparting schedules in your account.
Create a dayparting schedule. Specify active time windows by day-of-week and hour ranges.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Required. Schedule name |
| timezone | string | Required. IANA timezone, e.g. America/New_York |
| windows | array | Required. Array of time window objects |
Window Object
Hours are in 24-hour format (0–23). A window from start_hour: 9 to end_hour: 17 means delivery from 9:00 AM to 5:00 PM in the specified timezone.
Attach a dayparting schedule to a campaign. Only one schedule can be active per campaign. Pass { "schedule_id": null } to remove.
Body Parameters
| Name | Type | Description |
|---|---|---|
| schedule_id | string | Required. Schedule ID or null to detach |
Delete a schedule. It is automatically detached from any campaigns that reference it.
Analytics
Retrieve real-time and historical performance data for your campaigns, creatives, and zones.
Get aggregated performance metrics for a campaign over a date range.
Query Parameters
| Name | Type | Description |
|---|---|---|
| start | string | Required. Start date (YYYY-MM-DD) |
| end | string | Required. End date (YYYY-MM-DD) |
| granularity | string | Optional. hour, day, week (default: day) |
Response
Get performance metrics for a single creative across all campaigns. Accepts the same start, end, and granularity parameters as campaign analytics.
Get performance and fill-rate metrics for a specific ad zone. Useful for publishers monitoring inventory utilization.
Response
Get a high-level summary of your account's performance across all campaigns for the given date range. Includes total impressions, clicks, spend, and top-performing campaigns.
Query Parameters
| Name | Type | Description |
|---|---|---|
| start | string | Required. Start date (YYYY-MM-DD) |
| end | string | Required. End date (YYYY-MM-DD) |
Get a geographic breakdown of impressions and clicks for a campaign, grouped by country. Accepts the same start and end parameters.
Response
Reports
Generate and download CSV or JSON reports for offline analysis. Reports are built asynchronously and available for download once complete.
Request a new report. The report is generated in the background. Poll the report status or subscribe to the report.completed webhook event.
Body Parameters
| Name | Type | Description |
|---|---|---|
| type | string | Required. Report type: campaign_summary, creative_breakdown, zone_performance, geo_report |
| start | string | Required. Start date (YYYY-MM-DD) |
| end | string | Required. End date (YYYY-MM-DD) |
| format | string | Optional. csv or json (default: csv) |
| campaign_ids | array | Optional. Limit to specific campaigns |
Response
Check the status of a report. When status is completed, a download_url is included. Download URLs expire after 24 hours.
Response
List all reports in your account, ordered by creation date. Completed reports include their download URL if still valid.
Webhooks
Subscribe to real-time event notifications. When an event occurs, Veraj Media sends a POST request to your configured URL with a JSON payload.
Returns all registered webhook endpoints.
Register a new webhook endpoint to receive event notifications.
Body Parameters
| Name | Type | Description |
|---|---|---|
| url | string | Required. HTTPS endpoint URL |
| events | array | Required. Event types to subscribe to |
| secret | string | Optional. Signing secret for payload verification (auto-generated if omitted) |
Available Events
| Event | Description |
|---|---|
campaign.activated | Campaign started delivering |
campaign.paused | Campaign was paused |
campaign.ended | Campaign reached its end date or budget cap |
campaign.budget_warning | Campaign has used 80% of its total budget |
creative.approved | Creative passed review and is ready to serve |
creative.rejected | Creative was rejected during review |
report.completed | Async report is ready for download |
zone.low_fill | Zone fill rate dropped below 50% |
Payload Format
Payloads are signed with HMAC-SHA256 using your webhook secret. Verify the X-Signature header to ensure authenticity.
Update a webhook's URL, subscribed events, or signing secret.
Send a test event to your webhook endpoint. Returns the HTTP status code your server responded with.
Delete a webhook endpoint. Events will no longer be delivered to this URL.
Users & API Keys
Manage team members and API keys for your organization. Requires admin scope.
Returns all team members in your organization with their roles and last active date.
Response
Send an invitation email to a new team member.
Body Parameters
| Name | Type | Description |
|---|---|---|
| string | Required. Email address | |
| role | string | Optional. admin, editor, or viewer (default: viewer) |
Remove a user from your organization. Their API keys are automatically revoked.
Returns all API keys in your organization. Key values are masked except the last 4 characters.
Generate a new API key. The full key value is only returned once in the response — store it securely.
Body Parameters
| Name | Type | Description |
|---|---|---|
| name | string | Required. Descriptive label for the key |
| scope | string | Optional. read, write, or admin (default: read) |
| expires_at | string | Optional. ISO 8601 expiration date (default: never) |
Response
Permanently revoke an API key. Any requests using this key will immediately start receiving 401 Unauthorized.
Billing
View billing information, invoices, and current usage. Requires admin scope.
Returns your current plan, billing cycle, and usage for the current period.
Response
Returns a list of past invoices with amounts, status, and PDF download links.
Response
Get day-by-day usage breakdown for the current billing period, including impressions served, bandwidth, and storage.
Query Parameters
| Name | Type | Description |
|---|---|---|
| start | string | Optional. Start date (defaults to current period start) |
| end | string | Optional. End date (defaults to today) |