> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sendo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Create campaign

> This endpoint creates a campaign.

This endpoint lets customers create campaigns programatically. New campaigns will be reviewed by the Sendo team and the cell carriers for compliance. This process takes an average of 2-5 business days. It is important that your submission is [fully compliant](/knowledge-base/campaigns) in order to avoid rejections, which can delay the launch of your campaign.

When creating a campaign programatically, we will deduct the \$20 [creation fee](/knowledge-base/pricing) from your account balance. If you do not have enough funds in your account, the request will fail. The \$10 monthly renewal fee will not be charged until the campaign is approved by the Sendo team.

**NOTE:** Newly created campaigns will start with no phone numbers. You can add phone numbers to the campaign using the API endpoint to [buy a number](/api-reference/number/buy), or you can add them manually on the Sendo dashboard.

<Tip>API support for creating webhooks is coming soon! 🚀</Tip>

### Body

<ParamField body="displayName" type="string">
  The display name for the campaign.
</ParamField>

<ParamField body="usecase" type="enum">
  The usecase for the campaign, i.e. `MARKETING`.

  <Expandable title="usecases options">
    <ParamField body="2FA" type="string">
      Two-factor authentication codes.
    </ParamField>

    <ParamField body="ACCOUNT_NOTIFICATION" type="string">
      Reminders, alerts and notifications to users.
    </ParamField>

    <ParamField body="CUSTOMER_CARE" type="string">
      Conversational messages for user support.
    </ParamField>

    <ParamField body="DELIVERY_NOTIFICATION" type="string">
      Updates about the status of a delivery.
    </ParamField>

    <ParamField body="FRAUD_ALERT" type="string">
      Notifications alerting users to potential fraud.
    </ParamField>

    <ParamField body="MARKETING" type="string">
      Marketing or promotional messages.
    </ParamField>

    <ParamField body="POLLING_VOTING" type="string">
      Messages for polling or voting.
    </ParamField>

    <ParamField body="SECURITY_ALERT" type="string">
      Notifications about the security of a system.
    </ParamField>

    <ParamField body="HIGHER_EDUCATION" type="string">
      Messages sent on behalf of colleges or universities.
    </ParamField>

    <ParamField body="K12_EDUCATION" type="string">
      Messages sent on behalf of K-12 schools.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="brandId" type="string">
  The ID of the associated [brand](/knowledge-base/brands) (for resellers)
</ParamField>

<ParamField body="description" type="string">
  A <Tooltip tip="Must clearly describe the company, the product, and the situations in which text messages will be sent.">description</Tooltip> of the messaging campaign.
</ParamField>

<ParamField body="consentFlow" type="string">
  An explanation of how [consent](/knowledge-base/consent) is obtained.
</ParamField>

<ParamField body="screenshotUrl" type="string">
  A screenshot of the consent flow (optional).
</ParamField>

<ParamField body="sample1" type="string">
  A sample message for the campaign.
</ParamField>

<ParamField body="sample2" type="string">
  A sample message for the campaign.
</ParamField>

<ParamField body="sample3" type="string">
  A sample message for the campaign (optional).
</ParamField>

<ParamField body="sample4" type="string">
  A sample message for the campaign (optional).
</ParamField>

<ParamField body="sample5" type="string">
  A sample message for the campaign (optional).
</ParamField>

<ParamField body="isLowVolume" type="boolean">
  Whether to register the campaign as <Tooltip tip="Low volume campaings have daily messaging limits and renew monthly for $1.50 instead of $10.">low volume</Tooltip>.
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Whether the campaign was created successfully.
</ResponseField>

<ResponseField name="campaign" type="object">
  The contents of the campaign.

  <Expandable title="campaign fields">
    <ResponseField name="id" type="string">
      The ID of the retrieved campaign.
    </ResponseField>

    <ResponseField name="brandId" type="string">
      The ID of the associated [brand](/knowledge-base/brands).
    </ResponseField>

    <ResponseField name="displayName" type="string">
      The display name of the campaign.
    </ResponseField>

    <ResponseField name="createdAt" type="timestamp">
      The time the campaign was created.
    </ResponseField>

    <ResponseField name="updatedAt" type="timestamp">
      The time the campaign was last updated.
    </ResponseField>

    <ResponseField name="status" type="string">
      The status of the campaign.

      <Expandable title="campaign statuses">
        <ResponseField name="DRAFT" type="string">
          The campaign is saved as a draft.
        </ResponseField>

        <ResponseField name="PENDING" type="string">
          The campaign is pending approval.
        </ResponseField>

        <ResponseField name="ACTIVE" type="string">
          The campaign is approved and active.
        </ResponseField>

        <ResponseField name="EXPIRED" type="string">
          The campaign has been deactivated.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="monthlyFee" type="number">
      Monthly renewal fee for the campaign (cents).
    </ResponseField>

    <ResponseField name="usecase" type="string">
      The usecase for the campaign, i.e. `MARKETING`.
    </ResponseField>

    <ResponseField name="subUsecases" type="string[]">
      An array of sub-usecases (optional).
    </ResponseField>

    <ResponseField name="details" type="object">
      Object of submission details for the campaign.

      <Expandable title="details fields">
        <ResponseField name="description" type="string">
          A description of the messaging campaign.
        </ResponseField>

        <ResponseField name="consentFlow" type="string">
          An explanation of how [consent](/knowledge-base/consent) is obtained.
        </ResponseField>

        <ResponseField name="screenshotUrl" type="string">
          A screenshot of the consent flow (optional).
        </ResponseField>

        <ResponseField name="sample1" type="string">
          A sample message for the campaign.
        </ResponseField>

        <ResponseField name="sample2" type="string">
          A sample message for the campaign.
        </ResponseField>

        <ResponseField name="sample3" type="string">
          A sample message for the campaign (optional).
        </ResponseField>

        <ResponseField name="sample4" type="string">
          A sample message for the campaign (optional).
        </ResponseField>

        <ResponseField name="sample5" type="string">
          A sample message for the campaign (optional).
        </ResponseField>

        <ResponseField name="optinKeywords" type="string[]">
          Array of keywords that trigger opt-in.
        </ResponseField>

        <ResponseField name="optoutKeywords" type="string[]">
          Array of keywords that trigger opt-out.
        </ResponseField>

        <ResponseField name="helpKeywords" type="string[]">
          Array of keywords that trigger HELP message.
        </ResponseField>

        <ResponseField name="optinMessage" type="string">
          Message sent in response to opt-in keyword.
        </ResponseField>

        <ResponseField name="optoutMessage" type="string">
          Message sent in response to opt-out keyword.
        </ResponseField>

        <ResponseField name="helpMessage" type="string">
          Message sent in response to HELP keyword.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="limits" type="object">
      Object of carrier limits for the campaign.

      <Expandable title="limits fields">
        <ResponseField name="smsTpmAtt" type="number">
          SMS messages per minute limit to AT\&T.
        </ResponseField>

        <ResponseField name="mmsTpmAtt" type="number">
          MMS messages per minute limit to AT\&T.
        </ResponseField>

        <ResponseField name="dailyTmoCap" type="number">
          Daily SMS/MMS limit to T-Mobile.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>

  <Note>The `monthlyFee` and carrier limits will be `null` until the campaign is approved by Sendo and submitted to the cell carriers for review.</Note>
</ResponseField>

<ResponseField name="error" type="string">
  Error message if the request fails.
</ResponseField>

#### Errors

If the request fails, it will return an HTTP error status code and an `error` field in the body with details. Full list of status codes [here](/api-reference/introduction).

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "campaign": {
      "id": "U7fQ39nX",
      "brandId": "A8wm4k2s",
      "displayName": "Internal Testing",
      "createdAt": "2023-09-21T00:42:01.007Z",
      "updatedAt": "2023-09-21T00:42:01.007Z",
      "status": "ACTIVE",
      "monthlyFee": null,
      "usecase": "MIXED",
      "subUsecases": [
        "CUSTOMER_CARE",
        "ACCOUNT_NOTIFICATION"
      ],
      "details": {
        "description": "This campaign will be used for 2FA login codes.",
        "consentFlow": "Users consent to receive SMS when making an account.",
        "screenshotUrl": "https://sendo-images.s3.amazonaws.com/OTPVerification-7bf5878dc5.png",
        "sample1": "Your Sendo login code is 123456.",
        "sample2": "Your Sendo login code is 987654.",
        "sample3": null,
        "sample4": null,
        "sample5": null,
        "optinKeywords": [
          "START",
          "SUBSCRIBE"
        ],
        "optoutKeywords": [
          "STOP"
        ],
        "helpKeywords": [
          "HELP"
        ],
        "optinMessage": "You've subscribed to receive messages from this number. Reply STOP to unsubscribe.",
        "optoutMessage": "You will no longer receive messages from this number. Reply START to subscribe again.",
        "helpMessage": "Text STOP to unsubscribe. Email support@sendo.dev with any questions."
      },
      "limits": {
        "smsTpmAtt": null,
        "mmsTpmAtt": null,
        "dailyTmoCap": null
      }
    }
  }
  ```

  ```json Error theme={null}
  {
    "success": false,
    "error": "Insufficient account balance"
  }
  ```
</ResponseExample>
