Vigiar
1
0
Derivar
Você já tinha feito uma derivação do repositório agent-skills, anteriormente
0
agent-skills/skills/sms-center/SKILL.md
2026-11-28 15:28:00 +02:00

6,3 KiB


name: sms-center description: Send SMS through the Interweb Angola SMS Center API: single and batch messages, scheduled sending, one-time verification codes (OTP), sender IDs, templates, contacts and groups, delivery webhook, opt-outs, balance and statistics. Use when the user wants their application to send SMS, add phone verification, request a sender name or check the SMS balance.

Interweb Angola SMS Center

Use this skill to send SMS to mobile numbers from an application or a script.

Setup

  • API address: https://api.interweb.ao/v1. It is fixed for Interweb Angola: never ask the user for another address.
  • API key: always read it from the INTERWEB_API_KEY environment variable. Check it without printing it: test -n "$INTERWEB_API_KEY" && echo set || echo missing
  • If it is missing, ask the user to create a key in the API Center (https://www.meu.interweb.ao/api-center.php) with sms:read (and sms:write to send and change), then to run export INTERWEB_API_KEY="sandbox_..." and restart Claude Code (or the editor).
  • sandbox_ keys read the real account but only simulate writes and never charge. prod_ keys change the account and can charge. GET /v1/token gives the mode in data.mode and the permissions in data.permissions. Suggest a sandbox_ key for a first try.
  • Never print, log or commit the key, and never put it in code that runs in a browser or a mobile app. In code, read it from the environment.

Every request looks like this:

curl -sS "https://api.interweb.ao/v1/PATH" -H "Authorization: Bearer $INTERWEB_API_KEY" -H "Accept: application/json"

Rules

  • Before anything that charges, deletes data or cannot be undone, tell the user exactly what will happen (with the price, when the API gives one) and wait for a clear yes.
  • Send an Idempotency-Key header on purchases, sends and other POST requests that accept it, and reuse the same value if you retry the same request: IDEM=$(uuidgen 2>/dev/null || cat /proc/sys/kernel/random/uuid).
  • Lists come in pages: ?page=1&per_page=100, and meta.total_pages says how many there are.
  • Long operations answer 202 with an action_id. Follow them with GET /v1/actions/{action_id} every 10 to 20 seconds until status is done or failed.
  • Answer the user in the language they write in, and show amounts with the currency the API returns.

Before sending

  • SMS must be active on the account. Otherwise the API answers 403 with sms_not_active: the user turns it on in the SMS Center, in Meu Interweb.
  • With a sandbox_ key nothing is sent and no credits are used. With a prod_ key every message uses SMS credits.

Send one SMS

curl -sS -X POST "https://api.interweb.ao/v1/sms/messages" -H "Authorization: Bearer $INTERWEB_API_KEY" \
  -H "Content-Type: application/json" -H "Idempotency-Key: $IDEM" \
  -d '{"number": "+244923123456", "text": "Your order is ready."}'
  • number works with or without the country code and with spaces. An invalid number answers 422 with details.reason invalid_number.
  • sender is optional: without it the free sender is used (the first in GET /v1/sms/senders, with free: true). Only approved senders work.
  • Without send_at the answer has the real status: sent, failed or queued.
  • send_at (ISO 8601 with time zone, for example 2026-12-01T09:00:00+01:00, at most 365 days ahead) schedules; cancel with POST /v1/sms/messages/{id}/cancel.
  • Batch: POST /v1/sms/messages/batch with {"text": "...", "messages": [{"number": "..."}, {"number": "...", "text": "own text"}]}.
  • Before a large send with a prod_ key, check GET /v1/sms/balance, say how many messages will go and ask.

Verification codes (OTP)

curl -sS -X POST "https://api.interweb.ao/v1/sms/otp" -H "Authorization: Bearer $INTERWEB_API_KEY" \
  -H "Content-Type: application/json" -H "Idempotency-Key: $IDEM" \
  -d '{"number": "+244923123456", "length": 6, "expires_in": 5}'
curl -sS -X POST "https://api.interweb.ao/v1/sms/otp/OTP_ID/verify" -H "Authorization: Bearer $INTERWEB_API_KEY" \
  -H "Content-Type: application/json" -d '{"code": "482913"}'
  • Keep the otp_... id on the server, never in the browser. Resend with POST /v1/sms/otp/{id}/resend, cancel with POST /v1/sms/otp/{id}/cancel.
  • text is optional and must contain {code} once (and may contain {minutes}).
  • Default rules: GET or PUT /v1/sms/otp-settings.

Senders, templates and contacts

  • New sender name: POST /v1/sms/senders with sender, entity, country (the country code, such as AO), tax_id, purpose and sample. Approval takes time; follow it with GET /v1/sms/senders/{sender}. Ask the user for the real company data, never invent it.
  • Templates: /v1/sms/templates. Contacts and groups: /v1/sms/contacts and /v1/sms/groups.
  • Opt-outs: GET or POST /v1/sms/opt-outs. Never send marketing to numbers on that list.
  • Delivery webhook: PUT /v1/sms/webhook, test with POST /v1/sms/webhook/test.

Balance and statistics

GET /v1/sms/balance, GET /v1/sms/stats and GET /v1/sms/messages. More credits: GET /v1/sms/credits/prices, then POST /v1/sms/credits/purchase (charges credit, ask first).

Errors

Errors look like {"error": {"code", "message", "correlation_id", "details"}}. Act on code, never on the text of message.

HTTP code What to do
401 unauthorized The key is missing, wrong or revoked. Ask the user to check INTERWEB_API_KEY.
402 insufficient_credit Not enough account credit, and nothing was charged. Give the user details.add_funds_url.
403 insufficient_scope The key lacks a permission. Name it and ask for a key that has it.
403 spending_limit_exceeded The purchase goes over the key spending limit. Nothing was charged.
404 not_found Wrong id, or it is not in this account.
409 conflict and others Read details.reason and explain it in plain words.
422 validation_failed Fix the field named in details and try again.
429 rate_limited Wait for the Retry-After seconds, then try once more.
5xx internal_error, upstream_error Try again later. If the user contacts support, give them the correlation_id.

More