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

# Create Announcement

> Creates and sends an announcement to workers via email, text message, or both. Target all workers, a specific skillset, or a list of individual workers.

## Targeting workers

You can target announcement recipients in three ways:

* **All workers** — set `all` to `1`. The `selected_workers` and `skillsets` fields are ignored.
* **By skillset** — set `all` to `0` and provide a `skillsets` ID. Only workers with that skillset receive the announcement.
* **Specific workers** — set `all` to `0` and provide an array of worker IDs in `selected_workers`.

## Delivery channels

The `output` field controls how the announcement is delivered:

| Value | Channel                     |
| ----- | --------------------------- |
| `1`   | Email only                  |
| `2`   | Text message only           |
| `3`   | Both email and text message |

<Note>
  The `message` field supports HTML formatting. Keep the content under 1,000 characters.
</Note>


## OpenAPI

````yaml api-reference/v01.12.00/openapi-v01.12.00.json POST /announcements
openapi: 3.0.0
info:
  title: Roosted
  version: 0.1.12
  contact:
    name: Support
    url: https://support.roostedhr.com/support/home
    email: support@roostedhr.com
  description: |-
    Enterprise API

    Sandbox keys and Production keys are requested from support
servers:
  - url: https://api.roostedhr.com/api/1_12
  - url: https://sandbox.roostedhr.com/api/1_12
security:
  - X-API-KEY: []
tags:
  - name: Announcements
  - name: Areas
  - name: Clients
  - name: Company
  - name: Configuration
  - name: Events
  - name: Locations
  - name: Payroll Groups
  - name: Rate Cards
  - name: Shifts
  - name: Skillsets
  - name: Time Tracking
  - name: Wage Rules
  - name: Workers
paths:
  /announcements:
    post:
      tags:
        - Announcements
      summary: Create Announcement
      description: >-
        Creates and sends an announcement to workers via email, text message, or
        both. Target all workers, a specific skillset, or a list of individual
        workers.
      operationId: post-announcements
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              required:
                - subject
                - message
                - output
                - all
                - replies
              properties:
                subject:
                  type: string
                  description: Subject line of the announcement.
                  example: Schedule update for next week
                message:
                  type: string
                  description: Body content of the announcement. Supports HTML formatting.
                  minLength: 1
                  maxLength: 1000
                  example: <p>Please review your updated shifts for next week.</p>
                output:
                  type: integer
                  description: >-
                    Delivery channel for the announcement. `1` — email only. `2`
                    — text message only. `3` — both email and text message.
                  enum:
                    - 1
                    - 2
                    - 3
                  example: 3
                all:
                  type: integer
                  description: >-
                    Whether to send the announcement to all workers. `1` — send
                    to all workers. `0` — send to specific workers (use
                    `selected_workers` or `skillsets` to specify recipients).
                  enum:
                    - 0
                    - 1
                  example: 1
                skillsets:
                  type: string
                  description: >-
                    Skillset ID to filter recipients. When provided, only
                    workers with this skillset receive the announcement. Ignored
                    when `all` is `1`.
                replies:
                  type: array
                  description: >-
                    Admin IDs designated to receive worker replies to this
                    announcement.
                  uniqueItems: true
                  items:
                    type: integer
                  example:
                    - 3158
                selected_workers:
                  type: array
                  description: >-
                    Specific worker IDs to send the announcement to. Ignored
                    when `all` is `1`.
                  uniqueItems: true
                  items:
                    type: integer
                  example:
                    - 4521
                    - 4587
            examples:
              Send to all workers via email:
                value:
                  subject: Company-wide policy update
                  message: >-
                    <p>Please review the updated attendance policy effective
                    next Monday.</p>
                  output: 1
                  all: 1
                  replies:
                    - 3158
              Send to specific workers via text and email:
                value:
                  subject: Shift reminder
                  message: '<p>Reminder: your shift starts at 8 AM tomorrow.</p>'
                  output: 3
                  all: 0
                  replies:
                    - 3158
                  selected_workers:
                    - 4521
                    - 4587
      responses:
        '201':
          description: Created
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid data:
                  value:
                    code: ANN-300
                    error: Invalid data
                Message is too long:
                  value:
                    code: ANN-400
                    error: Message is too long
                Invalid replies group:
                  value:
                    code: ANN-600
                    error: Invalid replies group
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Invalid API key:
                  value:
                    code: ATH-100
                    error: Invalid or missing API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Insufficient permissions:
                  value:
                    code: ANN-700
                    error: Insufficient permissions to create announcements
                Not a premium account:
                  value:
                    code: ANN-700
                    error: Not a premium account
                Invalid skillset:
                  value:
                    code: ANN-600
                    error: Invalid skillset
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Announcement not found:
                  value:
                    code: ANN-800
                    error: Announcement not found
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Machine-readable error code.
                  error:
                    type: string
                    description: Human-readable error message.
              examples:
                Internal server error:
                  value:
                    code: ANN-1000
                    error: An unexpected error occurred
components:
  securitySchemes:
    X-API-KEY:
      name: X-API-KEY
      type: apiKey
      in: header

````