OpenGov Receipt Surface Versions API

The receiptSurfaceVersions API from OpenGov — 1 operation(s) for receiptsurfaceversions.

Documentation

Specifications

Other Resources

OpenAPI Specification

opengov-receiptsurfaceversions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: OpenGov Receipt Receipt Surface Versions API
  version: 1.0.0
  description: API for managing receipts.
servers:
- url: https://api-receipts.procurement.opengov.com
  description: Production
- url: https://api-receipts.procurement.ogstaging.us
  description: Staging
- url: https://api-receipts.procurement.ogintegration.us
  description: Integration
security: []
tags:
- name: receiptSurfaceVersions
paths:
  /api/v1/entities/{entityId}/receipts/{id}/surface-versions:
    get:
      tags:
      - receiptSurfaceVersions
      operationId: receiptSurfaceVersions.listVersions
      parameters:
      - name: entityId
        in: path
        schema:
          type: string
          description: The UUID of the Platform entity
          default: 04eb277c-f9cd-42b0-9610-0f068f6aaea1
        required: true
        description: The UUID of the Platform entity
      - name: id
        in: path
        schema:
          type: string
          description: a string to be decoded into a number
        required: true
        description: a string to be decoded into a number
      - name: surfaces
        in: query
        schema:
          type: string
        required: false
      security:
      - platformApiKey: []
      - platformBearerToken: []
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                - meta
                properties:
                  data:
                    type: object
                    required:
                    - versions
                    properties:
                      versions:
                        type: array
                        items:
                          type: object
                          required:
                          - surface
                          - maxEntryId
                          - lastViewedEntryId
                          - entryCount
                          - isNewer
                          properties:
                            surface:
                              $ref: '#/components/schemas/SurfaceType'
                            maxEntryId:
                              type: integer
                              description: an integer
                              title: int
                            lastViewedEntryId:
                              anyOf:
                              - type: integer
                                description: an integer
                                title: int
                              - type: 'null'
                            entryCount:
                              type: integer
                              description: an integer
                              title: int
                            isNewer:
                              type: boolean
                          additionalProperties: false
                    additionalProperties: false
                  meta:
                    type: object
                    required:
                    - receiptId
                    properties:
                      receiptId:
                        type: integer
                        description: an integer
                        title: int
                    additionalProperties: false
                additionalProperties: false
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
        '401':
          description: AuthError
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
        '403':
          description: Receipt permission denied
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
        '404':
          description: EntityNotFoundError
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
        '500':
          description: InfrastructureError
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
      description: Returns current max entry IDs for each surface (COMMENTS, ATTACHMENTS, ACTIVITY_LOG) and the user's last-viewed entry ID for each. Frontend uses the `isNewer` flag to render the 'New' badge. Called on side-panel mount.
      summary: Get surface version status for a receipt
    post:
      tags:
      - receiptSurfaceVersions
      operationId: receiptSurfaceVersions.recordSurfaceViews
      parameters:
      - name: entityId
        in: path
        schema:
          type: string
          description: The UUID of the Platform entity
          default: 04eb277c-f9cd-42b0-9610-0f068f6aaea1
        required: true
        description: The UUID of the Platform entity
      - name: id
        in: path
        schema:
          type: string
          description: a string to be decoded into a number
        required: true
        description: a string to be decoded into a number
      security:
      - platformApiKey: []
      - platformBearerToken: []
      responses:
        '204':
          description: Success
        '400':
          description: The request did not match the expected schema
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
        '401':
          description: AuthError
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
        '403':
          description: Receipt permission denied
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
        '404':
          description: EntityNotFoundError
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
        '500':
          description: InfrastructureError
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: integer
                    description: HTTP status code
                    example: 400
                  code:
                    type: string
                    description: Error code identifier
                    example: ValidationError
                  detail:
                    type: string
                    description: Human-readable error description
                    example: The request body failed validation.
                  fieldErrors:
                    type: array
                    description: Field-specific validation errors
                    items:
                      type: object
                      properties:
                        parameter:
                          type: string
                          description: Field path that failed validation
                          example: status
                        detail:
                          type: string
                          description: Specific validation error message
                          example: Expected one of ["Draft", "Submitted", "Cancelled"], received "Draft112"
                        code:
                          type: string
                          description: Optional error code
                          example: INVALID_ENUM_VALUE
                        data:
                          type: object
                          description: Optional additional error context
                          additionalProperties: true
                      required:
                      - parameter
                      - detail
                required:
                - status
                - code
                - detail
      description: Body is an array of `{ surface, lastViewedEntryId }` pairs. Backend upserts rcp_user_surface_views records and bumps `viewed_count`. Returns 204 No Content. Called when the user opens a panel.
      summary: Record surface views (mark up to entry IDs as seen)
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                - surface
                - lastViewedEntryId
                properties:
                  surface:
                    $ref: '#/components/schemas/SurfaceType'
                  lastViewedEntryId:
                    type: integer
                    description: an integer
                    title: int
                additionalProperties: false
        required: true
components:
  schemas:
    SurfaceType:
      type: string
      enum:
      - COMMENTS
      - ATTACHMENTS
      - ACTIVITY_LOG
      description: Type of surface to track versions for
      title: Surface type
  securitySchemes:
    platformApiKey:
      description: OpenGov Platform API Key
      type: apiKey
      name: Authorization
      in: header
    platformBearerToken:
      type: http
      scheme: bearer