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

# Emit a Notification Event

<Note>New to notifications? See the [Notifications guide](/concepts/notifications) for how the system works end-to-end — this API only covers the manual producer escape hatch, not the in-app feed itself.</Note>

Emitting an event is treated as a deal-management action, gated the same as a deal write, so a read-only member can't inject notifications for the org. This lets a write path that bypasses the normal deal handlers (an import job, a script) register the same kind of event those handlers emit automatically. **Only `entity_type: "deal"` is supported today** — any other value is rejected with `400`. Delivery is best-effort: this call queues the event onto the org's per-org notification actor (a Temporal workflow) and returns immediately; it never renders or sends anything synchronously.

<Note>**Anti-spoofing on deal events.** Whatever `payload` you send for a deal event is not trusted as-is. The backend looks up the real deal row for `entity_id` in the caller's org and overwrites `deal_id`, `deal_name`, `value`, `currency`, `owner_id`, and `new_owner_id` with the actual database values before the event is delivered. This exists specifically so the escape hatch can't be used to spoof a deal's name/value/owner, or to fan an "assigned to you" notification at a user who isn't really the deal's owner. Non-sensitive display hints you send through (e.g. `field`, `old`, `new`, stage names) are preserved as-is. If the deal isn't visible in the caller's org, the call fails with `404` rather than silently accepting a fake payload.</Note>

### Auth

Requires a CRM manage [scope](/authentication#scopes) and an active organization on the token. Any `*:manage` scope qualifies — in practice `contacts:manage`, `deals:manage`, `companies:manage`, or `activities:manage`.

### Response

`202 Accepted`

| Field      | Type      | Description                                                                                                                                                                                                                                                             |
| ---------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `accepted` | `boolean` | Whether the Temporal actor accepted the event. `emit_event` swallows its own errors (a queueing failure never surfaces as an HTTP error), so `false` means the event was silently dropped — check application logs, not this field, if events seem to be going missing. |

### Errors

| Status            | Cause                                                                         |
| ----------------- | ----------------------------------------------------------------------------- |
| `400 Bad Request` | `event_type` isn't a known registered event, or `entity_type` isn't `"deal"`. |
| `403 Forbidden`   | No active organization on the token, or the token lacks a CRM manage scope.   |
| `404 Not Found`   | `entity_id` doesn't resolve to a deal visible in the caller's org.            |


## OpenAPI

````yaml POST /notifications/events
openapi: 3.1.0
info:
  title: anycrm-api
  version: 0.0.1
servers: []
security: []
tags:
  - name: Customer Intelligence
    description: >-
      Company research and ICP-fit scoring — create a research run, track its
      progress, and read back scored companies as leads.
  - name: Outreach
    description: >-
      The cold-email management console — domains, mailboxes, and campaigns — as
      a thin control plane over the SalesForge stack.
  - name: AnyCard
    description: >-
      Authenticated CRUD for AnyCard, the org's digital business-card /
      lead-capture product.
  - name: AnyCard Events
    description: >-
      Event-attribution analytics for AnyCard — which captured leads converted,
      broken down by source, owner, and deal.
  - name: AnyCard Share Links
    description: >-
      Unauthenticated endpoints reached by anyone who scans a QR code or opens a
      shared AnyCard link.
  - name: AI
    description: >-
      A streaming (SSE) AI chat endpoint with account-commit actions it can take
      on the caller's behalf.
  - name: Analytics Assistant
    description: >-
      The natural-language analytics assistant — a guarded text-to-SQL loop
      (SSE) that answers ad-hoc questions over the org's CRM data as a
      least-privilege, read-only database role.
  - name: Account Readiness
    description: >-
      Account Readiness Profiles — AI-scored signals on whether an account is
      ready for outreach or expansion, computed via a Temporal workflow.
  - name: Integrations
    description: >-
      Pipedream Connect — issuing connect tokens and managing the org's
      connected third-party accounts.
  - name: Feedback
    description: >-
      User-submitted platform feedback (bug reports, feature requests) — global,
      not scoped to one organization.
  - name: Public Media
    description: >-
      Unauthenticated image reads for publicly-embeddable assets (card photos,
      inline email images) — allowlisted by key shape; everything else in the
      storage bucket stays private.
  - name: Service Health
    description: Service liveness.
paths:
  /notifications/events:
    post:
      tags:
        - Notifications
      summary: Post Event
      operationId: post_event_notifications_events_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventBody'
        required: true
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
                title: Response Post Event Notifications Events Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    EventBody:
      properties:
        event_type:
          type: string
          title: Event Type
          description: >-
            A registered event type, e.g. "deal.stage_changed" — see GET
            /notifications/event-catalog for the full list.
        entity_id:
          type: string
          title: Entity Id
          description: UUID of the entity the event is about — currently always a deal id.
        entity_type:
          type: string
          title: Entity Type
          description: >-
            The kind of entity entity_id refers to; only "deal" is supported
            today, anything else is rejected with 400.
          default: deal
        payload:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Payload
          description: >-
            Client-supplied event details; for deal events the sensitive fields
            (name/value/owner) are overwritten server-side from the real deal
            row before delivery.
      type: object
      required:
        - event_type
        - entity_id
      title: EventBody
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````