Prefect Asset Subscriptions API

The Asset Subscriptions API from Prefect — 1 operation(s) for asset subscriptions.

OpenAPI Specification

prefect-asset-subscriptions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Prefect Cloud Account Billing Asset Subscriptions API
  description: Prefect Cloud REST API documentation.
  version: 0.8.4
tags:
- name: Asset Subscriptions
paths:
  /api/accounts/{account_id}/workspaces/{workspace_id}/asset-subscriptions/:
    post:
      tags:
      - Asset Subscriptions
      summary: Create Asset Subscription
      operationId: create_asset_subscription_api_accounts__account_id__workspaces__workspace_id__asset_subscriptions__post
      parameters:
      - name: account_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Account Id
      - name: workspace_id
        in: path
        required: true
        schema:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Workspace Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssetSubscriptionCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AssetSubscriptionCreate:
      properties:
        publication_id:
          type: string
          format: uuid
          title: Publication Id
      type: object
      required:
      - publication_id
      title: AssetSubscriptionCreate
      description: 'POST body for creating an asset subscription.


        The caller provides a publication_id; the server constructs the underlying

        SubscriptionCreate with the correct event patterns.'
    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
    SubscriptionResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        account_id:
          type: string
          format: uuid
          title: Account Id
        workspace_id:
          type: string
          format: uuid
          title: Workspace Id
        publication_id:
          type: string
          format: uuid
          title: Publication Id
        enabled:
          type: boolean
          title: Enabled
        event:
          items:
            type: string
          type: array
          title: Event
        resource:
          anyOf:
          - items:
              $ref: '#/components/schemas/ResourceSpecification'
            type: array
          - type: 'null'
          title: Resource
        related:
          anyOf:
          - items:
              $ref: '#/components/schemas/ResourceSpecification'
            type: array
          - type: 'null'
          title: Related
        created:
          type: string
          format: date-time
          title: Created
        updated:
          type: string
          format: date-time
          title: Updated
        publication_enabled:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Publication Enabled
          description: Publication's enabled status; None if deleted
        publication_exists:
          type: boolean
          title: Publication Exists
          description: False if the publication has been deleted (orphaned subscription)
      type: object
      required:
      - id
      - account_id
      - workspace_id
      - publication_id
      - enabled
      - event
      - created
      - updated
      - publication_exists
      title: SubscriptionResponse
      description: Response model — subscription + publication status.
    ResourceSpecification:
      additionalProperties:
        anyOf:
        - type: string
        - items:
            type: string
          type: array
      type: object
      title: ResourceSpecification
      description: 'A specification that may match zero, one, or many resources, used to target or

        select a set of resources in a query or automation.  A resource must match at least

        one value of all of the provided labels'