Agent Profile
Manage the authenticated agent's profile, stats, and lifecycle.
---
GET /me
GET /me | Auth: Required
Retrieve the current agent's profile and usage statistics.
Request
No parameters required.
Response
Status: 200 OK#### Fields
| Field | Type | Description | |
|---|---|---|---|
success | boolean | Always true. | |
agent.id | string (UUID) | Unique agent identifier. | |
agent.name | string | Agent name. | |
agent.description | string \ | null | Agent description. |
agent.rate_limit_tier | string | Current rate limit tier (e.g., "standard", "premium"). | |
agent.stats.total_requests | number | Total API requests made. | |
agent.stats.total_swaps | number | Total swap transactions executed. | |
agent.created_at | string (ISO 8601) | Registration timestamp. | |
agent.last_active_at | string (ISO 8601) | Timestamp of last API request. |
#### Example
{
"hl-key">"success": true,
"hl-key">"agent": {
"hl-key">"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"hl-key">"name": "my-trading-bot",
"hl-key">"description": "Automated portfolio rebalancer for DeFi positions",
"hl-key">"rate_limit_tier": "standard",
"hl-key">"stats": {
"hl-key">"total_requests": 14832,
"hl-key">"total_swaps": 247
},
"hl-key">"created_at": "2026-01-15T08:30:00Z",
"hl-key">"last_active_at": "2026-03-07T14:22:10Z"
}
}
Errors
| Status | Error | Description |
|---|---|---|
| 401 | "Invalid or missing API key" | The API key is missing, malformed, or revoked. |
Code Examples
#### curl
-kw">curl https://api.suwappu.bot/v1/agent/me \
-H -str">"Authorization: Bearer suwappu_sk_your_api_key"
#### Python
import requests
response = requests.get(
class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/me",
headers={class="hl-str">"Authorization": class="hl-str">"Bearer suwappu_sk_your_api_key"},
)
agent = response.json()[class="hl-str">"agent"]
print(fclass="hl-str">"Total swaps: {agent[class="hl-str">'stats'][class="hl-str">'total_swaps']}")
#### TypeScript
const response = await fetch(class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/me", {
headers: { Authorization: class="hl-str">"Bearer suwappu_sk_your_api_key" },
});
const { agent } = await response.json();
console.log(Total swaps: ${agent.stats.total_swaps});
---
PATCH /me
PATCH /me | Auth: Required
Update the authenticated agent's profile. At least one field must be provided.
Request
#### Body
| Field | Type | Required | Description | |
|---|---|---|---|---|
description | string | No | Updated description. Max 500 characters. | |
callback_url | string (URI) \ | null | No | Updated webhook URL. Set to null to remove. |
metadata | object | No | Updated metadata. Replaces existing metadata entirely. |
At least one field must be provided.
#### Example
{
"hl-key">"description": "Updated portfolio rebalancer v2.0",
"hl-key">"callback_url": "https://example.com/webhooks/suwappu/v2",
"hl-key">"metadata": {
"hl-key">"version": "2.0.0",
"hl-key">"environment": "production"
}
}
Response
Status: 200 OKReturns the full updated agent profile (same shape as GET /me).
#### Example
{
"hl-key">"success": true,
"hl-key">"agent": {
"hl-key">"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"hl-key">"name": "my-trading-bot",
"hl-key">"description": "Updated portfolio rebalancer v2.0",
"hl-key">"rate_limit_tier": "standard",
"hl-key">"stats": {
"hl-key">"total_requests": 14833,
"hl-key">"total_swaps": 247
},
"hl-key">"created_at": "2026-01-15T08:30:00Z",
"hl-key">"last_active_at": "2026-03-07T14:25:00Z"
}
}
Errors
| Status | Error | Description |
|---|---|---|
| 400 | "At least one field must be provided" | The request body is empty or contains no updatable fields. |
| 400 | "Validation failed" | One or more fields failed validation. Check the fields object. |
| 401 | "Invalid or missing API key" | The API key is missing, malformed, or revoked. |
Code Examples
#### curl
-kw">curl -X PATCH https://api.suwappu.bot/v1/agent/me \
-H -str">"Authorization: Bearer suwappu_sk_your_api_key" \
-H -str">"Content-Type: application/json" \
-d -str">'{-str">"description": -str">"Updated portfolio rebalancer v2.0"}'
#### Python
import requests
response = requests.patch(
class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/me",
headers={class="hl-str">"Authorization": class="hl-str">"Bearer suwappu_sk_your_api_key"},
json={class="hl-str">"description": class="hl-str">"Updated portfolio rebalancer v2.0"},
)
agent = response.json()[class="hl-str">"agent"]
#### TypeScript
const response = await fetch(class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/me", {
method: class="hl-str">"PATCH",
headers: {
Authorization: class="hl-str">"Bearer suwappu_sk_your_api_key",
class="hl-str">"Content-Type": class="hl-str">"application/json",
},
body: JSON.stringify({ description: class="hl-str">"Updated portfolio rebalancer v2.0" }),
});
const { agent } = await response.json();
---
DELETE /me
DELETE /me | Auth: Required
Permanently delete the authenticated agent and all associated data. This action is irreversible.
Request
No parameters required.
Response
Status: 204 No ContentNo response body.
Errors
| Status | Error | Description |
|---|---|---|
| 401 | "Invalid or missing API key" | The API key is missing, malformed, or revoked. |
Code Examples
#### curl
-kw">curl -X DELETE https://api.suwappu.bot/v1/agent/me \
-H -str">"Authorization: Bearer suwappu_sk_your_api_key"
#### Python
import requests
response = requests.delete(
class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/me",
headers={class="hl-str">"Authorization": class="hl-str">"Bearer suwappu_sk_your_api_key"},
)
assert response.status_code == 204
#### TypeScript
const response = await fetch(class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/me", {
method: class="hl-str">"DELETE",
headers: { Authorization: class="hl-str">"Bearer suwappu_sk_your_api_key" },
});
console.log(response.status); class=class="hl-str">"hl-comment">// 204
---
POST /me/deactivate
POST /me/deactivate | Auth: Required
Temporarily deactivate the agent. The agent's data is preserved, but the API key will stop working for all other endpoints until reactivated. Use this instead of deletion when you want to pause operations.
Request
No parameters required.
Response
Status: 200 OK#### Example
{
"hl-key">"success": true,
"hl-key">"message": "Agent deactivated. Use POST /reactivate to restore access.",
"hl-key">"agent": {
"hl-key">"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"hl-key">"name": "my-trading-bot",
"hl-key">"status": "deactivated",
"hl-key">"deactivated_at": "2026-03-07T14:30:00Z"
}
}
Errors
| Status | Error | Description |
|---|---|---|
| 401 | "Invalid or missing API key" | The API key is missing, malformed, or revoked. |
| 409 | "Agent is already deactivated" | The agent is already in a deactivated state. |
Code Examples
#### curl
-kw">curl -X POST https://api.suwappu.bot/v1/agent/me/deactivate \
-H -str">"Authorization: Bearer suwappu_sk_your_api_key"
#### Python
import requests
response = requests.post(
class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/me/deactivate",
headers={class="hl-str">"Authorization": class="hl-str">"Bearer suwappu_sk_your_api_key"},
)
print(response.json()[class="hl-str">"message"])
#### TypeScript
const response = await fetch(
class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/me/deactivate",
{
method: class="hl-str">"POST",
headers: { Authorization: class="hl-str">"Bearer suwappu_sk_your_api_key" },
}
);
const data = await response.json();
console.log(data.message);
---
POST /reactivate
POST /reactivate | Auth: Required
Reactivate a previously deactivated agent. The same API key resumes working for all endpoints.
Request
No parameters required.
Response
Status: 200 OK#### Example
{
"hl-key">"success": true,
"hl-key">"message": "Agent reactivated successfully.",
"hl-key">"agent": {
"hl-key">"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"hl-key">"name": "my-trading-bot",
"hl-key">"status": "active",
"hl-key">"reactivated_at": "2026-03-07T15:00:00Z"
}
}
Errors
| Status | Error | Description |
|---|---|---|
| 401 | "Invalid or missing API key" | The API key is missing, malformed, or revoked. |
| 409 | "Agent is already active" | The agent is not in a deactivated state. |
Code Examples
#### curl
-kw">curl -X POST https://api.suwappu.bot/v1/agent/reactivate \
-H -str">"Authorization: Bearer suwappu_sk_your_api_key"
#### Python
import requests
response = requests.post(
class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/reactivate",
headers={class="hl-str">"Authorization": class="hl-str">"Bearer suwappu_sk_your_api_key"},
)
print(response.json()[class="hl-str">"message"])
#### TypeScript
const response = await fetch(
class="hl-str">"https:class="hl-commentclass="hl-str">">//api.suwappu.bot/v1/agent/reactivate",
{
method: class="hl-str">"POST",
headers: { Authorization: class="hl-str">"Bearer suwappu_sk_your_api_key" },
}
);
const data = await response.json();
console.log(data.message);