---
title: "Verify API key"
method: POST
path: "/apikeys/verify"
tags: ["API Keys"]
---

# Verify API key

`POST /apikeys/verify`

## Request

- Base URL: `https://api.databuddy.cc`
- URL: `https://api.databuddy.cc/apikeys/verify`
- Auth: API key in header `x-api-key`

Validates an API key (from header or body) and optionally checks scopes. Can be used without auth to test a key.

## Request body

- object
  - `secret` string
  - `resource` string
  - `requiredScopes` string[]
  - `mode` 'any' | 'all'
  - `trackUsage` boolean

## Response `200`

OK

- union
  - object
    - `valid` unknown, required
    - `keyId` string, required
    - `ownerId` string, nullable, required
    - `scopes` string[], required
  - object
    - `valid` unknown, required
    - `error` string, required
    - `errorCode` string, required
    - `scopes` string[]
    - `matched` string[]
    - `missing` string[]

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `403`: 403
- `404`: 404
- `409`: 409
- `429`: 429
- `500`: 500
- `503`: 503

---

[API](https://skmtc.dev/databuddy/apis/databuddy-api.md) - [All operations](https://skmtc.dev/databuddy/apis/databuddy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/databuddy/apis/databuddy-api/revisions/ddfbba648d52?raw)
