> ## Documentation Index
> Fetch the complete documentation index at: https://densify-sync-changelog-11.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create subscriptions (bulk)

> Creates a **collection** of platform-specific subscriptions in one request. The operation
is committed as a whole: any creation failure rolls back the entire batch. Non-admin users
are auto-assigned as `owner`; admins may create global (owner="") or assign any owner. 




## OpenAPI

````yaml openapi/public_cloud/Subscriptions.yaml POST /subscriptions/{platformType}
openapi: 3.0.3
info:
  title: Kubex – Subscriptions API
  version: 1.0.0
  description: >
    Create and manage subscription-based notifications for Kubex cloud and
    container recommendations.

    - `GET /subscriptions/{platformType}` lists subscriptions with filters.

    - `POST /subscriptions/{platformType}` creates **one or more** subscriptions
    (bulk add, all-or-nothing).

    - `PUT /subscriptions/{platformType}/{subscriptionRef}` replaces an existing
    subscription.

    - `DELETE /subscriptions/{platformType}` deletes **one or more**
    subscriptions.

    - `DELETE /subscriptions/{platformType}/{subscriptionRef}` deletes a single
    subscription.

    Notes:

    • `platformType` is `cloud` or `containers`; `/subscriptions` (no platform)
    behaves like `/subscriptions/cloud` for backward compatibility. 
servers:
  - url: https://{host}
    variables:
      host:
        default: api.example.com
security: []
tags:
  - name: Subscriptions
paths:
  /subscriptions/{platformType}:
    post:
      tags:
        - Subscriptions
      summary: Create subscriptions (bulk)
      description: >
        Creates a **collection** of platform-specific subscriptions in one
        request. The operation

        is committed as a whole: any creation failure rolls back the entire
        batch. Non-admin users

        are auto-assigned as `owner`; admins may create global (owner="") or
        assign any owner. 
      operationId: createSubscriptions
      parameters:
        - $ref: '#/components/parameters/platformType'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              minItems: 1
              items:
                $ref: '#/components/schemas/SubscriptionUpsert'
            examples:
              createOne:
                value:
                  - subscriptionName: My Weekly Cloud Feed
                    description: Finance BU, prod apps; weekly
                    owner: ''
                    active: 'true'
                    webhook:
                      uri: https://hooks.example/teams
                      authType: basic
                      authValue: user:pass
                    tagReferences:
                      - tagID: business_unit
                        operator: equals
                        values:
                          - Finance
                    propertyReferences:
                      - propertyID: serviceType
                        operator: equals
                        values:
                          - Virtual Machine
                    suppressionReferences:
                      - suppressionID: no-m3
                        operator: like
                        values:
                          - m3*
                        revokeBy: '1735689600000'
                    returnStructure:
                      showAliases: true
                      fields:
                        - name
                        - region
                        - currentType
                        - recommendedType
                        - savingsEstimate
                        - rptHref
                    schedule:
                      frequency: WEEKLY
                      at: '08:30'
      responses:
        '200':
          description: Created (batch result)
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subscription'
        '400':
          description: Validation/logic error; entire batch rolled back.
        '401':
          description: Authentication failed.
        '500':
          description: Server error.
components:
  parameters:
    platformType:
      name: platformType
      in: path
      required: true
      description: Technology platform (`cloud` or `containers`).
      schema:
        type: string
        enum:
          - cloud
          - containers
  schemas:
    SubscriptionUpsert:
      type: object
      properties:
        subscriptionName:
          type: string
          description: Unique per platform if global; unique per owner if private.
        owner:
          type: string
          description: >-
            "" for global (admin only) or username for private; non-admins
            default to their username.
        description:
          type: string
        outputType:
          type: string
          enum:
            - application/json
          default: application/json
          description: Only supported output type.
        active:
          type: string
          enum:
            - 'true'
            - 'false'
          default: 'false'
          description: >-
            true=active; false=dormant (no scheduled posts; on-demand still
            available).
        webhook:
          $ref: '#/components/schemas/WebHook'
        propertyReferences:
          type: array
          items:
            $ref: '#/components/schemas/PropertyCondition'
        tagReferences:
          type: array
          items:
            $ref: '#/components/schemas/TagCondition'
        suppressionReferences:
          type: array
          items:
            $ref: '#/components/schemas/SuppressionCondition'
        returnStructure:
          $ref: '#/components/schemas/ReturnStructure'
        schedule:
          $ref: '#/components/schemas/Schedule'
      description: >
        Provide at least **one** of: `propertyReferences`, `tagReferences`, or
        `suppressionReferences`. 
    Subscription:
      type: object
      properties:
        subscriptionRef:
          type: string
          description: Unique ID assigned to the subscription.
        subscriptionName:
          type: string
        description:
          type: string
        owner:
          type: string
          description: Empty for global; username for private.
        outputType:
          type: string
        active:
          type: string
          enum:
            - 'true'
            - 'false'
        webhook:
          $ref: '#/components/schemas/WebHook'
        propertyReferences:
          type: array
          items:
            $ref: '#/components/schemas/PropertyCondition'
        tagReferences:
          type: array
          items:
            $ref: '#/components/schemas/TagCondition'
        suppressionReferences:
          type: array
          items:
            $ref: '#/components/schemas/SuppressionCondition'
        returnStructure:
          $ref: '#/components/schemas/ReturnStructure'
        schedule:
          $ref: '#/components/schemas/Schedule'
        webhookStatus:
          type: string
          description: Success | Failure of last push to webhook (with timestamp).
        lastTriggered:
          type: string
          description: >-
            On-Demand Success/Failure or Scheduled Success/Failure with
            timestamp.
        message:
          type: string
          description: Error/status message (on error).
        status:
          type: integer
          description: HTTP-like status code (200, 204, 400, 401, 404, 415, 500).
      required:
        - subscriptionRef
        - subscriptionName
    WebHook:
      type: object
      properties:
        uri:
          type: string
          format: uri
        authType:
          type: string
        authValue:
          type: string
      required:
        - uri
      description: Webhook destination for delivering subscription notifications.
    PropertyCondition:
      type: object
      properties:
        propertyID:
          type: string
        operator:
          type: string
        values:
          type: array
          items:
            type: string
      required:
        - propertyID
        - operator
        - values
      description: >-
        Filter on recommendation fields. Requires at least one **core** property
        overall.
    TagCondition:
      type: object
      properties:
        tagID:
          type: string
        operator:
          type: string
        values:
          type: array
          items:
            type: string
      required:
        - tagID
        - operator
        - values
      description: Filter on system attributes (e.g., account, BU, app).
    SuppressionCondition:
      type: object
      properties:
        suppressionID:
          type: string
        operator:
          type: string
        values:
          type: array
          items:
            type: string
        revokeBy:
          type: string
          description: Unix time (ms) when suppression expires; omit for no expiry.
      required:
        - suppressionID
        - operator
        - values
      description: Exclude systems/recommendations from the output.
    ReturnStructure:
      type: object
      properties:
        showAliases:
          type: boolean
          default: false
          description: Use field aliases as element keys when true.
        fields:
          type: array
          items:
            type: string
          description: Fields to include in returned dataset.
    Schedule:
      type: object
      properties:
        frequency:
          type: string
          description: Implementation-defined frequency (e.g., NIGHTLY, WEEKLY).
        at:
          type: string
          description: HH:mm (24h) time string for trigger.
      description: >-
        If omitted, notifications typically trigger nightly after
        analysis/reporting.

````