{"openapi":"3.1.0","info":{"title":"Searchedly agent identity","version":"searchedly.agent-trust/v1","description":"How Searchedly recognizes AI agents. Three separate facts are recorded: which software is calling\n(a declared User-Agent, or a Web Bot Auth HTTP Message Signature verified against the operator's key\ndirectory), which person it acts for (an OAuth delegation a workspace owner, admin or billing member\napproved on searchedly.com), and what authority that person gave it.\n\nAgent identity is not purchasing authority. A verified signature identifies software; it never authorizes\na transaction. Unknown agents can browse public information but cannot transact.\n\nEvery sign-up or purchase is checked against the buyer workspace's spending rules and gets one of three\noutcomes: allowed (within limits a person set ahead of time), needs_approval (a person must approve this\nexact request) or prohibited. Recurring charges and a first purchase from a merchant always need a person.\nAmounts always come from the merchant's published storefront, never from the agent.","contact":{"url":"https://searchedly.com/developers/agent-identity"}},"servers":[{"url":"https://api.searchedly.com"}],"components":{"schemas":{"Decision":{"type":"object","required":["outcome","reason","message"],"properties":{"outcome":{"enum":["allowed","needs_approval","prohibited"]},"reason":{"type":"string"},"message":{"type":"string"}}}},"securitySchemes":{"delegation":{"type":"oauth2","description":"Optional. Public clients with PKCE (S256). Client ID metadata documents or dynamic registration.","flows":{"authorizationCode":{"authorizationUrl":"https://api.searchedly.com/agent/oauth/authorize","tokenUrl":"https://api.searchedly.com/agent/oauth/token","refreshUrl":"https://api.searchedly.com/agent/oauth/token","scopes":{"commerce:browse":"Say it's acting for {org}","commerce:request":"Ask to sign up or buy for {org}"}}}}}},"paths":{"/api/v1/agent/whoami":{"get":{"operationId":"whoami","summary":"Shows how Searchedly sees the calling agent, and what it may do","description":"Send your Web Bot Auth headers (Signature, Signature-Input, Signature-Agent) and, if you have one, a delegation access token. The response never includes personal data about the delegating person.","security":[{},{"delegation":["commerce:browse"]}],"responses":{"200":{"description":"Identity and trust decisions.","content":{"application/json":{"schema":{"type":"object","required":["identity","decisions","resource"],"properties":{"resource":{"type":"string","const":"https://api.searchedly.com/api/v1/agent"},"identity":{"type":"object","properties":{"schema":{"type":"string"},"level":{"enum":["anonymous","declared","signed","delegated"]},"declared":{"type":["string","null"]},"signature":{"type":"object","properties":{"outcome":{"enum":["absent","verified","invalid","unverified"]},"reason":{"type":"string"},"agentUrl":{"type":"string"},"keyThumbprint":{"type":"string"}}},"operator":{"type":["object","null"]},"client":{"type":["object","null"]},"delegation":{"type":["object","null"]},"tokenProblem":{"type":["string","null"]}}},"decisions":{"type":"object","properties":{"browse":{"$ref":"#/components/schemas/Decision"},"transact":{"$ref":"#/components/schemas/Decision"}}}}}}}},"429":{"description":"Too many requests."}}}},"/api/v1/agent/policy/check":{"post":{"operationId":"checkPolicy","summary":"Checks a sign-up or purchase against the buyer workspace's spending rules (dry run)","description":"Tells you, before you ask, whether a request would be allowed, need a person's approval, or be refused, and exactly what a person would be approving. A check never reserves budget, signs up or buys anything. Identify the plan by the merchant's storefront slug and plan id from GET /api/v1/storefronts/{slug}; the price, fees, renewal terms and trial are read from that storefront, so you can't (and needn't) send them. Checks are recorded in the workspace's log.","security":[{"delegation":["commerce:request"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["action","merchant","planId"],"properties":{"action":{"enum":["registration","purchase"]},"merchant":{"type":"string","description":"Storefront slug, e.g. acme-crm."},"planId":{"type":"string","description":"A plan id from the merchant's storefront."},"quantity":{"type":"integer","minimum":1,"maximum":1000,"default":1}}}}}},"responses":{"200":{"description":"The decision. Unknown or undelegated agents always get prohibited.","content":{"application/json":{"schema":{"type":"object","required":["dryRun","outcome","reasons","messages","checks","grant"],"properties":{"dryRun":{"const":true},"decisionId":{"type":["string","null"]},"outcome":{"enum":["allowed","needs_approval","prohibited"]},"reasons":{"type":"array","items":{"type":"string"}},"messages":{"type":"array","items":{"type":"string"}},"checks":{"type":"array","items":{"type":"object","properties":{"rule":{"type":"string"},"result":{"enum":["pass","needs_approval","prohibited","skipped"]},"detail":{"type":"string"}}}},"grant":{"type":"object","description":"What a person would approve: plan, amount (minor units), currency, renewal, trial and fees."},"approvers":{"type":"array","items":{"enum":["owner","admin","billing"]}},"policy":{"type":"object","properties":{"version":{"type":"integer"},"sha256":{"type":"string"}}}}}}}},"400":{"description":"Invalid request (including any field other than those listed)."},"422":{"description":"The merchant or plan id isn't valid."},"429":{"description":"Too many requests."}}}},"/api/v1/agent/registration-sessions":{"post":{"operationId":"createRegistrationSession","summary":"Asks to sign the buyer workspace up for a merchant's free business plan","description":"Starts a sign-up request that a person in the buyer workspace must approve in Searchedly. Only free business plans the merchant opened to agent sign-up qualify, and only apps that identify themselves with a client ID metadata document. After approval the merchant creates the account itself and confirms; poll GET /api/v1/agent/registration-sessions/{id}. Searchedly never creates accounts or takes payment. Send an Idempotency-Key header; a retry with the same key and body returns the same request. Answers 503 registration-unavailable while agent sign-up isn't open.","security":[{"delegation":["commerce:request"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["merchant","planId"],"properties":{"merchant":{"type":"string","description":"Storefront slug, e.g. acme-crm."},"planId":{"type":"string","description":"A plan id from the merchant's storefront."},"accountName":{"type":["string","null"],"maxLength":100,"description":"Suggested account name. Defaults to the workspace name."}}}}}},"responses":{"200":{"description":"Replay of an earlier request with the same Idempotency-Key."},"201":{"description":"Waiting for a person's approval.","content":{"application/json":{"schema":{"type":"object","properties":{"registration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["pending_approval","approved","provisioned","failed","denied","expired","canceled"]},"merchant":{"type":"object"},"plan":{"type":"object"},"accountName":{"type":"string"},"approvalUrl":{"type":"string","description":"Share this with your user."},"expiresAt":{"type":"string"},"confirmBy":{"type":["string","null"]},"accountUrl":{"type":["string","null"],"description":"Once the merchant created the account."},"message":{"type":["string","null"]}}}}}}}},"400":{"description":"Invalid request or missing Idempotency-Key."},"401":{"description":"A delegation token is required."},"403":{"description":"The spending rules don't allow it (reasons and decisionId included)."},"422":{"description":"The plan can't be signed up for by an agent (reasons included)."},"429":{"description":"Too many requests."},"503":{"description":"Agent sign-up isn't open."}}}},"/api/v1/agent/registration-sessions/{id}":{"get":{"operationId":"getRegistrationSession","summary":"Shows where a sign-up request stands","security":[{"delegation":["commerce:request"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The request.","content":{"application/json":{"schema":{"type":"object","properties":{"registration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["pending_approval","approved","provisioned","failed","denied","expired","canceled"]},"merchant":{"type":"object"},"plan":{"type":"object"},"accountName":{"type":"string"},"approvalUrl":{"type":"string","description":"Share this with your user."},"expiresAt":{"type":"string"},"confirmBy":{"type":["string","null"]},"accountUrl":{"type":["string","null"],"description":"Once the merchant created the account."},"message":{"type":["string","null"]}}}}}}}},"404":{"description":"Not found, or made by another app or workspace."}}}},"/api/v1/agent/registration-sessions/{id}/cancel":{"post":{"operationId":"cancelRegistrationSession","summary":"Withdraws a request that's still waiting for approval","security":[{"delegation":["commerce:request"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Canceled.","content":{"application/json":{"schema":{"type":"object","properties":{"registration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["pending_approval","approved","provisioned","failed","denied","expired","canceled"]},"merchant":{"type":"object"},"plan":{"type":"object"},"accountName":{"type":"string"},"approvalUrl":{"type":"string","description":"Share this with your user."},"expiresAt":{"type":"string"},"confirmBy":{"type":["string","null"]},"accountUrl":{"type":["string","null"],"description":"Once the merchant created the account."},"message":{"type":["string","null"]}}}}}}}},"404":{"description":"Not found."},"409":{"description":"Already answered."}}}},"/api/v1/agent/checkout-sessions":{"post":{"operationId":"createCheckoutSession","summary":"Asks to buy one of a merchant's plans for the buyer workspace","description":"Starts a purchase request. A person in the buyer workspace reviews the exact charge in Searchedly, approves it and pays on Stripe's own payment page on the merchant's Stripe account; agents never pay, never see card details and are never approved automatically. Only business plans with one fixed price, no trial and no extra fees that the merchant opened to agent checkout qualify, and only apps that identify themselves with a client ID metadata document. The workspace's spending rules are checked when you ask and again when the person approves. Poll GET /api/v1/agent/checkout-sessions/{id}. Send an Idempotency-Key header; a retry with the same key and body returns the same request. Answers 503 checkout-unavailable while agent checkout isn't open.","security":[{"delegation":["commerce:request"]}],"parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["merchant","planId"],"properties":{"merchant":{"type":"string","description":"Storefront slug, e.g. acme-crm."},"planId":{"type":"string","description":"A plan id from the merchant's storefront."},"quantity":{"type":"integer","minimum":1,"maximum":100,"description":"Seats or units, for per-unit prices. Defaults to 1."}}}}}},"responses":{"200":{"description":"Replay of an earlier request with the same Idempotency-Key."},"201":{"description":"Waiting for a person's approval.","content":{"application/json":{"schema":{"type":"object","properties":{"checkout":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["pending_approval","approved","awaiting_payment","paid","failed","denied","expired","canceled"]},"mode":{"enum":["test","live"],"description":"test: a Stripe test-mode purchase; nothing is charged."},"merchant":{"type":"object"},"plan":{"type":"object"},"amount":{"type":"object","description":"Before tax, in the currency's smallest unit."},"approvalUrl":{"type":"string","description":"Share this with your user."},"expiresAt":{"type":"string"},"paymentExpiresAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"amountPaid":{"type":["object","null"],"description":"What Stripe charged, including tax."},"message":{"type":["string","null"]}}}}}}}},"400":{"description":"Invalid request or missing Idempotency-Key."},"401":{"description":"A delegation token is required."},"403":{"description":"The spending rules don't allow it (reasons and decisionId included)."},"422":{"description":"The plan can't be bought by an agent (reasons included)."},"429":{"description":"Too many requests."},"503":{"description":"Agent checkout isn't open."}}}},"/api/v1/agent/checkout-sessions/{id}":{"get":{"operationId":"getCheckoutSession","summary":"Shows where a purchase request stands","security":[{"delegation":["commerce:request"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The request.","content":{"application/json":{"schema":{"type":"object","properties":{"checkout":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["pending_approval","approved","awaiting_payment","paid","failed","denied","expired","canceled"]},"mode":{"enum":["test","live"],"description":"test: a Stripe test-mode purchase; nothing is charged."},"merchant":{"type":"object"},"plan":{"type":"object"},"amount":{"type":"object","description":"Before tax, in the currency's smallest unit."},"approvalUrl":{"type":"string","description":"Share this with your user."},"expiresAt":{"type":"string"},"paymentExpiresAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"amountPaid":{"type":["object","null"],"description":"What Stripe charged, including tax."},"message":{"type":["string","null"]}}}}}}}},"404":{"description":"Not found, or made by another app or workspace."}}}},"/api/v1/agent/checkout-sessions/{id}/cancel":{"post":{"operationId":"cancelCheckoutSession","summary":"Withdraws a purchase request that's still waiting for approval","security":[{"delegation":["commerce:request"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Canceled.","content":{"application/json":{"schema":{"type":"object","properties":{"checkout":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"enum":["pending_approval","approved","awaiting_payment","paid","failed","denied","expired","canceled"]},"mode":{"enum":["test","live"],"description":"test: a Stripe test-mode purchase; nothing is charged."},"merchant":{"type":"object"},"plan":{"type":"object"},"amount":{"type":"object","description":"Before tax, in the currency's smallest unit."},"approvalUrl":{"type":"string","description":"Share this with your user."},"expiresAt":{"type":"string"},"paymentExpiresAt":{"type":["string","null"]},"paidAt":{"type":["string","null"]},"amountPaid":{"type":["object","null"],"description":"What Stripe charged, including tax."},"message":{"type":["string","null"]}}}}}}}},"404":{"description":"Not found."},"409":{"description":"Already answered."}}}},"/api/v1/agent/provisioning/{id}":{"get":{"operationId":"getProvisioning","summary":"Shows whether the merchant set up the account, and any credential waiting","description":"The id comes from an approved sign-up or a paid checkout (their provisioning field). Shows what the merchant reports it set up and the credential status; never the credential itself.","security":[{"delegation":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The account setup."},"401":{"description":"Delegation token required."},"404":{"description":"Not found, or made by another app or workspace."},"503":{"description":"Agent sign-up and checkout aren't open yet."}}}},"/api/v1/agent/provisioning/{id}/credential":{"post":{"operationId":"claimCredential","summary":"Collects a credential a person released, exactly once","description":"Only after a person in the workspace released it, and only with the delegation that made the request. Searchedly deletes its copy when you collect it; store it securely. Responses are never cached.","security":[{"delegation":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"The credential: type, header, value, scopes, expiresAt, docsUrl."},"403":{"description":"A different delegation made the request."},"409":{"description":"No credential, or still waiting for a person to release it."},"410":{"description":"Already collected, declined, expired or revoked."},"503":{"description":"Credential handoff isn't open yet."}}}}},"x-oauth-authorization-server":"https://api.searchedly.com/.well-known/oauth-authorization-server/agent","x-oauth-protected-resource":"https://api.searchedly.com/.well-known/oauth-protected-resource/api/v1/agent"}