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

# Pause or resume in-app message

> Pause or resume delivery of an in-app message without changing its content. A paused in-app message is not shown to anyone.

## Overview

Pause or resume delivery of an [in-app message](https://documentation.onesignal.com/docs/en/in-app-messages-setup.md) without making any other changes to it. A paused in-app message is not shown to anyone. Its content, schedule, and stats are kept.

Use this endpoint to turn an in-app message on or off. To change its content, schedule, audience, or triggers, use [Update in-app message](https://documentation.onesignal.com/reference/update-in-app-message.md).

***

## How to use this API

Authenticate with your [App API Key](https://documentation.onesignal.com/docs/en/keys-and-ids.md). Send `enabled` as a JSON boolean: `false` pauses the in-app message and `true` resumes it.

```http theme={null}
PUT /apps/{app_id}/in_app_messages/{id}/set_enabled
```

```json theme={null}
{
  "enabled": false
}
```

> [!WARNING]
>
> `enabled` must be a JSON boolean. A missing key, `null`, or a string such as `"true"` is rejected with a `400` and the in-app message does not change.

Resuming an in-app message that targets a paused [Segment](https://documentation.onesignal.com/docs/en/segmentation.md) is rejected. Unpause the Segment or edit the in-app message's audience first.

### Permissions

An API key can pause and resume every in-app message in its app. A request made with an OAuth access token, such as through the [OneSignal MCP server](https://documentation.onesignal.com/docs/en/model-context-protocol.md), acts with the [role](https://documentation.onesignal.com/docs/en/manage-team-members.md) of the signed-in user. A role that cannot activate in-app messages, such as Composer, receives a `403` for both pausing and resuming.

## Response

A successful request returns `200 OK` with the in-app message's new status:

```json theme={null}
{
  "success": true,
  "payload": { "status": "disabled" }
}
```

`status` is `disabled` after pausing. After resuming it is `active`, `scheduled`, or `complete`, depending on the in-app message's schedule.


## OpenAPI

````yaml PUT /apps/{app_id}/in_app_messages/{id}/set_enabled
openapi: 3.1.0
info:
  title: api.onesignal.com
  version: '11.6'
servers:
  - url: https://api.onesignal.com
security:
  - {}
paths:
  /apps/{app_id}/in_app_messages/{id}/set_enabled:
    put:
      summary: Pause or resume in-app message
      description: >-
        Pause or resume delivery of an in-app message without changing its
        content. A paused in-app message is not shown to anyone.
      operationId: pause-or-resume-in-app-message
      parameters:
        - name: app_id
          in: path
          description: >-
            Your OneSignal App ID in UUID v4 format. See [Keys &
            IDs](/docs/en/keys-and-ids).
          schema:
            type: string
            default: YOUR_APP_ID
          required: true
        - name: id
          in: path
          description: UUID of the in-app message to pause or resume.
          required: true
          schema:
            type: string
            default: YOUR_IN_APP_MESSAGE_ID
        - name: Authorization
          in: header
          description: >-
            Your App API key with prefix `Key `. See [Keys &
            IDs](/docs/en/keys-and-ids).
          required: true
          schema:
            type: string
            default: Key YOUR_APP_API_KEY
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
            default: application/json; charset=utf-8
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
                  description: >-
                    `true` resumes delivery. `false` pauses it. Must be a JSON
                    boolean: a missing key, `null`, or a string such as `"true"`
                    is rejected.
            examples:
              Request:
                value:
                  enabled: false
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: '`true` when the request succeeded.'
                  payload:
                    type: object
                    properties:
                      status:
                        type: string
                        enum:
                          - scheduled
                          - active
                          - complete
                          - disabled
                        description: >-
                          The in-app message's new status: `disabled` after
                          pausing. `active`, `scheduled`, or `complete` after
                          resuming, depending on its schedule.
              example:
                success: true
                payload:
                  status: disabled
        '400':
          description: The request is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InAppMessageErrorResponse'
              example:
                success: false
                errors:
                  - enabled is required and must be true or false.
        '401':
          description: >-
            The API key is missing or invalid, or belongs to another app or
            organization. This body has no `success` key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
              example:
                errors:
                  - >-
                    Access denied.  Please include an 'Authorization: ...'
                    header with a valid API key
                    (https://documentation.onesignal.com/docs/en/keys-and-ids#api-keys).
        '403':
          description: >-
            The role behind the request cannot activate in-app messages. This
            body has no `success` key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BasicErrorResponse'
              example:
                errors:
                  - Current user permissions do not allow this action.
        '404':
          description: No in-app message with that `id` exists for this app.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InAppMessageErrorResponse'
              example:
                success: false
                errors:
                  - In-App Message not found
        '429':
          description: >-
            Rate limit exceeded. Requests to this path are blocked for 60
            seconds. This body has no `success` key.
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: string
                  limit:
                    type: string
                    description: Name of the rate limit that was exceeded.
              example:
                errors:
                  - API rate limit exceeded
                limit: API Per App
components:
  schemas:
    InAppMessageErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Always `false`.
        errors:
          type: array
          items:
            type: string
          description: >-
            Every problem found with the request. Field-level errors start with
            the quoted field name, for example `'name' Message name required`.
    BasicErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
          description: One or more human-readable error messages.
        success:
          type: boolean
          description: >-
            Present (and `false`) on some endpoints (notifications, templates,
            segments). Not emitted by every endpoint.
        reference:
          type: array
          items:
            type: string
          description: >-
            Documentation URL fragments related to the error. Only emitted by
            the API-key auth error helpers.

````

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