---
title: "Dry-run the saved OAuth 2.0 client-credentials config"
method: POST
path: "/api/registry/agents/{encodedUrl}/oauth-client-credentials/test"
tags: ["Agent Compliance"]
---

# Dry-run the saved OAuth 2.0 client-credentials config

`POST /api/registry/agents/{encodedUrl}/oauth-client-credentials/test`

Exchange the saved client_credentials at the token endpoint and discard the resulting access token. Returns success + latency on a 2xx exchange, or the SDK's `ClientCredentialsExchangeError` kind (`oauth`, `malformed`, `network`) on failure so operators get same-second feedback instead of waiting for the next compliance heartbeat. Requires authentication and ownership. Requires credentials to already be saved via `PUT /oauth-client-credentials`.

## Path parameters

- `encodedUrl` string, required — URL-encoded agent URL

## Response `200`

Result of the token exchange. `ok: true` on 2xx from the AS; `ok: false` with a typed error otherwise (HTTP response itself is still 200 — the error payload carries the rejection kind so UI can branch on it).

- union
  - object
    - `ok` true, required
    - `latency_ms` integer, required
  - object
    - `ok` false, required
    - `latency_ms` integer, required
    - `error` object, required
      - `kind` 'oauth' | 'malformed' | 'network', required — Category of failure: `oauth` = AS returned a typed error (e.g. invalid_client), `malformed` = AS returned an unexpected 2xx payload, `network` = couldn't reach the AS.
      - `message` string, required
      - `oauth_error` string — RFC 6749 `error` field when kind=oauth.
      - `oauth_error_description` string — RFC 6749 `error_description` field when kind=oauth.
      - `http_status` integer — Status code when the AS returned a non-2xx.

## Other responses

- `400` — Invalid agent URL
- `401` — Authentication required
- `403` — Not authorized
- `404` — No saved client-credentials config for this agent
- `500` — Server error

---

[API](https://skmtc.net/adcontextprotocol/apis/agenticadvertising-org-registry-api.md) · [All operations](https://skmtc.net/adcontextprotocol/apis/agenticadvertising-org-registry-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/adcontextprotocol/agenticadvertising-org-registry-api/versions/9ea7fedf54c0/schema)
