# Create a DM automation (/en/reference/automations/create-automation)

OpenAPI operation (components in https://api.tebar.app/v1/openapi.json):

```json
[
  {
    "operationId": "createAutomation",
    "tags": [
      "Automations"
    ],
    "summary": "Create a DM automation",
    "description": "Instagram accounts; comment_reply also on Threads. trigger depends on kind:\n- comment_to_dm, comment_reply: { scope: post | any | next | post_target, platform_post_ids?, keywords, match: any | contains | exact, include_replies? }\n- dm_keyword: { keywords, match: contains | exact }\n- story_reply: { keywords, match }\n- default_reply: { cooldown_hours? (1-168, default 24) }\n- story_mention: {}\n- ice_breaker: { questions: [{ question, payload }] } (1-4)\nactions.message is the DM (text, up to 3 buttons); comment_reply only takes public_replies (3-5). With post_target_id, one automation per post target: asking again gives back the same one.\n\nRequires the write scope.",
    "parameters": [
      {
        "$ref": "#/components/parameters/TebarProfile"
      }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreateAutomationRequest"
          }
        }
      }
    },
    "responses": {
      "201": {
        "description": "The automation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/DmAutomation"
            }
          }
        }
      },
      "400": {
        "$ref": "#/components/responses/BadRequest"
      },
      "401": {
        "$ref": "#/components/responses/Unauthorized"
      },
      "403": {
        "$ref": "#/components/responses/Forbidden"
      },
      "429": {
        "$ref": "#/components/responses/RateLimited"
      }
    }
  }
]
```