Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from bundle
Operational SendPulse skill with live-verified REST, MCP handshake, and MCP tool-call tests.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
SKILL.md
1---2name: sendpulse-agent-api3description: "Use when the task involves SendPulse integrations, MCP setup, REST API usage, auth selection between API key and OAuth, OpenAPI/documentation updates, or proposing improvements to SendPulse's API developer experience for agent-friendly workflows."4---56# SendPulse Agent API78Use this skill to work with SendPulse as an API-first, agent-friendly platform.9Favor flows that help AI agents and developers act through SendPulse with minimal friction.1011## Official Source of Truth1213Use these pages first instead of guessing:1415- REST API docs and auth: `https://sendpulse.com/integrations/api`16- MCP setup guide: `https://sendpulse.com/knowledge-base/account-settings/mcp-server`17- MCP tools list: `https://sendpulse.com/knowledge-base/account-settings/mcp-tools`18- MCP product page: `https://sendpulse.com/features/mcp`1920If a public OpenAPI spec URL is not explicitly available, treat the REST API docs page as the current public source of truth.2122## Start by Classifying the Request2324Put the task into one of these buckets:25261. MCP integration272. Direct REST API integration283. Authentication choice or migration294. OpenAPI or developer docs update305. Product/API UX improvement proposal3132Do not mix all five at once.33Solve the primary path first.3435## Choose the Integration Surface First, Then Choose Auth3637Do this in order:38391. Decide whether the task is MCP or direct REST API.402. For REST API tasks, choose API key vs OAuth.413. For MCP tasks, follow the client-specific auth flow from the MCP docs.4243Do not assume MCP auth works the same way as REST auth.4445## Prefer the Right Surface4647### Use MCP when4849- the user wants AI assistants to operate SendPulse directly50- the workflow is prompt-driven and tool-based51- the goal is to connect OpenAI, Claude, Cursor, or another MCP client52- the request is about account actions, campaign operations, CRM/chatbot tasks, or agent workflows5354### Use direct REST API when5556- the integration is backend-to-backend57- the caller wants deterministic API contracts58- the task is SDK, webhook, OpenAPI, or endpoint-level work59- the integration should run without an MCP client in the middle6061If both are viable, treat MCP as the fastest path for agent workflows and REST API as the canonical integration surface.6263For connection and auth details, read `references/auth-and-connection.md`.6465## MCP Auth Is Client-Specific6667Do not describe MCP auth as only "API key vs OAuth."6869Use the official MCP setup guide and follow the client flow:7071- OpenAI: add the MCP server URL and use custom headers `X-SP-ID` and `X-SP-SECRET`72- Cursor: add the MCP server URL in config, then complete the browser authorization flow when prompted7374Official MCP server URL:75`https://mcp.sendpulse.com/mcp`7677## REST API Auth7879Use the REST API docs for exact auth behavior:80`https://sendpulse.com/integrations/api`8182REST supports:8384- API key: static long-lived credential, sent as `Authorization: Bearer <api_key>`85- OAuth 2.0 client credentials: obtain token from `POST https://api.sendpulse.com/oauth/access_token`, then send it as `Authorization: Bearer <access_token>`8687### Prefer API key when8889- the integration is simple and long-lived90- the user wants fewer moving parts91- token refresh logic adds unnecessary complexity92- the goal is fast setup for internal tools, prototypes, or agent connections9394### Prefer OAuth when9596- temporary credentials are required97- the integration already expects token lifecycle management98- security policy prefers short-lived access tokens99- the task is specifically about OAuth client credentials or app-market authorization flows100101Frame the trade-off clearly:102103- API key = simpler setup, persistent secret, fast adoption104- OAuth = more moving parts, short-lived tokens, cleaner temporary access model105106## First Successful Request107108For REST API work:1091101. Authenticate.1112. Send a safe read-only request to `GET https://api.sendpulse.com/user/info`.1123. Only after that, continue to the requested endpoint.113114For MCP work:1151161. Connect the MCP server in the target client.1172. Verify the available tools in the client or in the official tools list.1183. Run one harmless read-only request first, such as account info or bot listing.1194. Only then allow write actions.120121## Real-Task Workflow122123When handling a SendPulse request:1241251. Classify the task: MCP, REST, auth, docs, or product/DX.1262. Open the relevant official doc page.1273. Pick the auth method explicitly.1284. Verify with one safe read-only action.1295. Execute the requested task.1306. If the task is docs/DX-related, cite the exact official page being improved.131132## Direct REST Scripts133134Use these bundled scripts for direct REST work:135136- `scripts/rest_api_key_smoke.sh` — smoke test with API key against `/user/info`137- `scripts/rest_oauth_smoke.sh` — get OAuth token, then smoke test `/user/info`138- `scripts/rest_request.sh` — generic REST request helper with Bearer auth139- `scripts/mcp_handshake_test.py` — raw MCP auth/initialize/tools-list verification140141Read the script first if you need to adapt arguments or environment variables.142Default to dry-run before using real credentials.143144Current validation status:145146- `rest_api_key_smoke.sh` — syntax-checked, dry-run tested, and live-verified against `/user/info`147- `rest_request.sh` — syntax-checked, dry-run tested, and live-verified against `/user/info`148- `rest_oauth_smoke.sh` — syntax-checked and dry-run tested; live OAuth verification still requires `client_id` + `client_secret`149- `mcp_handshake_test.py` — live-verified with SendPulse MCP auth, `initialize`, `notifications/initialized`, and `tools/list`150- `mcp_call_tool.py` — live-verified for raw MCP `tools/call`; confirmed with safe read-only calls `chatbots_account_show` and `chatbots_bots_list`151152## Important Ambiguity to Resolve Explicitly153154The public docs currently show different credential patterns across surfaces:155156- REST API key bearer auth157- REST OAuth client credentials158- MCP OpenAI custom headers: `X-SP-ID` / `X-SP-SECRET`159- MCP Cursor browser authorization160161Do not collapse these into one generic auth explanation.162Name the exact flow for the target client or integration.163164## Documentation and OpenAPI Work165166When updating docs or drafting improvements:167168- optimize for discoverability first169- show the happy path before advanced variants170- keep auth examples parallel: API key and OAuth side by side171- include copy-paste request examples172- name the right endpoint, headers, and token/key location clearly173- separate MCP setup docs from raw REST API docs so users do not confuse them174- treat OpenAPI as a product surface, not just a reference dump175176A good SendPulse API doc should answer, in order:1771781. What can I do?1792. Which surface should I use: MCP or REST?1803. How do I authenticate?1814. What is the first successful request?1825. What are the common failure modes?183184For product framing and likely improvement directions, read `references/product-direction.md`.185186## Product and DX Framing187188When proposing improvements, bias toward agent usability and lower setup friction.189Strong directions include:190191- fewer steps from account to first successful API call192- side-by-side examples for API key and OAuth193- clearer MCP onboarding for OpenAI/Claude/Cursor194- better OpenAPI coverage and examples195- endpoint naming and parameter docs that work well for both humans and agents196- predictable error handling and explicit rate-limit guidance197198Treat inter-agent communication as a first-class product direction.199If a design choice makes API usage easier for agents without hurting normal developers, prefer it.200201## Deliverables202203When answering, tailor the output to the task:204205- setup task -> return exact connection/auth steps206- integration task -> return endpoint flow, headers, and example requests207- docs task -> return a proposed doc structure or rewritten section208- product task -> return concrete DX improvements prioritized by impact and implementation effort209210Keep the answer practical.211Prefer one recommended path and one fallback.212