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

# Create Announcement

> Send an announcement now, schedule it, or save it as a draft.

Creates an announcement. With `publish`:

* **`now`:** sends it straight away. Recipients get a push notification and an email, as when it's sent from the app.
* **`scheduled`:** sends it at `sendAt`.
* **`draft`:** saves it without sending. Send it later with [Update Announcement](https://docs.xenia.team/api-reference/endpoints/announcements/update-announcement.md).

> [!NOTE]
>
> Announcements must be on your workspace's plan. Otherwise every Announcements endpoint returns `403` with "Workspace doesn't have "Announcements" feature activated."

## Permissions

The key acts as its default user, or the user in the `x-client-user` header (who must be in the workspace). That user's role permissions apply, and the user is the announcement's creator.

Creating announcements requires **Create & Manage Own Announcements** or **Manage All Announcements**.

Without **Create Announcements for Any User or Location** or **Manage All Announcements**, the audience is narrowed to the people the user can send to in the app: people at the user's locations, plus the workspace's admins, owners, and anyone with access to all locations.

## Path parameters

**workspaceId** `string\<uuid\>` *required*

UUID of the workspace. Must be the workspace your API key is bound to.

## Body

**title** `string` *required*

The announcement's title.

**publish** `string` *required*

`now`, `scheduled`, or `draft`.

**sendAt** `string\<date-time\>`

Required with `scheduled`, and refused otherwise. Must be in the future. The announcement goes out at this clock time in the user's timezone, in each recipient's own timezone. Write it in the user's timezone: for example, `2026-12-24T09:00:00-05:00` from a user in New York reaches everyone at 9:00 AM their local time. If the user has no timezone, the workspace's is used, then UTC.

**audience** `object`

Who receives it. Required with `now` and `scheduled`. See [Audience](#audience).

**description** `string`

The body, as HTML, such as `<p>All stores close at 6 PM.</p>`. Unsafe HTML is removed, as in the app.

**expiresAt** `string\<date-time\>`

When it leaves the feed. `null` or left out means it never expires. For a scheduled announcement, this is also a clock time in each recipient's timezone.

**pinned** `boolean` (default: false)

Keep it at the top of the feed.

**requireAcknowledgement** `boolean` (default: false)

Ask recipients to acknowledge it.

**requireSignature** `boolean` (default: false)

Ask for a signature with the acknowledgement.

**requirePhoto** `boolean` (default: false)

Ask for a photo with the acknowledgement.

**allowMultiplePhotos** `boolean` (default: false)

Allow more than one photo.

**photoLimit** `integer` (default: 1)

The most photos a recipient can add.

**requireVideo** `boolean` (default: false)

Ask for a video with the acknowledgement.

**attachments** `object[]`

Files to attach. Each is `{ "key", "name", "size", "type" }`: the file `key` from [Upload an Announcement File](https://docs.xenia.team/api-reference/endpoints/announcements/upload-announcement-file.md), the file's name, its size in bytes, and its content type, such as `application/pdf`.

**coverImage** `string`

A file `key` from [Upload an Announcement File](https://docs.xenia.team/api-reference/endpoints/announcements/upload-announcement-file.md), shown at the top of the announcement.

**color** `object` (default: \{ "bgColor": "#FFFFFF", "color": "#011B31" })

The card's background and text colours, as `{ "bgColor", "color" }`.

**id** `string\<uuid\>`

An id you choose, so a retry can't create a second announcement. If an announcement with this id already exists in the workspace, it's returned as it is: nothing is changed or sent again.

Unknown fields are refused.

## Audience

An object with one or both of these. Recipients are everyone either part reaches, once each.

**audience.usersAndTeams** `object`

Everyone listed. All fields optional:

* `users`: user ids
* `teams`: everyone on these teams
* `locations`: everyone at these locations or below them, plus the workspace's admins and owners
* `locationGroups`: everyone at the locations in these groups or below them, plus the workspace's admins and owners

**audience.roles** `object`

Everyone with these roles. Fields:

* `roles` (required): role ids
* `locations`: only role holders at these locations or below them
* `locationGroups`: only role holders at the locations in these groups or below them

Every id must exist in the workspace and be the kind its field says. Only active members of the workspace receive the announcement.

The people it reaches are fixed when it's created. Someone who joins a team, role, or location later doesn't get it.

## Response

Returns `200` with `{ "data": { "announcement": <announcement> } }`, the same as [Get Announcement](https://docs.xenia.team/api-reference/endpoints/announcements/get-announcement.md).

## Errors

Errors return the message at `error.message`.

| Status | When |
| - | - |
| `401` | Invalid client credentials |
| `403` | Announcements isn't on the workspace's plan |
| `403` | The user doesn't have Create & Manage Own Announcements or Manage All Announcements |
| `409` | "id is already in use." The `id` belongs to another workspace, or to a deleted announcement |
| `422` | Invalid input. The message names the problem, such as ""title" is required", ""sendAt" is required", ""recipients" is not allowed", or "sendAt must be in the future." |
| `422` | "These audience ids are not in this workspace or not of the listed kind: 2b7e…" |
| `422` | "At least one recipient is required to publish." The audience reaches no one |
| `422` | "attachments and coverImage must be file keys returned by this workspace's announcement upload-url". An attachment or cover image isn't a file key from [Upload an Announcement File](https://docs.xenia.team/api-reference/endpoints/announcements/upload-announcement-file.md), such as an `https://` URL |

```bash cURL theme={null}
curl -X POST "https://api.xenia.team/api/v1/ops/workspaces/{workspaceId}/announcements" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "6a1f…",
    "title": "Holiday hours",
    "description": "<p>All stores close at 6 PM on Dec 24.</p>",
    "publish": "now",
    "expiresAt": "2026-12-26T00:00:00Z",
    "pinned": true,
    "requireAcknowledgement": true,
    "audience": {
      "roles": { "roles": ["5c90…"], "locations": ["8f1c…"] }
    },
    "attachments": [
      {
        "key": "4a2e…/9d03…/1795200000000/hours.pdf",
        "name": "hours.pdf",
        "size": 48213,
        "type": "application/pdf"
      }
    ]
  }'
```

```json 200 theme={null}
{
  "data": {
    "announcement": {
      "id": "6a1f…",
      "title": "Holiday hours",
      "status": "active",
      "pinned": true,
      "sendAt": "2026-12-01T15:00:00.000Z",
      "publishedNow": true,
      "expiresAt": "2026-12-26T00:00:00.000Z",
      "createdAt": "2026-12-01T15:00:00.112Z",
      "createdBy": { "id": "9d03…", "firstName": "Alex", "lastName": "Kim" },
      "requireAcknowledgement": true,
      "recipientCount": 12,
      "openedCount": 0,
      "acknowledgedCount": 0,
      "description": "<p>All stores close at 6 PM on Dec 24.</p>",
      "coverImage": null,
      "color": { "bgColor": "#FFFFFF", "color": "#011B31" },
      "attachments": [
        {
          "url": "https://cdn.xenia.team/4a2e…/9d03…/1795200000000/hours.pdf",
          "name": "hours.pdf",
          "size": 48213,
          "type": "application/pdf"
        }
      ],
      "requireSignature": false,
      "requirePhoto": false,
      "allowMultiplePhotos": false,
      "photoLimit": 1,
      "requireVideo": false,
      "audience": {
        "roles": { "roles": ["5c90…"], "locations": ["8f1c…"], "locationGroups": [] }
      }
    }
  }
}
```


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