# Create a campaign or sub-campaign

Endpoint: POST /campaign
Version: 3.0.0
Security: bearerAuth, apiKeyAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer Token

  - `apiKeyAuth` (unknown)
    apiKey in header Key

## Request fields (application/json):

  - `name` (string, required)
    Name of the campaign

  - `description` (string)
    Description of the campaign

  - `parentCampaignId` (string)
    Parent campaign Id in case of subcampaign

  - `startDate` (integer)
    StartDate of the campaign

  - `endDate` (integer)
    EndDate of the campaign

  - `tags` (array)
    Tags on the campaign

  - `status` (string, required)
    Status of the campaign. e.g. Draft, Approved

  - `archived` (boolean)
    True if campaign is archived

  - `partnerCustomFields` (object)
    Partner level custom fields on the campaign

  - `clientCustomFields` (object)
    Client level custom fields on the campaign

  - `externalSource` (string)
    External system name

  - `externalSourceId` (string)
    External system Id

  - `visibility` (object)
    Visibility of the campaign

  - `visibility.globallyVisible` (boolean)
    True if Asset is globally visible

  - `visibility.visibilityConfig` (array)
    Config to share the asset

  - `visibility.visibilityConfig.type` (string, required)
    Type e.g. USER, GLOBAL, CLIENT

  - `visibility.visibilityConfig.ids` (array)
    IDs based on type.

  - `externalCampaignDetails` (array)
    External connector details for a campaign

  - `externalCampaignDetails.connector` (string)

  - `externalCampaignDetails.externalIds` (array)

## Response 200:

  - `200` (unknown)
    Success

## Response 200 fields (application/json):

  - `id` (string)
    Id of the campaign

  - `name` (string)
    Name of the campaign

  - `displayId` (integer)
    Display Id in case of sub campaign

  - `parentCampaignId` (string)
    Parent campaign Id in case of subcampaign

  - `description` (string)
    Description of the campaign

  - `createdTime` (integer)
    Campaign created time in sprinklr

  - `modifiedTime` (integer)
    Last modified time of the campaign in sprinklr

  - `startDate` (integer)
    StartDate of the campaign

  - `endDate` (integer)
    EndDate of the campaign

  - `tags` (array)
    Tags on the campaign

  - `owner` (integer)
    Owner of the campaign

  - `partnerCustomProperties` (object)
    Partner level customproperties on the campaign

  - `clientCustomProperties` (object)
    Client level customproperties on the campaign

  - `status` (string, required)
    Status of the campaign. e.g. Draft, Approved

  - `visibility` (object)
    Visibility of the campaign

  - `visibility.globallyVisible` (boolean)
    True if Asset is globally visible

  - `visibility.visibilityConfig` (array)
    Config to share the asset

  - `visibility.visibilityConfig.type` (string, required)
    Type e.g. USER, GLOBAL, CLIENT

  - `visibility.visibilityConfig.ids` (array)
    IDs based on type.

  - `archived` (boolean)
    True if campaign is archived

  - `externalSource` (string)
    External system name

  - `externalSourceId` (string)
    External system Id

  - `externalCampaignDetails` (array)
    External connectors for a campaign

  - `externalCampaignDetails.connector` (string)

  - `externalCampaignDetails.externalIds` (array)

  - `deleted` (boolean)
    Is deleted

## Response 400:

  - `400` (unknown)
    Bad request

## Response 400 fields (application/json):

  - `data` (object)

  - `errors` (array)

  - `errors.id` (string, required)
    24-character hex ObjectId

  - `errors.code` (integer, required)

  - `errors.message` (string, required)
    Dotted error key (e.g. account.not.found)

  - `metadata` (object)

## Response 401:

  - `401` (unknown)
    Missing or invalid authentication

## Response 401 fields (application/json):

  - `data` (object)

  - `errors` (array)

  - `errors.id` (string, required)
    24-character hex ObjectId

  - `errors.code` (integer, required)

  - `errors.message` (string, required)
    Dotted error key (e.g. account.not.found)

  - `metadata` (object)

## Response 403:

  - `403` (unknown)
    Insufficient permissions

## Response 403 fields (application/json):

  - `data` (object)

  - `errors` (array)

  - `errors.id` (string, required)
    24-character hex ObjectId

  - `errors.code` (integer, required)

  - `errors.message` (string, required)
    Dotted error key (e.g. account.not.found)

  - `metadata` (object)

## Response 404:

  - `404` (unknown)
    Resource not found

## Response 404 fields (application/json):

  - `data` (object)

  - `errors` (array)

  - `errors.id` (string, required)
    24-character hex ObjectId

  - `errors.code` (integer, required)

  - `errors.message` (string, required)
    Dotted error key (e.g. account.not.found)

  - `metadata` (object)

