motherduck-rest-api

Automates MotherDuck REST API control-plane administration for service accounts, tokens, and Duckling configuration.

Updated Oct 15, 2019
One-click install
npx skills add https://github.com/kkkaoru/dotfiles --skill motherduck-rest-api-kkkaoru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: motherduck-rest-api
Source: https://github.com/kkkaoru/dotfiles/tree/main/.agents/skills-stroage/motherduck-rest-api
Command: npx skills add https://github.com/kkkaoru/dotfiles --skill motherduck-rest-api-kkkaoru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing MotherDuck organization resources—service accounts, access tokens, Duckling instance sizing, and Dive embed sessions—requires careful use of the REST API with correct auth scopes, payload shapes, and token-handling rules that are easy to get wrong. ## Core Features & Use Cases - Service Account Provisioning: Create and delete service accounts via POST /v1/users with username validation rules and destructive-delete confirmation. - Token Lifecycle Management: Create, list, and revoke read-write and read-scaling access tokens with TTL limits and secure secret handling. - Duckling Configuration: Read and update read-write and read-scaling Duckling configs with instance sizes, flock sizes, and cooldown rules. - Dive Embed Sessions: Mint short-lived embed sessions for embedded analytics iframes. - Use Case: A platform engineer needs to provision a service account for a backend analytics app, mint a read-scaling token, and configure a 2-node read-scaling flock—this Skill walks through each authenticated curl call with validation limits and error handling. ## Quick Start Ask the assistant to create a MotherDuck service account named analytics_app and generate a read-write token for it using the REST API.

Frequently Asked Questions about motherduck-rest-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a MotherDuck service account with the REST API?

Send a POST request to /v1/users with an admin bearer token and a JSON body containing a unique username of 3-255 characters starting with a letter. The endpoint creates service accounts with the Member role; no role field is accepted.

How to create and revoke MotherDuck access tokens via API?

Create tokens with POST /v1/users/{username}/tokens, specifying name, optional ttl in seconds (300-31536000), and token_type of read_write or read_scaling. Revoke by DELETE using the token id, not the secret; the secret is only returned once at creation.

Can admins create tokens for other MotherDuck users?

Admins can create tokens for service accounts through the API, but cannot create tokens for other non-service-account members. Users can create tokens for themselves. Plan automation around this scope restriction.

Why does my MotherDuck Duckling config update return a 400 error?

A 400 like 'Invalid config for tier' means the payload exceeded plan or organization limits even if it matches the OpenAPI schema. The PUT requires both read_write and read_scaling objects, and cooldown_seconds cannot be set for pulse instances.

When should I use the MotherDuck REST API versus SQL queries?

Use the REST API only for control-plane work: service accounts, tokens, Duckling configuration, active accounts, and Dive embed sessions. Use a SQL connection for all data-plane query work; the REST API is not a query path.