# Make a marketing plan

`POST /crm/marketing/plans` · Rivier · contacts

Make a marketing plan: the outcome wanted, the measure, the window, the channels, the words to avoid, the hypothesis and the rule for deciding. Nothing is sent or spent.

- Scope: contacts:write
- Graphql: Mutation.contactsMarketingPlanCreate
- Sdk: contacts.marketing.planCreate
- Cli: contacts marketing plan create

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 160
    },
    "goal": {
      "type": "object",
      "properties": {
        "outcome": {
          "type": "string",
          "minLength": 5,
          "maxLength": 300
        },
        "metric": {
          "type": "string",
          "enum": [
            "signups",
            "clicks",
            "orders",
            "bookings",
            "revenue",
            "replies"
          ]
        },
        "target": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "from": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "to": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        }
      },
      "required": [
        "outcome",
        "metric",
        "from",
        "to"
      ],
      "additionalProperties": false
    },
    "constraints": {
      "type": "object",
      "properties": {
        "channels": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "email",
              "sms",
              "social",
              "page",
              "gbp",
              "ads"
            ]
          },
          "minItems": 1,
          "maxItems": 6
        },
        "monthlyBudgetMinor": {
          "type": "integer",
          "minimum": 0,
          "default": 0
        },
        "segmentId": {
          "type": "string",
          "format": "uuid"
        },
        "doNotSay": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "maxItems": 30,
          "default": []
        },
        "capacityNote": {
          "type": "string",
          "maxLength": 300
        }
      },
      "required": [
        "channels"
      ],
      "additionalProperties": false
    },
    "hypothesis": {
      "type": "string",
      "minLength": 5,
      "maxLength": 400
    },
    "decisionRule": {
      "type": "string",
      "minLength": 5,
      "maxLength": 400
    }
  },
  "required": [
    "name",
    "goal",
    "constraints",
    "hypothesis",
    "decisionRule"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/crm/marketing/plans' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "goal": {
    "outcome": "string",
    "metric": "signups",
    "from": "string",
    "to": "string"
  },
  "constraints": {
    "channels": [
      "email"
    ]
  },
  "hypothesis": "string",
  "decisionRule": "string"
}'
```
