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

# Create macro

> Create a shared saved reply without sending a message.

Create a shared saved reply without sending a message. See the [Macros overview](/en/api-reference/macros) for the shared object and scope model.

## Headers

<ParamField header="Authorization" type="string" required>
  Bearer token containing your workspace API key. The key needs `write` scope.
</ParamField>

## Body

<ParamField body="title" type="string" required>Non-empty title, up to 150 characters after trimming. Titles must be unique within the workspace, ignoring case and surrounding spaces.</ParamField>

<ParamField body="body" type="string" required>Non-empty Markdown message, up to 10,000 characters after trimming. Variables are stored as template text, not resolved by this endpoint.</ParamField>

## Response

Returns the [macro object](/en/api-reference/macros#macro-object). Examples use synthetic IDs and timestamps.

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url 'https://api-prod.usefini.com/v2/macros/public' \
    --header 'Authorization: Bearer fini_your_api_key' \
    --header 'Content-Type: application/json' \
    --data '{"title": "Documents sent", "body": "Hi {{attributes.firstName}}, your requested documents are ready."}'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api-prod.usefini.com/v2/macros/public', {
    method: 'POST',
    headers: {"Authorization": "Bearer fini_your_api_key", "Content-Type": "application/json"},
    body: JSON.stringify({"title": "Documents sent", "body": "Hi {{attributes.firstName}}, your requested documents are ready."})
  });
  if (!response.ok) throw new Error(`Request failed: ${response.status}`);
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api-prod.usefini.com/v2/macros/public",
      headers={"Authorization": "Bearer fini_your_api_key"},
      json={"title": "Documents sent", "body": "Hi {{attributes.firstName}}, your requested documents are ready."},
  )
  response.raise_for_status()
  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": "e73b7a87-6eaf-4e77-8d04-5a3f29a52f60",
    "companyId": "97c8757b-83be-45aa-9f29-749d03f873fb",
    "title": "Documents sent",
    "body": "Hi {{attributes.firstName}}, your requested documents are ready.",
    "createdBy": "a5dc0132-4998-4be2-a821-910881658bcb",
    "updatedBy": "a5dc0132-4998-4be2-a821-910881658bcb",
    "createdAt": "2026-10-08T08:00:00.000Z",
    "updatedAt": "2026-10-08T08:00:00.000Z"
  }
  ```
</ResponseExample>

## Errors

* `400`: Invalid parameters or failed field validation.
* `401`: Missing or invalid credential.
* `403`: Credential lacks the required scope.
* `406`: No workspace is associated with the authenticated user.
* `409`: Another macro already uses that title in this workspace.


## Related topics

- [Inbox](/en/testing/inbox.md)
- [Delete macro](/en/api-reference/delete-macro.md)
- [Update macro](/en/api-reference/update-macro.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.