# Create companion ad - V3

Post new companion details and receive the new companion ID.
Regenerates the creative's MetaVAST document after the companion is created.

Endpoint: POST /v3.0/creatives/{creativeId}/companions
Version: v1.0

## Path parameters:

  - `creativeId` (integer, required)
    Creative ID

## Request body:

  - `application/json` (unknown)
    Companion ad details

## Request fields (application/json):

  - `details` (object, required)

  - `details.adServer` (string, required)
    AdServer tag name

  - `details.typ` (string, required)
    Companion type (static, iframe, or html)
    Enum: "static", "iframe", "html"

  - `details.width` (integer, required)
    Width in pixels

  - `details.height` (integer, required)
    Height in pixels

  - `details.landingUrl` (string, required)
    Declared landing URL

  - `details.iFrameUrlOrHTML` (string)
    iFrame URL (for iframe type) or HTML content (for html type)

  - `details.clickthroughUrl` (string)
    Clickthrough URL (required for static companions; must be null for iframe/html)

  - `fileExtension` (string)
    File extension

  - `fileName` (string)
    File name

  - `resourceUrl` (string)
    Resource URL for all other companion types

  - `resourceData` (string)
    Resource data encoded in Data URI Scheme for static companion types

## Response 201:

  - `201` (unknown)
    Companion created successfully

## Response 201 fields (application/json):

  - `companionId` (integer)

## Response 400:

  - `400` (unknown)
    Bad request

## Response 400 fields (application/json):

  - `field_error` (array)

  - `field_error.error` (string)

  - `field_error.index` (integer)
    Index in bulk request (for bulk operations)

  - `field_error.code` (string)

  - `field_error.name` (string)

  - `field_error.field` (string)

## Response 401:

  - `401` (unknown)
    Unauthorized - invalid or missing JWT

## Response 403:

  - `403` (unknown)
    Forbidden - no access to creative

## Response 404:

  - `404` (unknown)
    Creative not found

