From 785f42672f905e97196680b5c176a7ad5a595c51 Mon Sep 17 00:00:00 2001 From: Your GitHub Username Date: Sat, 11 Jul 2026 01:32:38 -0400 Subject: [PATCH] Fix public-api skill: clay-api-key header (not Bearer) + current search paths The public-api skill instructs agents to send the key as a Bearer token, which returns 401 on every endpoint. The correct header is `clay-api-key: ` (verified: Bearer -> 401, clay-api-key -> 200 on /v0/me). Also refresh the stale Search endpoint paths: `/searches/fields` -> 404, now `/search/filters-mode/fields` (200); `POST /searches` -> 404, now `POST /search/filters-mode` (400, i.e. path exists and wants a body). Co-Authored-By: Claude Opus 4.8 --- clay/skills/public-api/SKILL.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/clay/skills/public-api/SKILL.md b/clay/skills/public-api/SKILL.md index 972c78d..49f82ec 100644 --- a/clay/skills/public-api/SKILL.md +++ b/clay/skills/public-api/SKILL.md @@ -12,8 +12,9 @@ in a shell (use the `cli` skill for those). ## What it offers - **Search** — find people or companies in Clay's GTM database using **structured filters**. Discover - valid filter fields with `GET /searches/fields?source_type=people` (or `companies`), start a search with - `POST /searches`, then page with `POST /searches/{search_id}/next`. The CLI + valid filter fields with `GET /search/filters-mode/fields?source_type=people` (or `companies`), start a + search with `POST /search/filters-mode`, then page through the results (see the API reference for the + exact pagination route). The CLI equivalent is `clay search` — see the `search` skill. Prefer the CLI for one-off searches - **Tables** — structured queries against Clay tables. - **Routines / batches** — async routine and batch runs. @@ -28,10 +29,18 @@ clay api-keys create --name "" # → { ..., "apiKey": "" } ``` CLI-created keys are always scoped to the public API. The `apiKey` secret is returned -**only once**, at creation — store it immediately; it can't be retrieved later. Send it -as a Bearer token against `https://api.clay.com/public/v0`. Manage existing keys with +**only once**, at creation — store it immediately; it can't be retrieved later. Send it in the +`clay-api-key` request header against `https://api.clay.com/public/v0` — **not** as a `Bearer` +token (a `Bearer` header returns 401). Manage existing keys with `clay api-keys list | update | delete`. +Smoke-test the key: + +```bash +curl -H "clay-api-key: $CLAY_API_KEY" https://api.clay.com/public/v0/me +# → { "user": {...}, "workspace": {...} } +``` + ## Reference Full developer documentation — Public API reference, CLI reference, concepts, and the