API Reference › Basics

Agent access

An agent gets its key by asking for one. The key exists at once, but until the person approves it, it can only ask whether it has been approved. Approval happens in the app, so the key never travels in a link: the approval link carries only the request's ID. With the person's email address in the request, Ported.io emails them that link, which signs them in (or creates their account) so approving is their only step.

The entry link

GET https://app.ported.io/agents

Needs no key. It describes Ported.io, what an agent can do and the exact request to make. It says nothing about any account.

Response
HTTP/1.1 200 OK
Content-Type: application/json

{
  "name": "Ported.io",
  "about": "Ported.io sells domains for the people who own them. The owner points a domain's nameservers at Ported.io, and the domain shows a for sale page where buyers buy it at a set price, make offers or lease it to own. Buyers pay by bank through Stripe, and the owner is paid once they've handed the domain to Ported.io.",
  "youCan": [
    "List the person's domains for sale, set their prices and lease terms, pause and remove them.",
    "Point a listed domain at Ported.io: change its nameservers at its registrar, with your own access there, or add a few DNS records where its DNS is hosted.",
    "Keep the domain's other DNS records, such as its email, working when its nameservers change.",
    "Read offers and answer them. Accepting an offer starts a sale.",
    "Follow each sale and lease, and tell the person when they need to act. Setting up payouts and handing a sold domain over happen in the app."
  ],
  "access": {
    "request": {
      "method": "POST",
      "url": "https://app.ported.io/api/v1/access-requests",
      "body": { "agentName": "A name the person will recognise", "email": "The person's email address", "permissions": ["listings", "offers"] }
    },
    "permissions": {
      "read": "Always included. Read listings, offers, sales, leases, the account and the inbox.",
      "listings": "List, change, pause, check and remove domains, and change the DNS records Ported.io keeps for them.",
      "offers": "Answer offers. Accepting one starts a sale."
    },
    "untilApproved": "The new key can only call GET https://app.ported.io/api/v1/key, which says whether the person approved it. A request nobody approves expires after 1 hour.",
    "approval": "With email, Ported.io emails the person a link that signs them in, or creates their account, and opens the approval page. Without it, give the person approvalUrl, which asks them to sign in first. Either way they can untick permissions before approving.",
    "lifetime": "An approved key works until the date the person chooses when they approve it, or never stops if they choose none. GET https://app.ported.io/api/v1/key shows it as expiresAt. The person can revoke it in Settings at any time."
  },
  "skill": {
    "instruction": "If you can save skills or notes, save one with what follows, so \"sell my domains on Ported.io\" works next time without this link. Keep the key itself in your secret storage, outside the skill.",
    "name": "ported-io",
    "description": "List the person's domains for sale on Ported.io and answer offers on them.",
    "entry": "https://app.ported.io/agents",
    "steps": [
      "With a saved key, call GET https://app.ported.io/api/v1/key and follow its next steps.",
      "Without a key, or when it stops working, call POST https://app.ported.io/api/v1/access-requests with the person's email, and tell them to approve from their email.",
      "In every response, follow next in order."
    ]
  },
  "docs": "https://app.ported.io/docs/api",
  "next": [
    {
      "do": "call",
      "call": "POST https://app.ported.io/api/v1/access-requests",
      "body": { "agentName": "Acme Holdings agent", "email": "dana@acme-holdings.com", "permissions": ["listings", "offers"] },
      "why": "Ask only for what the person wants you to do. read is always included. Ask the person for their email address if you don't know it."
    }
  ]
}

Ask for a key

POST /api/v1/access-requests no key

FieldTypeNotes
agentNamestring, 1 to 60 charactersShown to the person on the approval page and in Settings, Agents.
emailstringOptional, and best. The person's email address. Ported.io emails it a link that opens the approval page signed in, and approving creates the account when the address has none. Left out, the person signs in on the approval page first.
permissionsarray of listings, offersOptional. Left out or empty, the key asks for read only. read is always included and may be listed.

Without email, emailSentTo is null and the step says: "Open this link to let me work on your Ported.io listings. If you're new to Ported.io, it creates your account first: https://app.ported.io/approve/9f3c1a7e5b2d48c6a0e4f81b3d7c2a95"

requestExpiresAt is when the request expires if nobody approves it, an hour after it was made. expiresAt is when the key itself stops working: null until the person approves it and chooses a date, and null after that when they choose none.

Anyone can ask, so the endpoint is limited per IP address and per email address (§12), the key can't be guessed, the request expires after an hour and only the person can approve it. The email names the agent, says what it asked for and tells anyone who didn't ask to ignore it.

Request
POST /api/v1/access-requests
Content-Type: application/json

{ "agentName": "Acme Holdings agent", "email": "dana@acme-holdings.com", "permissions": ["listings", "offers"] }
Response
HTTP/1.1 201 Created

{
  "key": "pt_key_4fQ9zK2mVt7Lr8XcB1nW6pHs3dYj0aEu",
  "keyId": "ak_7Hq2Ld",
  "kind": "agent",
  "name": "Acme Holdings agent",
  "status": "pending",
  "permissions": ["read", "listings", "offers"],
  "approvalUrl": "https://app.ported.io/approve/9f3c1a7e5b2d48c6a0e4f81b3d7c2a95",
  "emailSentTo": "dana@acme-holdings.com",
  "requestExpiresAt": "2026-11-03T11:02:11Z",
  "expiresAt": null,
  "next": [
    { "do": "storeKey", "why": "Ported.io shows this key only once. Keep it in your secret storage, and never put it in a message or a link." },
    { "do": "tellPerson", "say": "Ported.io emailed you at dana@acme-holdings.com. Click Review and approve in that email to let me work on your Ported.io listings. If it doesn't arrive, open this link instead: https://app.ported.io/approve/9f3c1a7e5b2d48c6a0e4f81b3d7c2a95" },
    { "do": "endTurn", "why": "The person approves in their browser. Wait for them to say they have." },
    { "do": "call", "call": "GET /api/v1/key", "when": "After the person says they approved." }
  ]
}

Waiting for approval

GET /api/v1/key any key

Describes the key that calls it. It's the only call a pending key can make. Every other endpoint answers a pending key with KEY_PENDING (§11).

Response while pending
HTTP/1.1 200 OK

{
  "keyId": "ak_7Hq2Ld",
  "kind": "agent",
  "name": "Acme Holdings agent",
  "status": "pending",
  "permissions": ["read", "listings", "offers"],
  "approvalUrl": "https://app.ported.io/approve/9f3c1a7e5b2d48c6a0e4f81b3d7c2a95",
  "requestExpiresAt": "2026-11-03T11:02:11Z",
  "expiresAt": null,
  "next": [
    { "do": "tellPerson", "say": "I'm still waiting for your approval. Open this link to let me work on your Ported.io listings: https://app.ported.io/approve/9f3c1a7e5b2d48c6a0e4f81b3d7c2a95" },
    { "do": "endTurn", "why": "Call GET /api/v1/key again after the person says they approved." }
  ]
}

Approved

The same key is now active, with the permissions the person left ticked and the expiry they chose. They may have unticked some, so read permissions here. expiresAt is when the key stops working, the end of the last day the person chose in US Eastern time (here Mar 3, 2027), or null when it never expires.

Response once approved
HTTP/1.1 200 OK

{
  "keyId": "ak_7Hq2Ld",
  "kind": "agent",
  "name": "Acme Holdings agent",
  "status": "active",
  "account": { "email": "dana@acme-holdings.com" },
  "permissions": ["read", "listings", "offers"],
  "approvedAt": "2026-11-03T10:04:40Z",
  "lastUsedAt": "2026-11-03T10:04:52Z",
  "expiresAt": "2027-03-04T05:00:00Z",
  "next": [
    {
      "do": "saveSkill",
      "skill": {
        "name": "ported-io",
        "description": "List the person's domains for sale on Ported.io and answer offers on them.",
        "entry": "https://app.ported.io/agents",
        "steps": [
          "With a saved key, call GET https://app.ported.io/api/v1/key and follow its next steps.",
          "Without a key, or when it stops working, call POST https://app.ported.io/api/v1/access-requests with the person's email, and tell them to approve from their email.",
          "In every response, follow next in order."
        ]
      },
      "why": "So \"sell my domains on Ported.io\" works next time without the link. Keep the key in your secret storage, outside the skill."
    },
    { "do": "call", "call": "GET /api/v1/inbox", "why": "Shows what is waiting on the person." },
    { "do": "call", "call": "PUT /api/v1/listings/{domain}", "body": { "mode": "both", "price": 2400, "minOffer": 1000 }, "when": "To list a domain the person names, with the terms they choose." }
  ]
}

What the person sees

The approval link opens https://app.ported.io/approve/{requestId} in the app. From the email Ported.io sent, the browser is signed in as that address, and for an address without an account the page says approving creates it. Opened any other way while signed out, it asks for an email and a code first, and a new email creates the account. The page names the agent and when it asked, and lists See everything (your listings, offers, sales and leases, always on), List domains and Answer offers, ticked as requested. The person can untick either, and choose when the key expires (it never expires unless they pick a date), before choosing Approve or Deny. A request already answered or expired says so, and has no buttons.

When a key stops working

A denied, expired or revoked key answers every call with 401 and one of KEY_DENIED, KEY_REQUEST_EXPIRED, KEY_REVOKED or KEY_EXPIRED. Each error's next says how to ask again (§11).