/api/testing

POST /api/testing/api-keys/seed-usage

Changed on

Record one completed API-key-authenticated request so the API-key usage E2E page has a visible row, then force an immediate flush of the usage-log and last_used_at batches (both normally flushed on a scheduled interval) so the row is queryable without waiting. Routes through the production metabase.api-keys.usage/record-api-key-usage! path (rather than a hand-rolled insert) so the seeded row can't drift from real writes. Intended only for E2E tests.

post/api/testing/api-keys/seed-usage

Request

  • Base URL
    (relative, and the document was published on a file host, not at the API’s origin)
  • Auth
    API key in header X-API-Key

Request body

api_key_idinteger required

value must be an integer greater than zero.

created_by_idinteger required

value must be an integer greater than zero.

duration_msinteger nullable

value must be an integer greater or equal to than zero.

route_templatestring nullable

value must be a non-blank string.

statusinteger nullable
user_idinteger required

value must be an integer greater than zero.

Response

Successful response

insertedinteger required

Changes