---
title: "Create Macro"
method: POST
path: "/api/v2/macros"
tags: ["Macros"]
---

# Create Macro

`POST /api/v2/macros`

#### Allowed For
* Agents

## Request body

- object
  - `macro` MacroInput
    - `actions` ActionObject[], required — Each action describes what the macro will do
      - `field` string — The name of a ticket field to modify
      - `value` string — The new value of the field
    - `active` boolean — Useful for determining if the macro should be displayed
    - `description` string, nullable — The description of the macro
    - `restriction` object — Who may access this macro. Will be null when everyone in the account can access it
      - `id` integer — The numeric ID of the group or user
      - `ids` integer[] — The numeric IDs of the groups
      - `type` string — Allowed values are Group or User
    - `title` string, required — The title of the macro

## Response `200`

OK

- object
  - `macro` MacroObject
    - `actions` ActionObject[], required — Each action describes what the macro will do. See [Actions reference](/documentation/ticketing/reference-guides/actions-reference)
      - `field` string — The name of a ticket field to modify
      - `value` string — The new value of the field
    - `active` boolean — Useful for determining if the macro should be displayed
    - `created_at` string, date-time — The time the macro was created
    - `default` boolean — If true, the macro is a default macro
    - `description` string, nullable — The description of the macro
    - `id` integer — The id automatically assigned when a macro is created
    - `position` integer — The position of the macro
    - `restriction` object, nullable — Access to this macro. A null value allows unrestricted access for all users in the account
    - `title` string, required — The title of the macro
    - `updated_at` string, date-time — The time of the last update of the macro
    - `url` string — A URL to access the macro's details
    - `app_installation` string, nullable — The app installation that requires each macro, if present
    - `categories` string, nullable — The macro categories
    - `permissions` string, nullable — Permissions for each macro
    - `usage_1h` integer — The number of times each macro has been used in the past hour
    - `usage_7d` integer — The number of times each macro has been used in the past week
    - `usage_24h` integer — The number of times each macro has been used in the past day
    - `usage_30d` integer — The number of times each macro has been used in the past thirty days

---

[API](https://skmtc.dev/botbrains-io/apis/support-api.md) · [All operations](https://skmtc.dev/botbrains-io/apis/support-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/botbrains-io/support-api/revisions/d53eac07ba68/schema)
