Agent-skills motherduck-rest-api
Use when automating or advising on MotherDuck REST API control-plane workflows for service-account provisioning, supported access-token lifecycle operations, Duckling instance configuration, active account inspection, or Dive embed sessions. Do not use for SQL or data-plane query work.
install
source · Clone the upstream repo
git clone https://github.com/motherduckdb/agent-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/motherduckdb/agent-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/motherduck-skills-claude/skills/motherduck-rest-api" ~/.claude/skills/motherduckdb-agent-skills-motherduck-rest-api && rm -rf "$T"
manifest:
plugins/motherduck-skills-claude/skills/motherduck-rest-api/SKILL.mdsource content
REST API Administration
Use this skill when the user needs to manage MotherDuck service accounts, supported token operations, Duckling configuration, active accounts, or Dive embed sessions through the REST API.
Source Of Truth
- Prefer current MotherDuck REST API documentation, the public OpenAPI spec at
, or an explicit OpenAPI spec supplied by the user.https://api.motherduck.com/docs/specs - For token scope and embed behavior, cross-check the REST API docs and the Embedded Dives docs because they include operational constraints not obvious from the raw schema.
- If the MotherDuck MCP
feature is available, use it to check whether public REST API guidance has changed.ask_docs_question - Treat endpoint availability, preview status, token fields, and role requirements as current only when backed by the supplied spec or current docs.
Default Posture
- Treat the REST API as the control plane. Use
for SQL and data-plane work.motherduck-query - Use
as the base URL unless the user provides another environment.https://api.motherduck.com - Authenticate with
and keep admin read-write tokens in backend-managed secrets.Authorization: Bearer ${MOTHERDUCK_ADMIN_TOKEN} - Never use read-scaling tokens for REST API administration.
- Treat
as service-account creation unless current docs explicitly broaden the API.POST /v1/users - Assume active-account, Duckling configuration, service-account creation, service-account token creation, and Dive embed-session endpoints require an organization admin bearer token unless current docs say otherwise.
- Never expose generated access tokens in logs, browser code, client bundles, or committed files.
- Confirm destructive deletes with the user. Deleting a user permanently deletes that user and all of their data.
Workflow
- Identify whether the task is service-account provisioning, token management, Duckling sizing, active-account inspection, or Dive embedding.
- Confirm the admin token location and the target
orusername
; never invent production identifiers.dive_id - Check token scope before calling token endpoints: users can create tokens for themselves, and admins can create tokens for service accounts, but admins cannot create tokens for other non-service-account members through the API.
- For Duckling config changes, read the current config first, then update both
andread_write
because theread_scaling
payload requires both.PUT - Preserve response fields that are only returned once, especially newly created token strings and embed session strings.
- Surface API errors by status and response body; do not hide
,400
,401
,403
, or404
responses behind success-shaped fallbacks.500
Open Next
for endpoint summaries, auth headers, request payloads, curl examples, validation limits, and operational gotchasreferences/REST_API_GUIDE.md
Related Skills
for connection tokens and application connection posturemotherduck-connect
for admin-token handling, service-account posture, and access-boundary questionsmotherduck-security-governance
for designing Dives before minting embed sessionsmotherduck-create-dive