---
title: "Create a new macro"
method: POST
path: "/macros"
tags: ["macros"]
---

# Create a new macro

`POST /macros`

Creates a new macro within the specified macro group.

**Rate limit:** 60 requests per minute

## Request body

- CreateMacroRequestBody
  - `conditions` Filter
    - `field` string, required — The field for this filter. For allowed fields, see the documentation for the specific endpoint you are using. For non-compound filters (any operators other than "and" or "or"), Field must be set, along with either Value or Values, depending on the operator.
    - `operator` 'equals' | 'not_equals' | 'contains' | 'does_not_contain' | 'in' | 'not_in' | 'and' | 'or' | 'time_is_after' | 'time_is_before' | 'time_range' | 'string_contains' | 'string_does_not_contain' | 'is_set' | 'is_unset' | 'greater_than' | 'less_than' | 'greater_than_or_equals' | 'less_than_or_equals', required — The operator for this filter.
    - `subfilters` Filter[] — Sub-filters for this filter. Valid only when operator is "and" or "or". The maximum allowed depth for a tree of filters is 3.
    - `value` string — The value for this filter. Only used for single-valued operators ("equals", "not_equals", "contains", "does_not_contain")
    - `values` string[] — The values for this filter. Only used for multi-valued operators ("in", "not_in").
  - `macro_group_id` string, required — The ID of the macro group this macro belongs to.
  - `name` string, required — The name of the macro.
  - `text_html` string, required — The HTML content of the macro.
  - `text_type` string — The type of text: "reply", "note", or "email". Defaults to "reply".
  - `visibility` VisibilityInput
    - `team_ids` string[] — Team IDs who can access the resource. Required when type is "team" or "users_and_teams".
    - `type` 'org' | 'user' | 'team' | 'users_and_teams', required — The visibility type: "org" (entire organization), "user" (specific users), "team" (specific teams), or "users_and_teams" (specific users and teams).
    - `user_ids` string[] — User IDs who can access the resource. Required when type is "user" or "users_and_teams".

## Response `200`

- CreateMacroResponseBody
  - `data` Macro
    - `actions` MacroAction[] — The actions that execute when this macro is applied.
      - `type` string — The action type identifier (e.g. "set_issue_state", "set_issue_tags").
    - `created_at` string — The time the macro was created.
    - `has_actions` boolean — Whether this macro has actions that execute when applied.
    - `id` string — The ID of the macro.
    - `macro_group_id` string — The ID of the macro group this macro belongs to.
    - `name` string — The name of the macro.
    - `text_html` string — The HTML content of the macro.
    - `text_type` string — The type of text: "reply", "note", or "email".
    - `updated_at` string — The time the macro was last updated.
    - `visibility` Visibility
      - `team_ids` string[] — Team IDs who can access the resource.
      - `type` string — The visibility type.
      - `user_ids` string[] — User IDs who can access the resource.
  - `request_id` string — The request ID for tracking.

## Other responses

- `400` — The request was invalid or could not be completed.
- `403` — The authenticated caller or organization is not allowed to access this endpoint or operation.
- `500` — An unexpected internal error occurred.

---

[API](https://skmtc.net/usepylon/apis/pylon-api.md) · [All operations](https://skmtc.net/usepylon/apis/pylon-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usepylon/pylon-api/revisions/ad855d921ee9/schema)
