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

# Send a signed module event

> Accepts a native event from an installed module. Authenticate with the installation's `mk_live_` module credential, sign the exact raw JSON body with HMAC-SHA256 over `${timestamp}.${raw_body}`, and send the matching event id as `Idempotency-Key`. The installed manifest declares the native type and maps it to a platform canonical type. Organization `org_` keys are not accepted.



## OpenAPI

````yaml https://api.develop.fourdos.dev/openapi/partner.json post /v1/ingest
openapi: 3.1.0
info:
  title: 4D OS Partner API
  version: 0.1.0
  description: >-
    REST API for 4D OS partners. Authenticate with your organization API key:
    `Authorization: Bearer <key>`.


    Requests and responses are JSON with `snake_case` field names. Errors share
    one envelope: `{ "error": { "code", "status", "message", "details"? } }`.


    Mutating endpoints that declare it accept an `Idempotency-Key` header so
    retries are safe.


    Bulk-migrating members? See the [Migrating to 4D
    guide](https://docs.fourdos.dev/walkthroughs/migrate-existing-members) for
    the canonical import schema, a worked example, and the `/v1/imports`
    sequence.
servers:
  - url: https://api.develop.fourdos.dev
security:
  - partnerApiKey: []
tags:
  - name: Users
    description: Create, read, and manage users and their org membership
  - name: Imports
    description: Bulk member import jobs (staging → validate → commit)
  - name: API keys
    description: Issue, list, and revoke server-side organization API keys
  - name: Modules
    description: >-
      Publish private modules, install visible modules, and manage their
      credentials
  - name: Ingest
    description: Receive signed native events from an installed module
  - name: Engagement
    description: Browser event tracking (publishable keys) and tracking-key management
paths:
  /v1/ingest:
    post:
      tags:
        - Ingest
      summary: Send a signed module event
      description: >-
        Accepts a native event from an installed module. Authenticate with the
        installation's `mk_live_` module credential, sign the exact raw JSON
        body with HMAC-SHA256 over `${timestamp}.${raw_body}`, and send the
        matching event id as `Idempotency-Key`. The installed manifest declares
        the native type and maps it to a platform canonical type. Organization
        `org_` keys are not accepted.
      operationId: ingestModuleEvent
      parameters:
        - name: X-4D-Signature
          in: header
          required: true
          description: Signature in the form `t=<unix_seconds>,v1=<hex_hmac>`.
          schema:
            type: string
        - name: Idempotency-Key
          in: header
          required: true
          description: >-
            Must equal the body `event_id`; reuse it only with the same event
            body.
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IngestRequest'
      responses:
        '202':
          description: >-
            Event recorded with a canonicalised, rejected, or mapping_failed
            outcome
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IngestResponse'
        '401':
          description: Module credential or HMAC signature is missing or invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: The module installation is not enabled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: The event id was already used with a different body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The request envelope or idempotency key is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: The module credential rate limit was exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - moduleCredential: []
components:
  schemas:
    IngestRequest:
      type: object
      required:
        - type
        - version
        - event_id
        - occurred_at
        - payload
      properties:
        type:
          type: string
          minLength: 1
          description: Module-owned native event type
        version:
          type: integer
          minimum: 1
          description: Version of the native event type
        event_id:
          type: string
          minLength: 1
          description: Caller-generated idempotency identifier
        occurred_at:
          type: string
          format: date-time
        member_external_id:
          type: string
          minLength: 1
        payload:
          type: object
          description: Payload validated by the installed module manifest
      additionalProperties: true
    IngestResponse:
      type: object
      properties:
        inbound_event_id:
          type: string
        status:
          type: string
          enum:
            - received
            - validated
            - canonicalised
            - rejected
            - mapping_failed
        canonical_event_id:
          type:
            - string
            - 'null'
        reject_reason:
          type:
            - string
            - 'null'
      required:
        - inbound_event_id
        - status
        - canonical_event_id
        - reject_reason
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            status:
              type: integer
            message:
              type: string
            details:
              type: object
              additionalProperties: true
          required:
            - code
            - status
            - message
      required:
        - error
  securitySchemes:
    partnerApiKey:
      type: http
      scheme: bearer
      description: >-
        Organization API key (`org_...`) sent as `Authorization: Bearer <key>`.
        Keys are scoped to one organization; every request operates within that
        tenant.
    moduleCredential:
      type: http
      scheme: bearer
      description: >-
        Module ingest credential (`mk_live_...`) sent as `Authorization: Bearer
        <key>`.

````