---
title: "Create an ad config"
method: POST
path: "/v2/sites/{site_id}/ad_configs/"
tags: ["ssai"]
---

# Create an ad config

`POST /v2/sites/{site_id}/ad_configs/`

Create an ad config for a site

## Path parameters

- `site_id` string, required — Unique identifier for a resource

## Request body

- AdConfigMetadata
  - `metadata` object, required
    - `name` string — Eight-character ID of an ad config
    - `preroll_url` string — Pre-roll ad tag URL of an ad config
    - `midroll_url` string — Mid-roll ad tag URL of an ad config
    - `preroll_target_duration` string, nullable — Duration of the preroll ad break in <em>HH:MM:SS.mmm</em> format The maximum accepted duration is <em>01:00:00.000</em> (1 hour)
    - `midroll_target_duration` string, nullable — Duration of the midroll ad break in <em>HH:MM:SS.mmm</em> format The maximum accepted duration is <em>01:00:00.000</em> (1 hour)
    - `time_between_ads` string — Default time between ads used for media items without individual timing sets

## Response `201`

Request to create ad config successful

- AdConfigResourceRead
  - `schema` string
  - `id` string — Unique identifier for a resource
  - `created` string — Date and time at which the resource was created
  - `last_modified` string — Date and time at which the resource was most recently modified
  - `type` string — Name of the type of resource.
  - `relationships` object — Ancilliary resources associated to the primary resource being read
  - `metadata` object, required
    - `name` string — Eight-character ID of an ad config
    - `preroll_url` string — Pre-roll ad tag URL of an ad config
    - `midroll_url` string — Mid-roll ad tag URL of an ad config
    - `preroll_target_duration` string, nullable — Duration of the preroll ad break in <em>HH:MM:SS.mmm</em> format The maximum accepted duration is <em>01:00:00.000</em> (1 hour)
    - `midroll_target_duration` string, nullable — Duration of the midroll ad break in <em>HH:MM:SS.mmm</em> format The maximum accepted duration is <em>01:00:00.000</em> (1 hour)
    - `time_between_ads` string — Default time between ads used for media items without individual timing sets

---

[API](https://skmtc.net/jwplayer/apis/management-api-v2.md) · [All operations](https://skmtc.net/jwplayer/apis/management-api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/jwplayer/management-api-v2/revisions/180db7cada27/schema)
