---
title: "Test a scoped agent key"
method: POST
path: "/v1/actions/agent-connection-test"
tags: ["Moderated Actions"]
---

# Test a scoped agent key

`POST /v1/actions/agent-connection-test`

## Request

- Base URL: `https://loppee.com`
- URL: `https://loppee.com/v1/actions/agent-connection-test`
- Auth: none required

Validates a scoped agent key through the same resolver used by MCP and returns only its resolved identity and scope metadata. Supply the key in X-LOPPEE-API-Key or Authorization: Bearer; the optional body key is a UI fallback. Keys are never accepted in the URL and the raw key is never returned or logged. Missing and invalid keys are normal ok=false responses. Rate-limited per caller IP.

## Headers

- `X-LOPPEE-API-Key` string

## Request body

- AgentConnectionTestRequest
  - `key` string: Optional UI fallback. Prefer X-LOPPEE-API-Key or Authorization: Bearer; never put a key in the URL.

## Response `200`

AgentConnectionTestResponse

- union
  - object
    - `ok` unknown, required
    - `identity` AgentConnectionIdentity, required
      - `account_id` string, required
      - `label` string, required
      - `allowed_actions` string[], required
      - `allowed_business_ids` string[], required
      - `source` 'database' | 'environment' | 'legacy', required
      - `scope_kind` 'consumer' | 'management' | 'team' | 'operator' | 'unknown', required
  - object
    - `ok` unknown, required
    - `reason` 'missing_key' | 'invalid_key', required

## Other responses

- `400`: ErrorResponse
- `413`: ErrorResponse
- `429`: RateLimitError
- `default`: ErrorResponse

---

[API](https://skmtc.dev/loppee/apis/loppee-business-registry-api-for-external-agents.md) · [All operations](https://skmtc.dev/loppee/apis/loppee-business-registry-api-for-external-agents/llms.txt) · [OpenAPI document](https://skmtc.dev/loppee/apis/loppee-business-registry-api-for-external-agents/revisions/37285f7cddcd?raw)
