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

# Send notifications

> Send notifications to interactors of a mini app. By default every broadcast is delivered synchronously and returns 200 with aggregate counts. When the `ASYNC_NOTIFICATIONS_ENABLED` server flag is on, broadcasts with more than 100 notification tokens are queued and return 202 with a campaign_id instead; poll the campaign stats endpoint for progress. Small broadcasts always stay synchronous.

<Info>
  ### See guide on setting this up easily [Send Notifications to Mini App Users](/docs/send-notifications-to-mini-app-users)
</Info>

## Node.js SDK

🔗 **SDK Method:** [publishFrameNotifications](/nodejs-sdk/frame-apis/publishFrameNotifications)

Use this API endpoint with the Neynar Node.js SDK for typed responses and better developer experience.


## OpenAPI

````yaml post /v2/farcaster/frame/notifications/
openapi: 3.0.4
info:
  contact:
    email: team@neynar.com
    name: Neynar
    url: https://neynar.com/
  description: >-
    The Neynar API allows you to interact with the Farcaster protocol among
    other things. See the [Neynar docs](https://docs.neynar.com/reference) for
    more details.
  title: Neynar API
  version: 3.173.0
servers:
  - url: https://api.neynar.com
security:
  - ApiKeyAuth: []
tags:
  - description: Operations related to user
    externalDocs:
      description: More info about user
      url: https://docs.neynar.com/reference/user-operations
    name: User
  - description: Operations related to signer
    externalDocs:
      description: More info about signer
      url: https://docs.neynar.com/reference/signer-operations
    name: Signer
  - description: Operations related to cast
    externalDocs:
      description: More info about cast
      url: https://docs.neynar.com/reference/cast-operations
    name: Cast
  - description: Operations related to feed
    externalDocs:
      description: More info about feed
      url: https://docs.neynar.com/reference/feed-operations
    name: Feed
  - description: Operations related to reaction
    externalDocs:
      description: More info about reaction
      url: https://docs.neynar.com/reference/reaction-operations
    name: Reaction
  - description: Operations related to notifications
    externalDocs:
      description: More info about notifications
      url: https://docs.neynar.com/reference/notifications-operations
    name: Notifications
  - description: Operations related to channels
    externalDocs:
      description: More info about channels
      url: https://docs.neynar.com/reference/channel-operations
    name: Channel
  - description: Operations related to follows
    externalDocs:
      description: More info about follows
      url: https://docs.neynar.com/reference/follows-operations
    name: Follows
  - description: Operations related to storage
    externalDocs:
      description: More info about storage
      url: https://docs.neynar.com/reference/storage-operations
    name: Storage
  - description: Operations related to mini apps
    name: Frame
  - description: Operations for building AI agents
    name: Agents
  - description: Operations related to fname
    name: fname
  - description: Operations related to a webhook
    name: Webhook
  - description: >-
      Securely communicate and perform actions on behalf of users across
      different apps
    externalDocs:
      description: More info about farcaster actions
      url: https://docs.neynar.com/docs/farcaster-actions-spec
    name: Action
  - description: Operations related to a subscriptions
    name: Subscribers
  - description: Operations related to a mute
    name: Mute
  - description: Operations related to a block
    name: Block
  - description: Operations related to a ban
    name: Ban
  - description: Operations related to onchain data
    name: Onchain
  - description: Operations related to login
    name: Login
  - description: Operations related to retrieving metrics
    name: Metrics
  - description: Operations related to mini app host notifications
    externalDocs:
      description: More info about mini app host notifications
      url: https://docs.neynar.com/docs/app-host-notifications
    name: App Host
paths:
  /v2/farcaster/frame/notifications/:
    post:
      tags:
        - Frame
      summary: Send notifications
      description: >-
        Send notifications to interactors of a mini app. By default every
        broadcast is delivered synchronously and returns 200 with aggregate
        counts. When the `ASYNC_NOTIFICATIONS_ENABLED` server flag is on,
        broadcasts with more than 100 notification tokens are queued and return
        202 with a campaign_id instead; poll the campaign stats endpoint for
        progress. Small broadcasts always stay synchronous.
      operationId: publish-frame-notifications
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendFrameNotificationsReqBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendFrameNotificationsResponse'
          description: Success
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueuedFrameNotificationsResponse'
          description: '202'
        '400':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ZodError'
                  - $ref: '#/components/schemas/ErrorRes'
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Resource not found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Unprocessable Content
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorRes'
          description: Server Error
      externalDocs:
        url: https://docs.neynar.com/reference/publish-frame-notifications
components:
  schemas:
    SendFrameNotificationsReqBody:
      properties:
        filters:
          description: >-
            Filters to apply to the target_fids set. All filters are additive,
            so only users matching all filters will be notified.
          example:
            exclude_fids:
              - 2
              - 8988
            following_fid: 3
            minimum_user_score: 0.5
            near_location:
              latitude: 37.774929
              longitude: -122.419418
              radius: 1000
          properties:
            exclude_fids:
              description: Only send notifications to users who are not in the given FIDs.
              items:
                $ref: '#/components/schemas/Fid'
              type: array
            following_fid:
              description: Only send notifications to users who follow the given FID.
              example: 3
              format: int32
              minimum: 0
              type: integer
            minimum_user_score:
              description: >-
                Only send notifications to users with a score greater than or
                equal to this value.
              maximum: 1
              minimum: 0
              type: number
            near_location:
              description: Only send notifications to users near a given location.
              properties:
                address:
                  $ref: '#/components/schemas/LocationAddress'
                latitude:
                  format: double
                  maximum: 90
                  minimum: -90
                  type: number
                longitude:
                  format: double
                  maximum: 180
                  minimum: -180
                  type: number
                radius:
                  description: >-
                    The radius in meters for the location search. Any location
                    within this radius will be returned.
                  minimum: 0
                  type: number
              required:
                - latitude
                - longitude
              type: object
          type: object
        notification:
          properties:
            body:
              description: >-
                The body of the notification. Must be between 1 and 128
                characters.
              example: You have received a new message in your inbox.
              maxLength: 128
              minLength: 1
              type: string
            target_url:
              description: >-
                The target URL to open when the user clicks the notification.
                Must be a valid URL.
              example: https://example.com/notifications
              format: uri
              maxLength: 256
              type: string
            title:
              description: >-
                The title of the notification. Must be between 1 and 32
                characters.
              example: New Message
              maxLength: 32
              minLength: 1
              type: string
            uuid:
              description: >-
                An optional UUID for the notification, used as an idempotency
                key.
              example: 123e4567-e89b-12d3-a456-426614174000
              format: uuid
              type: string
          required:
            - title
            - body
            - target_url
          type: object
        target_fids:
          description: >-
            An array of target FIDs to whom the notifications should be sent.
            Each FID must be a positive integer. Pass an empty array to send
            notifications to all FIDs with notifications enabled for the mini
            app.
          example:
            - 1
            - 2
            - 3
          items:
            minimum: 1
            type: integer
          maxItems: 100
          type: array
      required:
        - notification
      title: SendFrameNotificationsReqBody
      type: object
    SendFrameNotificationsResponse:
      properties:
        campaign_id:
          description: The unique identifier for the notification campaign.
          format: uuid
          type: string
        failure_count:
          description: The number of notifications that failed to deliver.
          format: int32
          type: integer
        not_attempted_count:
          description: >-
            The number of notifications not attempted (e.g., disabled tokens,
            invalid tokens).
          format: int32
          type: integer
        retryable_fids:
          description: >-
            List of FIDs that failed due to retryable errors (rate_limited,
            failed, http_error). Can be used to retry sending notifications to
            these users.
          items:
            $ref: '#/components/schemas/Fid'
          type: array
        success_count:
          description: The number of notifications successfully delivered.
          format: int32
          type: integer
      required:
        - campaign_id
        - success_count
        - failure_count
        - not_attempted_count
      title: SendFrameNotificationsResponse
      type: object
    QueuedFrameNotificationsResponse:
      properties:
        campaign_id:
          description: The unique identifier for the notification campaign.
          format: uuid
          type: string
        status:
          $ref: '#/components/schemas/NotificationCampaignStatus'
      required:
        - campaign_id
        - status
      title: QueuedFrameNotificationsResponse
      type: object
    ZodError:
      properties:
        code:
          example: InvalidField
          type: string
        errors:
          items:
            properties:
              code:
                type: string
              expected:
                type: string
              message:
                type: string
              path:
                items:
                  type: string
                type: array
              received:
                type: string
            required:
              - code
              - expected
              - received
              - path
              - message
            type: object
          type: array
        message:
          example: Invalid query parameters
          type: string
      required:
        - message
        - code
        - errors
      title: ZodError
      type: object
    ErrorRes:
      description: Details for the error response
      properties:
        code:
          type: string
        message:
          type: string
        property:
          type: string
        status:
          format: int32
          type: integer
      required:
        - message
      title: ErrorRes
      type: object
    Fid:
      description: The unique identifier of a farcaster user or app (unsigned integer)
      example: 3
      format: int32
      minimum: 0
      title: Fid
      type: integer
    LocationAddress:
      properties:
        city:
          type: string
        country:
          type: string
        country_code:
          type: string
        state:
          type: string
        state_code:
          type: string
      required:
        - city
        - country
      title: LocationAddress
      type: object
    NotificationCampaignStatus:
      description: Always "queued" for a successful async enqueue.
      enum:
        - queued
        - running
        - completed
        - failed
        - canceled
      title: NotificationCampaignStatus
      type: string
  securitySchemes:
    ApiKeyAuth:
      description: API key to authorize requests
      in: header
      name: x-api-key
      type: apiKey
      x-default: NEYNAR_API_DOCS

````