0d3cb498a3
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
284 lines
7.3 KiB
YAML
284 lines
7.3 KiB
YAML
openapi: 3.1.0
|
|
info:
|
|
title: Invoice Assistant API
|
|
version: 1.0.0
|
|
servers:
|
|
- url: https://api.example.test
|
|
paths:
|
|
/v1/invoices/search:
|
|
get:
|
|
operationId: searchInvoices
|
|
summary: Search invoice assistant responses.
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/SearchQuery'
|
|
- $ref: '#/components/parameters/UserId'
|
|
responses:
|
|
'200':
|
|
description: Search response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SearchResponse'
|
|
/v1/invoices/apikey-search:
|
|
get:
|
|
operationId: apiKeySearchInvoices
|
|
summary: Search invoice assistant responses with header API-key auth.
|
|
security:
|
|
- invoiceApiKey: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/SearchQuery'
|
|
- $ref: '#/components/parameters/UserId'
|
|
responses:
|
|
'200':
|
|
description: Search response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SearchResponse'
|
|
/v1/invoices/query-key-search:
|
|
get:
|
|
operationId: queryApiKeySearchInvoices
|
|
summary: Search invoice assistant responses with query API-key auth.
|
|
security:
|
|
- invoiceQueryApiKey: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/SearchQuery'
|
|
- $ref: '#/components/parameters/UserId'
|
|
responses:
|
|
'200':
|
|
description: Search response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SearchResponse'
|
|
/v1/invoices/cookie-search:
|
|
get:
|
|
operationId: cookieSearchInvoices
|
|
summary: Search invoice assistant responses with cookie API-key auth.
|
|
security:
|
|
- invoiceCookieApiKey: []
|
|
parameters:
|
|
- $ref: '#/components/parameters/SearchQuery'
|
|
- $ref: '#/components/parameters/UserId'
|
|
responses:
|
|
'200':
|
|
description: Search response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SearchResponse'
|
|
/v1/invoices/header-search:
|
|
get:
|
|
operationId: headerSearchInvoices
|
|
summary: Search invoice assistant responses with tenant header context.
|
|
parameters:
|
|
- $ref: '#/components/parameters/SearchQuery'
|
|
- $ref: '#/components/parameters/UserId'
|
|
- $ref: '#/components/parameters/TenantHeader'
|
|
- $ref: '#/components/parameters/ApiVersion'
|
|
responses:
|
|
'200':
|
|
description: Search response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SearchResponse'
|
|
/v1/invoices/cookie-param-search:
|
|
get:
|
|
operationId: cookieParamSearchInvoices
|
|
summary: Search invoice assistant responses with cookie context.
|
|
parameters:
|
|
- $ref: '#/components/parameters/SearchQuery'
|
|
- $ref: '#/components/parameters/UserId'
|
|
- $ref: '#/components/parameters/InvoiceContextCookie'
|
|
responses:
|
|
'200':
|
|
description: Search response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SearchResponse'
|
|
/v1/invoices/{invoice_id}/chat:
|
|
post:
|
|
operationId: chatWithInvoice
|
|
summary: Ask the invoice assistant about one invoice.
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: invoice_id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InvoiceChatRequest'
|
|
responses:
|
|
'200':
|
|
description: Assistant response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InvoiceChatResponse'
|
|
/v1/invoices/ask:
|
|
post:
|
|
operationId: askInvoiceQuestion
|
|
summary: Ask a tenant-scoped invoice question.
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InvoiceQuestionRequest'
|
|
responses:
|
|
'200':
|
|
description: Question response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SearchResponse'
|
|
/v1/invoices/{invoice_id}/notes:
|
|
parameters:
|
|
- $ref: '#/components/parameters/InvoiceId'
|
|
- $ref: '#/components/parameters/TenantId'
|
|
post:
|
|
operationId: createInvoiceNote
|
|
summary: Create a note on one invoice.
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
$ref: '#/components/requestBodies/InvoiceNoteRequest'
|
|
responses:
|
|
'201':
|
|
$ref: '#/components/responses/CreatedInvoiceNote'
|
|
components:
|
|
parameters:
|
|
SearchQuery:
|
|
name: q
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
UserId:
|
|
name: user_id
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
InvoiceId:
|
|
name: invoice_id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
TenantId:
|
|
name: tenant_id
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
TenantHeader:
|
|
name: X-Tenant-Id
|
|
in: header
|
|
required: true
|
|
schema:
|
|
type: string
|
|
example: tenant-alpha
|
|
ApiVersion:
|
|
name: api-version
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
enum:
|
|
- '2026-04-01'
|
|
InvoiceContextCookie:
|
|
name: invoice-context
|
|
in: cookie
|
|
required: true
|
|
schema:
|
|
type: string
|
|
example: context-alpha
|
|
requestBodies:
|
|
InvoiceNoteRequest:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InvoiceNoteRequest'
|
|
responses:
|
|
CreatedInvoiceNote:
|
|
description: Created note response
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/InvoiceChatResponse'
|
|
schemas:
|
|
InvoiceChatRequest:
|
|
type: object
|
|
required:
|
|
- user_id
|
|
- message
|
|
properties:
|
|
user_id:
|
|
type: string
|
|
message:
|
|
type: string
|
|
InvoiceChatResponse:
|
|
type: object
|
|
required:
|
|
- output
|
|
properties:
|
|
output:
|
|
type: string
|
|
InvoiceNoteRequest:
|
|
type: object
|
|
required:
|
|
- user_id
|
|
- message
|
|
properties:
|
|
user_id:
|
|
type: string
|
|
message:
|
|
type: string
|
|
InvoiceQuestionRequest:
|
|
type: object
|
|
required:
|
|
- tenant_id
|
|
- question
|
|
properties:
|
|
tenant_id:
|
|
type: string
|
|
question:
|
|
type: string
|
|
SearchResponse:
|
|
type: object
|
|
required:
|
|
- answer
|
|
properties:
|
|
answer:
|
|
type: string
|
|
securitySchemes:
|
|
bearerAuth:
|
|
type: http
|
|
scheme: bearer
|
|
invoiceApiKey:
|
|
type: apiKey
|
|
in: header
|
|
name: X-API-Key
|
|
invoiceQueryApiKey:
|
|
type: apiKey
|
|
in: query
|
|
name: api_key
|
|
invoiceCookieApiKey:
|
|
type: apiKey
|
|
in: cookie
|
|
name: invoice_session
|