---
openapi: 3.0.3
info:
  title: Braze REST API – List user's subscription group status
  description: |
    ## Prerequisites

    To use this endpoint, you'll need an [API key]({{site.baseurl}}/api/basics#rest-api-key-permissions) with the `subscription.status.get` permission.

    ## Rate limit

    We apply the default Braze rate limit of 250,000 requests per hour to this endpoint, as documented in [API rate limits]({{site.baseurl}}/api/api_limits/).
  version: 1.0.0
  contact:
    name: Braze Support
    url: https://www.braze.com/docs/braze_support/
  license:
    name: Braze Documentation
    url: https://www.braze.com/docs/api/home/
servers:
  - url: https://rest.iad-01.braze.com
    description: US-01
  - url: https://rest.iad-02.braze.com
    description: US-02
  - url: https://rest.iad-03.braze.com
    description: US-03
  - url: https://rest.iad-04.braze.com
    description: US-04
  - url: https://rest.iad-05.braze.com
    description: US-05
  - url: https://rest.iad-06.braze.com
    description: US-06
  - url: https://rest.iad-07.braze.com
    description: US-07
  - url: https://rest.iad-08.braze.com
    description: US-08
  - url: https://rest.us-10.braze.com
    description: US-10
  - url: https://rest.fra-01.braze.eu
    description: EU-01
  - url: https://rest.fra-02.braze.eu
    description: EU-02
  - url: https://rest.au-01.braze.com
    description: AU-01
  - url: https://rest.id-01.braze.com
    description: ID-01
  - url: https://rest.jp-01.braze.com
    description: JP-01
  - url: https://rest.kr-01.braze.com
    description: KR-01
security:
- BearerAuth: []
paths:
  "/subscription/status/get":
    get:
      summary: List user's subscription group status
      operationId: get_subscription_status_get_get_list_user_subscription_group_status
      description: |
        ## Required user identifiers

        One of `external_id` or `email` or `phone` is required for each user.

        - For SMS and WhatsApp subscription groups, either `external_id` or `phone` is required. When both are submitted, only the `external_id` is used for querying and the phone number is applied to that user.
        - For email subscription groups, either `external_id` or `email` is required. When both are submitted, only the `external_id` is used for the query and the email address is applied to that user.
      parameters:
        - name: subscription_group_id
          in: query
          required: true
          description: The `id` of your subscription group. See [`subscription_group_id`]({{site.baseurl}}/api/identifier_types/?tab=subscription%20group%20ids).
          schema:
            type: string
          example: subscription_group_identifier
        - name: external_id
          in: query
          required: false
          description: |
            The `external_id` of the user (must include at least one and at most 50 `external_ids`).

            When both an `external_id` and `email`/`phone` are submitted, only the `external_id`(s) provided will be applied to the result query.

            To query multiple users, repeat the parameter with brackets, as in this example request:

            ```
            https://rest.iad-03.braze.com/subscription/status/get?subscription_group_id={{subscription_group_id}}&external_id[]=1&external_id[]=2
            ```
          schema:
            type: string
          example: "1"
        - name: email
          in: query
          required: false
          description: |
            The email address of the user. It can be passed as an array of strings with a maximum of 50.

            Submitting both an email address and phone number will result in an error.
          schema:
            type: string
          examples:
            email:
              summary: Email
              x-disabled: true
              value: example@example.com
        - name: phone
          in: query
          required: false
          description: |
            The phone number of the user. If email is not included, you must include at least one phone number (with a maximum of 50). Use [E.164](https://en.wikipedia.org/wiki/E.164) format.

            Submitting both an email address and phone number will result in an error.
          schema:
            type: string
          examples:
            sms_and_whatsapp:
              summary: SMS and WhatsApp
              x-disabled: true
              value: "+15555550100"
      responses:
        "200":
          description: |
            The request succeeded and the response body includes the subscription group status. No action needed.

            All successful responses will return `Subscribed`, `Unsubscribed`, or `unknown` depending on status and user history with the subscription group.

            **Important:** This endpoint returns the subscription group status independently of the user's global subscription state. If a user is globally unsubscribed, the Braze dashboard shows them as unsubscribed from each subscription group. However, this endpoint still returns the last saved subscription group status (for example, `Subscribed`) because the global subscription state supersedes individual subscription groups without overwriting them.

            Braze preserves individual subscription group states so that if the user globally resubscribes, each subscription group reverts to its previously saved status. To determine a user's effective subscription state, check both their global subscription status and the subscription group status returned by this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListUserSubscriptionGroupStatusResponse'
              examples:
                multiple_users:
                  summary: Status for two users
                  value:
                    status:
                      "1": Unsubscribed
                      "2": Subscribed
                    message: success
        "400":
          description: |
            Bad request. To resolve it:

            - **The `subscription_group_id` isn't valid:** Pass a valid `subscription_group_id` from **Subscription Group** settings.
            - **No `email`, `phone`, or `external_id` was provided:** Include an `email`, `phone`, or `external_id`.
            - **Both an email address and a phone number were provided:** Include either an email address or a phone number, but not both.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_subscription_group_id:
                  summary: Invalid subscription group ID
                  value:
                    message: Invalid subscription group ID
                no_identifier:
                  summary: No email, phone, or external_id
                  value:
                    message: You must provide an email address, a phone number, or an external user id.
                email_and_phone:
                  summary: Both an email address and a phone number
                  value:
                    message: Either an email address or a phone number should be provided, but not both.
        "401":
          description: |
            Unauthorized. The REST API key is missing, malformed, or sent to the wrong REST endpoint. Send the key as `Authorization: Bearer YOUR_REST_API_KEY` to the correct [REST endpoint]({{site.baseurl}}/api/basics/#endpoints). For more causes, see [Errors and responses]({{site.baseurl}}/api/errors/#fatal-errors).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_api_key:
                  summary: Invalid API key
                  value:
                    message: 'Invalid API key: YOUR_REST_API_KEY'
        "403":
          description: Access denied. The REST API key doesn't have the required permission. Use a REST API key that has the `subscription.status.get` permission.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                access_denied:
                  summary: Missing permission
                  value:
                    message: Access Denied
        "429":
          description: |
            Rate limited. You exceeded the rate limit for this endpoint. Slow your request rate and retry with exponential backoff. See [API rate limits]({{site.baseurl}}/api/api_limits/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                over_rate_limit:
                  summary: Over rate limit
                  value:
                    message: You have exceeded your limit of 250000 requests per hour. Please contact your account executive to increase your limit. If you do not have their info, you may contact Braze directly at https://www.braze.com/contact/.
        5XX:
          description: |
            Internal server error. An unexpected error occurred on the Braze server. Retry with exponential backoff. If the error persists, contact [Support]({{site.baseurl}}/braze_support/).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: REST API key
      description: |
        REST API keys are created in the Braze dashboard at **Settings → APIs and
        Identifiers → API Keys**. The key must include the `subscription.status.get` permission.
        Pass the key as `Authorization: Bearer YOUR_REST_API_KEY`.
  schemas:
    ListUserSubscriptionGroupStatusResponse:
      title: List user's subscription group status response
      type: object
      properties:
        status:
          type: object
          description: Each user's status in the subscription group, keyed by the `external_id`, email address, or phone number used in the request.
          additionalProperties:
            type: string
          example:
            "1": Unsubscribed
            "2": Subscribed
        message:
          type: string
          example: success
    ErrorResponse:
      title: Error
      type: object
      properties:
        message:
          type: string
          description: The error message describing why the request failed.
        errors:
          type: array
          description: Non-fatal errors encountered while processing the request. Data unaffected by these errors is still processed.
          items:
            type: object
            properties:
              type:
                type: string
                description: The error type.
