Amigo Review Queue API

The Review Queue API from Amigo — 4 operation(s) for review queue.

OpenAPI Specification

amigo-review-queue-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Amigo Account Review Queue API
  version: 0.1.0
servers:
- url: https://api.amigo.ai
- url: https://internal-api.amigo.ai
- url: https://api-eu-central-1.amigo.ai
- url: https://api-ap-southeast-2.amigo.ai
- url: https://api-ca-central-1.amigo.ai
security:
- Bearer-Authorization: []
  Bearer-Authorization-Organization: []
  Basic: []
tags:
- name: Review Queue
paths:
  /v1/{workspace_id}/external-write-proposals:
    get:
      tags:
      - Review Queue
      summary: List External Write Proposals
      operationId: list-external-write-proposals
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: status
        in: query
        required: false
        schema:
          anyOf:
          - enum:
            - proposed
            - approved
            - rejected
            - pushing
            - pushed
            - failed
            - superseded
            type: string
          - type: 'null'
          title: Status
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          maximum: 100
          exclusiveMinimum: 0
          default: 10
          title: Limit
      - name: continuation_token
        in: query
        required: false
        schema:
          type: integer
          default: 0
          title: Continuation Token
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_ExternalWriteProposal_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/{workspace_id}/external-write-proposals/{proposal_id}:
    get:
      tags:
      - Review Queue
      summary: Get External Write Proposal
      operationId: get-external-write-proposal
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: proposal_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Proposal Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalWriteProposal'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/{workspace_id}/external-write-proposals/{proposal_id}/approve:
    post:
      tags:
      - Review Queue
      summary: Approve External Write Proposal
      operationId: approve-external-write-proposal
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: proposal_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Proposal Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalWriteProposal'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/{workspace_id}/external-write-proposals/{proposal_id}/reject:
    post:
      tags:
      - Review Queue
      summary: Reject External Write Proposal
      operationId: reject-external-write-proposal
      parameters:
      - name: workspace_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Workspace Id
      - name: proposal_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Proposal Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RejectProposalRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalWriteProposal'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ExternalWriteProposal:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        workspace_id:
          type: string
          format: uuid
          title: Workspace Id
        connector_type:
          type: string
          title: Connector Type
        data_source_id:
          type: string
          format: uuid
          title: Data Source Id
        fhir_resource_type:
          type: string
          title: Fhir Resource Type
        fhir_resource_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Fhir Resource Id
        proposed_payload:
          additionalProperties: true
          type: object
          title: Proposed Payload
        confidence:
          anyOf:
          - type: number
          - type: 'null'
          title: Confidence
        origin_run_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Origin Run Id
        origin_run_kind:
          anyOf:
          - type: string
          - type: 'null'
          title: Origin Run Kind
        origin_event_id:
          type: string
          format: uuid
          title: Origin Event Id
        event_type:
          anyOf:
          - type: string
          - type: 'null'
          title: Event Type
        entity_id:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Entity Id
        status:
          type: string
          enum:
          - proposed
          - approved
          - rejected
          - pushing
          - pushed
          - failed
          - superseded
          title: Status
        decided_by:
          anyOf:
          - type: string
            format: uuid
          - type: 'null'
          title: Decided By
        decided_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Decided At
        reject_reason:
          anyOf:
          - type: string
          - type: 'null'
          title: Reject Reason
        push_attempt_count:
          type: integer
          title: Push Attempt Count
          default: 0
        vendor_resource_id:
          anyOf:
          - type: string
          - type: 'null'
          title: Vendor Resource Id
        error:
          anyOf:
          - type: string
          - type: 'null'
          title: Error
        created_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Created At
        updated_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated At
      type: object
      required:
      - id
      - workspace_id
      - connector_type
      - data_source_id
      - fhir_resource_type
      - origin_event_id
      - status
      title: ExternalWriteProposal
      description: 'A human-review proposal for an external (EHR) write-back — the Review Queue.


        Staged by connector-runner when a `review_required` sink would otherwise

        auto-push (world.external_write_proposals); a reviewer approves/rejects, and the

        egress drain delivers approved ones. ``proposed_payload`` is the full FHIR write

        body and MAY contain PHI — this surface is workspace-scoped (FORCE-RLS) and

        permission-gated (ReviewQueue); never log it. ``connector_type``/``fhir_*``/

        ``status``/``idempotency_key`` are opaque strings; the ids are uuid.'
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PaginatedResponse_ExternalWriteProposal_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/ExternalWriteProposal'
          type: array
          title: Items
        has_more:
          type: boolean
          title: Has More
        continuation_token:
          anyOf:
          - type: integer
          - type: 'null'
          title: Continuation Token
        total:
          anyOf:
          - type: integer
          - type: 'null'
          title: Total
      type: object
      required:
      - items
      - has_more
      title: PaginatedResponse[ExternalWriteProposal]
    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
    RejectProposalRequest:
      properties:
        reason:
          type: string
          maxLength: 1000
          minLength: 1
          title: Reason
      type: object
      required:
      - reason
      title: RejectProposalRequest
  securitySchemes:
    Bearer-Authorization:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the [`SignInWithAPIKey`](sign-in-with-api-key) endpoint.
    Bearer-Authorization-Organization:
      type: apiKey
      in: header
      name: X-ORG-ID
      description: An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.
    Basic:
      type: http
      scheme: basic
      description: The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.