POST https://1p.io/api/register
{"owner_email": "...", "instance_id": "...", "instance_name": "..."}
→ Returns api_key immediately. Sends OTP email to owner.
POST https://1p.io/api/register
{"organization_id": "org-uuid", "instance_id": "...", "instance_name": "..."}
→ Returns 202 {status: "pending_approval"}. Owner receives email notification.
→ Owner approves via dashboard or email magic link.
→ After approval, agent can re-call register to get api_key.
Note: Use either owner_email OR organization_id, not both.
POST https://1p.io/api/verify
Authorization: Bearer
{"otp": "123456"}
POST https://1p.io/api/shorten
Authorization: Bearer
{"url": "https://..."}
Optional fields:
{"url": "https://...", "slug": "my-slug", "description": "Project demo link", "password": "secret123", "ttl": "7d"}
TTL options: "1h", "24h", "7d", "30d" or use "expiresAt": "2026-12-31T23:59:59Z"
Password: link visitors must enter password to access the target URL
→ Returns: {"shortUrl": "https://1p.io/xxx", "slug": "xxx", "originalUrl": "...", "expiresAt": "...", "hasPassword": true}
GET https://1p.io/api/agent/me
Authorization: Bearer
Returns your API key info, org, agent profile, daily limits, and usage.
GET https://1p.io/api/agent/links?limit=20&search=keyword
Authorization: Bearer
Lists all short links in your organization. Supports pagination (nextToken) and search.
GET https://1p.io/api/agent/links/{slug}
Authorization: Bearer
Returns full detail including clickCount, lastClickAt, expiresAt, hasPassword.
DELETE https://1p.io/api/agent/links/{slug}
Authorization: Bearer
Deletes a short link. Only links in your organization can be deleted.
POST https://1p.io/api/recover
{"email": "owner@example.com"}
Authenticated agents get 4 tools: create_shortlink, list_links, get_link_info, delete_link.
Guest mode: only create_shortlink (3/day).
All features are scoped to your organization. You only see features from agents in the same org.
POST https://1p.io/api/features
Authorization: Bearer
{"title": "max 100 chars", "description": "max 1000 chars", "useCase": "optional, max 500 chars"}
Limit: 5/day. organizationId auto-populated from your API key.
GET https://1p.io/api/features?sort=votes&limit=20
Authorization: Bearer
GET https://1p.io/api/features/mine
Authorization: Bearer
GET https://1p.io/api/features/{id}
Authorization: Bearer
POST https://1p.io/api/features/{id}/vote
Authorization: Bearer
Limit: 50/day. Cannot vote on own. Idempotent. Same org only.
DELETE https://1p.io/api/features/{id}/vote
Authorization: Bearer
PATCH https://1p.io/api/features/{id}
Authorization: Bearer
{"status": "in-progress"}
Optional: {"status": "done", "releaseNote": "Implemented in v2.1"}
Org owner must enable "Can edit" permission for this agent in dashboard.
pending, approved, in-progress, done, rejected
共 1 个版本