CDC

CDC events API

The events API from CDC — 2 operation(s) for events.

OpenAPI Specification

cdc-events-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: DIBBs eCR Refiner app-notifications events API
  description: 'Please visit the repo for more info: https://github.com/CDCgov/dibbs-ecr-refiner'
  version: 1.0.0
tags:
- name: events
paths:
  /api/v1/events/:
    get:
      tags:
      - events
      summary: Get Events
      description: "Returns a list of all events for a jurisdiction, ordered from newest to oldest.\n\nArgs:\n    user (DbUser): The user making the request.\n    db (AsyncDatabaseConnection): Database connection.\n    logger (Logger): Standard logger.\n    page (int): page of events to return to the client.\n    canonical_url (str | None): An optional filter on the condition.\n\nReturns:\n    EventResponse: A bundle with\n        - Total page count\n        - The list of AuditEvents relevant for the (optional) filter\n        - The list of condition information with potentially filter-able data"
      operationId: getEvents
      parameters:
      - name: page
        in: query
        required: false
        schema:
          type: integer
          default: 1
          title: Page
      - name: canonical_url
        in: query
        required: false
        schema:
          anyOf:
          - type: string
          - type: 'null'
          title: Canonical Url
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/events/{event_id}/custom-code-uploads:
    get:
      tags:
      - events
      summary: Get Custom Code Upload Events
      description: "Returns a list of all custom code upload events associated with a parent event ID.\n\nArgs:\n    event_id (UUID): The parent event\n    user (DbUser): The logged in user\n    db (AsyncDatabaseConnection): The database connection\n\nRaises:\n    HTTPException: 404 if event with requested ID is not found or does not belong to user's jurisdiction"
      operationId: getCustomCodeUploadEvents
      parameters:
      - name: event_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Event Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomCodeUploadEventResponse'
                title: Response Getcustomcodeuploadevents
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CustomCodeUploadEventResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        system_display_name:
          type: string
          title: System Display Name
        code:
          type: string
          title: Code
        name:
          type: string
          title: Name
      type: object
      required:
      - id
      - system_display_name
      - code
      - name
      title: CustomCodeUploadEventResponse
      description: Response model for a custom code upload event.
    EventFilterOption:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
        canonical_url:
          type: string
          title: Canonical Url
      type: object
      required:
      - id
      - name
      - canonical_url
      title: EventFilterOption
      description: Conditions returned to the user to be used for filtering events.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    AuditEvent:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        username:
          type: string
          title: Username
        configuration_name:
          type: string
          title: Configuration Name
        configuration_version:
          type: integer
          title: Configuration Version
        condition_id:
          type: string
          format: uuid
          title: Condition Id
        action_text:
          type: string
          title: Action Text
        created_at:
          type: string
          format: date-time
          title: Created At
        has_custom_code_upload_events:
          type: boolean
          title: Has Custom Code Upload Events
      type: object
      required:
      - id
      - username
      - configuration_name
      - configuration_version
      - condition_id
      - action_text
      - created_at
      - has_custom_code_upload_events
      title: AuditEvent
      description: An event returned by the DB function.
    EventsResponse:
      properties:
        audit_events:
          items:
            $ref: '#/components/schemas/AuditEvent'
          type: array
          title: Audit Events
        configuration_options:
          items:
            $ref: '#/components/schemas/EventFilterOption'
          type: array
          title: Configuration Options
        total_pages:
          type: integer
          title: Total Pages
      type: object
      required:
      - audit_events
      - configuration_options
      - total_pages
      title: EventsResponse
      description: Response needed for the audit log page.