# amp_events/openapi — OpenAPI 3.1 (generated)
---
openapi: 3.1.0
info:
  title: Accoil Marketplace Events API
  version: '1'
paths:
  "/{account_slug}/amp_events/products":
    post:
      operationId: create_product
      summary: Add a Marketplace app to sync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                product:
                  type: object
                  properties:
                    app_name:
                      type: string
                    app_key:
                      type: string
                      description: one paying owner per app key
                    atlassian_cred_id:
                      type: integer
                      description: id of an Atlassian credential the product syncs
                        as
                  required:
                  - app_name
                  - app_key
                  - atlassian_cred_id
              required:
              - product
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{id}":
    delete:
      operationId: delete_product
      summary: Delete a product and its data (dead letters are kept)
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/demo_products":
    post:
      operationId: create_demo_product
      summary: Create a demo product (mock Marketplace, no Atlassian account needed)
      description: Arrives with its credential, a REST pipe and a backfill already
        done. Refused in production.
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/credentials":
    post:
      operationId: create_credential
      summary: Add an Atlassian developer-space credential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                credential:
                  type: object
                  properties:
                    label:
                      type: string
                      description: what you call this developer space; Atlassian never
                        sees it
                    developer_id:
                      type: string
                      description: from your Marketplace vendor URL
                    atlassian_email:
                      type: string
                      format: email
                    api_token:
                      type: string
                      format: secret
                      description: write-only; never returned. On update, blank/omitted
                        keeps the stored token
                    atlassian_base_url:
                      type: string
                      format: uri
                      description: optional; set to a mock Marketplace base URL to
                        sync fixture data instead of Atlassian
                  required:
                  - label
                  - developer_id
                  - atlassian_email
                  - api_token
              required:
              - credential
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/credentials/{id}":
    patch:
      operationId: update_credential
      summary: Update a credential
      description: api_token blank/omitted keeps the stored token
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                credential:
                  type: object
                  properties:
                    label:
                      type: string
                      description: what you call this developer space; Atlassian never
                        sees it
                    developer_id:
                      type: string
                      description: from your Marketplace vendor URL
                    atlassian_email:
                      type: string
                      format: email
                    api_token:
                      type: string
                      format: secret
                      description: write-only; never returned. On update, blank/omitted
                        keeps the stored token
                    atlassian_base_url:
                      type: string
                      format: uri
                      description: optional; set to a mock Marketplace base URL to
                        sync fixture data instead of Atlassian
              required:
              - credential
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
    delete:
      operationId: delete_credential
      summary: Delete a credential
      description: Refused while any product still syncs as it — delete or re-point
        those products first.
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/syncs":
    post:
      operationId: start_sync
      summary: Start one sync run
      description: At most one run per product may be 'running'; starting another
        while one runs is refused. Watch it on the Runs tab (filter ?status=running).
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/syncs/{id}":
    delete:
      operationId: cancel_run
      summary: Cancel the running sync/backfill/replay
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/backfills":
    post:
      operationId: start_backfill
      summary: Backfill transactions from a date to today
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from_date:
                  type: string
                  format: date (ISO 8601, YYYY-MM-DD)
                  default: 12 months ago
                  description: Clamped to [2012-01-01, today].
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/connections":
    post:
      operationId: create_connection
      summary: Add a destination (a delivery pipe)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connection:
                  type: object
                  properties:
                    destination:
                      type: string
                      enum:
                      - accoil
                      - amplitude
                      - mixpanel
                      - posthog
                      - segment
                      - rest
                      description: immutable after create
                    enabled:
                      type: boolean
                      default: true
                    write_key:
                      type: string
                      format: secret
                      description: never returned; on update leave blank to keep
                    destination_config:
                      type: object
                      properties:
                        group_identifier:
                          type: string
                          enum:
                          - entitlement_number
                          - entitlement_id
                          default: entitlement_number
                          description: set once; immutable after create
                        accoil:
                          type: object
                          properties:
                            base_url:
                              type: string
                              default: https://in.accoil.com
                              required: true
                        amplitude:
                          type: object
                          properties:
                            group_type_name:
                              type: string
                              default: license
                              description: The Amplitude group type events are grouped
                                under.
                              required: true
                        mixpanel:
                          type: object
                          properties:
                            project_id:
                              type: string
                              required: true
                            group_key:
                              type: string
                              default: license
                              description: Must match a group key configured in your
                                Mixpanel project settings.
                              required: true
                        posthog:
                          type: object
                          properties:
                            host:
                              type: string
                              default: https://app.posthog.com
                              required: true
                        segment:
                          type: object
                          properties:
                            base_url:
                              type: string
                              default: https://api.segment.io
                              required: true
                        rest:
                          type: object
                          properties:
                            url:
                              type: string
                              required: true
                            group_update_url:
                              type: string
                            auth_type:
                              type: string
                              enum:
                              - bearer
                              - api_key
                              - basic
                              default: bearer
                              required: true
                            auth_header_name:
                              type: string
                              default: Authorization
                              required: true
                      description: nest the chosen destination's fields under destination_config[<destination>]
              required:
              - connection
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/connections/{id}":
    patch:
      operationId: update_connection
      summary: Update a destination's config or enabled state
      description: destination is immutable after create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                connection:
                  type: object
                  properties:
                    destination:
                      type: string
                      enum:
                      - accoil
                      - amplitude
                      - mixpanel
                      - posthog
                      - segment
                      - rest
                      description: immutable after create
                    enabled:
                      type: boolean
                      default: true
                    write_key:
                      type: string
                      format: secret
                      description: never returned; on update leave blank to keep
                    destination_config:
                      type: object
                      properties:
                        group_identifier:
                          type: string
                          enum:
                          - entitlement_number
                          - entitlement_id
                          default: entitlement_number
                          description: set once; immutable after create
                        accoil:
                          type: object
                          properties:
                            base_url:
                              type: string
                              default: https://in.accoil.com
                              required: true
                        amplitude:
                          type: object
                          properties:
                            group_type_name:
                              type: string
                              default: license
                              description: The Amplitude group type events are grouped
                                under.
                              required: true
                        mixpanel:
                          type: object
                          properties:
                            project_id:
                              type: string
                              required: true
                            group_key:
                              type: string
                              default: license
                              description: Must match a group key configured in your
                                Mixpanel project settings.
                              required: true
                        posthog:
                          type: object
                          properties:
                            host:
                              type: string
                              default: https://app.posthog.com
                              required: true
                        segment:
                          type: object
                          properties:
                            base_url:
                              type: string
                              default: https://api.segment.io
                              required: true
                        rest:
                          type: object
                          properties:
                            url:
                              type: string
                              required: true
                            group_update_url:
                              type: string
                            auth_type:
                              type: string
                              enum:
                              - bearer
                              - api_key
                              - basic
                              default: bearer
                              required: true
                            auth_header_name:
                              type: string
                              default: Authorization
                              required: true
                      description: nest the chosen destination's fields under destination_config[<destination>]
              required:
              - connection
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
    delete:
      operationId: delete_connection
      summary: Remove a destination
      description: Deletes the pipe and its delivery history; dead letters are kept.
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/connections/{id}/replay":
    post:
      operationId: replay_connection
      summary: Re-send the whole event history to this destination
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/settings":
    patch:
      operationId: update_settings
      summary: Update product settings
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                product:
                  type: object
                  properties:
                    app_name:
                      type: string
                    app_key:
                      type: string
                      description: one paying owner per app key; a clash is refused
                    sync_enabled:
                      type: boolean
                      note: pause/resume syncing
                    behavior_config:
                      type: object
                      properties:
                        update_all_licenses_on_sync:
                          type: boolean
                          note: literal true/false only
                        skip_inactive_on_first_run:
                          type: boolean
                          note: literal true/false only
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/dead_letters/{id}/resolve":
    patch:
      operationId: resolve_dead_letter
      summary: Mark a dead letter resolved (forensics kept)
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/products/{product_id}/anomalies/{id}/acknowledge":
    patch:
      operationId: acknowledge_anomaly
      summary: Acknowledge a contract anomaly
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/notifications":
    post:
      operationId: create_notification_stream
      summary: Add a notification stream (webhook or Slack)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                stream:
                  type: object
                  properties:
                    kind:
                      type: string
                      enum: &1
                      - webhook
                      - slack
                      description: webhook POSTs a signed JSON payload; slack posts
                        a message to an incoming-webhook URL
                    url:
                      type: string
                      format: uri
                      description: must be https
                    product_id:
                      type:
                      - integer
                      - 'null'
                      description: narrow to one product, or null for all products
                    events:
                      type: array
                      items:
                        type: string
                        enum:
                        - run.failed
                        - run.partial
                        - run.recovered
                      description: which state changes to notify on
                  required:
                  - kind
                  - url
                  - events
              required:
              - stream
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/notifications/{id}":
    patch:
      operationId: update_notification_stream
      summary: Update a notification stream
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                stream:
                  type: object
                  properties:
                    kind:
                      type: string
                      enum: *1
                      description: webhook POSTs a signed JSON payload; slack posts
                        a message to an incoming-webhook URL
                    url:
                      type: string
                      format: uri
                      description: must be https
                    product_id:
                      type:
                      - integer
                      - 'null'
                      description: narrow to one product, or null for all products
                    events:
                      type: array
                      items:
                        type: string
                        enum:
                        - run.failed
                        - run.partial
                        - run.recovered
                      description: which state changes to notify on
                  required:
                  - kind
                  - url
                  - events
              required:
              - stream
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
    delete:
      operationId: delete_notification_stream
      summary: Remove a notification stream
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/notifications/{id}/test":
    post:
      operationId: test_notification_stream
      summary: Send a sample run.failed payload to this stream
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
  "/{account_slug}/amp_events/notifications/{id}/signing_secret":
    patch:
      operationId: regenerate_signing_secret
      summary: Rotate a webhook stream's HMAC signing secret
      description: The old secret stops verifying immediately — update your endpoint
        at the same time. A Slack stream has no signing secret; this is refused for
        one.
      requestBody:
        description: No body — an empty request.
        required: false
      responses:
        '200':
          description: OK
        '403':
          description: Read-only token, or not permitted
