Texts the user via the Surge Agents API end-to-end - provisions an account, verifies their mobile, and sends the SMS. Use whenever the user asks to be texted, SMS'd, or notified on their phone (e.g. "text me when done," "shoot me a text," "send me an SMS"), or mentions Surge / surge.app. US and Canada mobile numbers only.
---
name: surge
description: Texts the user via the Surge Agents API end-to-end - provisions an account, verifies their mobile, and sends the SMS. Use whenever the user asks to be texted, SMS'd, or notified on their phone (e.g. "text me when done," "shoot me a text," "send me an SMS"), or mentions Surge / surge.app. US and Canada mobile numbers only.
version: 0.1.1
license: MIT-0
metadata:
homepage: https://surge.app
canonical_url: https://surge.app/skills.md
updated: 2026-05-08
---
# Surge: text your human
This skill lets you (an AI agent) provision a [Surge](https://surge.app) account, verify the human's phone number, and send them an SMS - entirely via API. Base URL: `https://api.surge.app`. All requests with a body use `Content-Type: application/json`. Phone numbers are E.164 (`+18015551234`).
> **US and Canada mobile numbers only.** The demo flow rejects landlines and non-NA numbers with a 422.
The flow is three sequential API calls. Don't skip ahead - step 3 fails if step 2 hasn't run.
> **The JSON below shows request *shape*, not literal values.** Fields wrapped in `<angle brackets>` (e.g. `<email>`, `<6-digit code>`) and `{curly braces}` (e.g. `{account_id}`, `{api_key}`) are placeholders. Substitute the human's actual data and the values you got back from earlier steps - never send the placeholder strings or sample text verbatim.
## Step 1 - Create the project
Ask your human for: first name, last name, email, mobile phone number. Then pick `project.type`:
- **`direct`** - one team using Surge for itself. Default to this.
- **`platform`** - your human is *building* a product that resells SMS to its own customers (multi-tenant). Only pick this if they explicitly described that pattern.
```http
POST /agents/v0/projects
{
"user": {
"first_name": "<first name>",
"last_name": "<last name>",
"email": "<email>",
"phone_number": "<+1XXXXXXXXXX>"
},
"project": { "name": "<project name>", "type": "direct" }
}
```
Response (`201`):
```json
{
"account_id": "acct_...",
"demo_phone_number": "+1...",
"api_key": "sk_...",
"verification_id": "vfn_..."
}
```
**Store the `api_key` in an environment variable or your private memory. Never print it in the transcript or write it where the human can casually copy it. Surge will not show it again.**
This call also (a) sends the human a 6-digit SMS code (used in step 2) and (b) emails them a confirmation link to verify they own the email address. These are two different things - don't confuse them. The email is not a login link; it just confirms the address.
## Step 2 - Verify the phone number
Ask your human to read you the **6-digit code from the SMS** (not the email link). Then:
```http
POST /agents/v0/phone_verifications/{verification_id}/checks
{ "code": "<6-digit code from the SMS>" }
```
`200 {"result": "ok"}` means verified.
## Step 3 - Send the message
Use `api_key` as a Bearer token. `from` is the `demo_phone_number` from step 1; `to` is the number you just verified. **Demo accounts only deliver to verified participants - sending to anyone else will fail.**
```http
POST /accounts/{account_id}/messages
Authorization: Bearer {api_key}
{
"from": "<demo_phone_number from step 1>",
"to": "<the verified mobile number>",
"body": "<the message you want to send>"
}
```
## After you're done
Tell your human:
1. **Check email** for a confirmation link from `hq.surge.app/users/confirm/...` and click it to confirm the email address on the account.
2. The account is in **demo mode** until they add a payment method: **25 messages total**, up to **10 verified numbers**. To upgrade, send them this link and tell them to click **Billing** in the nav: <https://hq.surge.app>
## Failure modes
| Response | Meaning | Action |
| --- | --- | --- |
| `422` on `/projects` | Validation failed - bad email, non-mobile, non-NA, or missing field | Read errors, ask human for corrected info, retry |
| `429` on any `/agents/v0/...` | IP rate-limited | Wait ~1 min; don't loop |
| `422` on `/checks` | Wrong or expired code | Ask human to re-read; if expired, restart from step 1 |
| `409 {"result": "already_verified"}` | Done already | Skip to step 3 |
| `401` on `/messages` | API key missing/wrong | Check your env var; **do not echo the key to debug** |
| `422` on `/messages` | Most often: `to` isn't a verified participant | Run step 2 for that number first |
don't have the plugin yet? install it then click "run inline in claude" again.
extracted decision logic into explicit if-else branches, documented external api connections and secure key storage, added edge cases for rate limits, timeouts, expired codes, and non-mobile numbers, restructured procedure into 4 discrete steps with input-output callouts, and clarified post-send guidance as part of the core procedure.
this skill provisions a surge account, verifies the user's phone number via sms code, and sends them an sms - all via the surge agents api. use it whenever the user asks to be texted, sms'd, or notified on their phone (e.g. "text me when done," "shoot me a text," "send me an sms"), or explicitly mentions surge / surge.app. works with us and canada mobile numbers only. landlines and non-na numbers will fail at account creation.
required from user:
+18015551234, us or canada only)external connections:
https://api.surge.appcontent-type: application/json/agents/v0/ endpoints (account creation and phone verification)/accounts/{account_id}/messages (send sms), provided as bearer tokenenvironment / private storage:
api_key returned from step 1 securely. never print it in the transcript or expose it to the user. surge will not re-issue it.step 1: create the project and provision account
direct (one team using surge for itself). only choose platform if the user explicitly says they're building a product that resells sms to their own customers.https://api.surge.app/agents/v0/projects:201: account_id, demo_phone_number, api_key, verification_id. the api sends the user a 6-digit sms code to their phone and emails a confirmation link. these are separate flows.api_key in private memory immediately. do not log it or show it to the user.step 2: verify the phone number
https://api.surge.app/agents/v0/phone_verifications/{verification_id}/checks:200: {"result": "ok"} confirms the phone is verified.200 with result: ok.step 3: send the sms
https://api.surge.app/accounts/{account_id}/messages:authorization: Bearer {api_key} (use the key stored in step 1).from (demo_phone_number from step 1), to (the verified mobile number from step 2), body (the message text).200 or 201: message sent successfully.step 4: post-send guidance
hq.surge.app/users/confirm/... and click it to verify their email address on the account.https://hq.surge.app, tell them to click Billing in the nav, and add a payment method.on project type selection (step 1):
project.type to platform.project.type: direct.on step 1 response code:
201: proceed to step 2.422: validation failed (bad email, landline, non-na number, or missing field). read the error details, ask the user to correct the data, and retry the request.429: ip rate-limited. wait approximately 1 minute before retrying. do not loop or retry immediately.on step 2 response code:
200 with {"result": "ok"}: phone verified, proceed to step 3.409 with {"result": "already_verified"}: this phone was already verified in a prior run. skip step 2 and proceed directly to step 3.422: wrong code or code expired. ask the user to re-read the sms code. if they say the code expired or the sms is gone, restart from step 1 (the old verification_id is no longer valid).429: rate-limited. wait ~1 minute and retry.on step 3 response code:
200 or 201: message sent successfully. proceed to step 4.401: api key missing or wrong. check your private memory for the api_key. do not echo the key to the user or the transcript for debugging.422: validation failed on the message. most common cause: to number is not a verified participant. run step 2 for that number first, then retry step 3.429: rate-limited. wait ~1 minute and retry.on empty or missing user input:
422. inform them surge only works with us and canada mobile numbers, and ask for a different number.on network timeout or no response:
successful flow:
201 with account_id, demo_phone_number, api_key, verification_id.200 with {"result": "ok"}.200 or 201 with a message id or confirmation.api key storage:
api_key must be stored in a secure location (env var, private memory, secrets manager) and never logged, printed, or shown to the user.post-send state:
the user knows the skill worked when: