Base URLs
| Environment | URL |
|---|---|
| Portal API | https://dashboard.onswig.com |
| Paymaster API | https://api.onswig.com |
Authentication
All API requests require authentication via API key:sk_<64-hex-characters>.
Endpoints
Policies
Get Policy
Retrieve a policy by ID. Request:| Parameter | Type | Description |
|---|---|---|
policyId | string | The policy ID (CUID format) |
Wallets
Create Wallet
Create a new Swig wallet using a policy. Request:| Field | Type | Required | Description |
|---|---|---|---|
policyId | string | Yes | Policy ID to use |
network | string | Yes | "mainnet" or "devnet" |
paymasterPubkey | string | No | Paymaster public key. When provided, the paymaster signs and sends the transaction. When omitted, an unsigned transaction is returned. |
swigId | string | No | Custom Swig ID (auto-generated if omitted) |
signerId | string | No | Signer ID from the dashboard (alternative to walletAddress + walletType) |
walletAddress | string | No | Wallet public key to use as the authority (alternative to signerId). Must be provided together with walletType. |
walletType | string | No | Authority type: ED25519, ED25519_SESSION, SECP256K1, SECP256K1_SESSION, SECP256R1, or SECP256R1_SESSION (alternative to signerId). Must be provided together with walletAddress. |
maxDurationSlots | string | No | Maximum session duration in slots. Only valid for session authority types. |
You can specify the wallet authority in two ways: either by providing a
signerId from the dashboard, or by supplying a walletAddress and walletType directly. See Creating a Swig Wallet for details.| Response Field | Type | Present When | Description |
|---|---|---|---|
swigId | string | Always | Swig wallet identifier |
swigAddress | string | Always | On-chain PDA address |
signature | string | With paymaster | Transaction signature |
transaction | string | Without paymaster | Base58-encoded unsigned VersionedTransaction |
Paymaster
Sponsor Transaction
Submit a transaction for sponsorship. Request:https://api.onswig.com
Headers:
| Field | Type | Required | Description |
|---|---|---|---|
base58_encoded_transaction | string | Yes | Base58-encoded transaction |
network | string | No | "mainnet" or "devnet" |
| Field | Type | Description |
|---|---|---|
request_id | string | Unique request identifier |
signature | string | Transaction signature |
spent_by_paymaster | number | Lamports spent by paymaster |
Sign Transaction
Sign a transaction without sending. Request:https://api.onswig.com
Headers:
| Field | Type | Required | Description |
|---|---|---|---|
base58_encoded_transaction | string | Yes | Base58-encoded transaction |
network | string | No | "mainnet" or "devnet" |
Health Check
Check paymaster service health. Request:https://api.onswig.com
Response:
Data Types
Policy
AuthorityConfig
ActionConfig
WalletType
CreateWalletRequest
CreateWalletResponse
The response is a union type — the shape depends on whether a paymaster was provided.Error Responses
All errors follow this format:Rate Limits
API requests are rate-limited based on your subscription tier:| Tier | Requests/Minute |
|---|---|
| FREE | 60 |
| PRO | 300 |
| ULTRA | 600 |
| ENTERPRISE | Custom |
SDKs
Use our SDKs for easier integration:- API SDK
- Developer SDK
Next Steps
- Error Codes - Understand API errors
- SDK Examples - See the SDKs in action
- Create Wallets - Full wallet creation guide

