Members, roles and invitations of a workspace. Each operation takes the dashboard session cookie of a signed-in member (owner or admin to make a change), or an API key (`x-api-key`) of that same workspace holding the `team:admin` scope by name (`x-required-scopes`), acting for the person who created the key. Only an owner or admin signed in to the dashboard can create such a key. An agent token or other JWT is refused with 403 `team_admin_requires_api_key`, because it does not name the key it came from, so the creator cannot be checked. Rules for a key, checked on every call, stricter than the dashboard: - Only in the key's own workspace (403 `workspace_forbidden`), never on the agent starter plan (403 `sandbox_restricted`). - Only while the key's creator is an admitted account with an active owner or admin membership of the workspace; a key created before creators were recorded never qualifies (403 `key_creator_forbidden`). - Never grants the owner role (403 `owner_role_forbidden`) or a role above the creator's own (403 `role_above_creator`). - Never changes or removes an owner: the workspace owner of record (`tenants.owner_id`) answers 403 `workspace_owner_protected`, any other owner 403 `target_is_owner`, and a change that would leave no active owner 409 `last_owner`. Never changes or removes the creator's own membership either (403 `target_is_creator`). The owner rules are checked before the creator rule, so the owner of record gets `workspace_owner_protected` even from a key they created. - Demoting or removing an admin needs a key whose creator is the owner (403 `admin_change_requires_owner`). - The key row and the creator's account are re-checked, locked, inside the transaction of each change: a key revoked, expired or stripped of `team:admin` mid-request is refused (403 `key_revoked`), as is a creator suspended mid-request (403 `key_creator_forbidden`). - An invitation a key sends records the key (`created_by_api_key_id`). It can be accepted only while that key is still valid and holds `team:admin`, and its creator is still an active owner or admin at or above the invited role (otherwise `POST /api/invitations/accept` answers 403 `invitation_no_longer_authorized`). Revoking the key revokes its pending invitations. Rules for every caller, a dashboard session included, and an owner too: - The membership of the workspace owner of record is never demoted or removed through these routes, by anyone, themselves included (403 `workspace_owner_protected`). There is no ownership transfer operation; the message points to support@last-price.ai for that. - No change may leave the workspace without an active owner, whether by removing, demoting, or leaving (409 `last_owner`). Make another member an owner first. - A dashboard session needs an ACTIVE owner or admin membership to change anyone else; a suspended one gets 403 (`membership_suspended` from the route check, or the plain owner-or-admin refusal when the suspension lands while the change runs). - A change Postgres aborts because it collided with a concurrent change to the same members (a deadlock or serialization failure) is rolled back whole and answers 409 `concurrent_team_change` with `retryable: true`. Send the same request again. With a key, the attempt is recorded as a `team.refused` audit row like any other refusal. Every call made with a key, reads included, is written to the audit log (`GET /api/audit`, `subject_kind=workspace_team`) with the key as the actor, its agent when the key is agent-bound, and the creator in `metadata.created_by_user_id`. A change is never made without its audit row. A call refused once the key is authenticated writes a `team.refused` row (`metadata.refusal`, `metadata.attempted_action`) in the key's own workspace, after the refused change is rolled back; the response is unchanged. Those rows are readable only by owners and admins (see `GET /api/audit`). The dashboard's Team page lists them.
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Last Price Ai Team API
version: 1.0.0
contact:
name: API Support
email: support@last-price.ai
license:
name: MIT
x-guidance: 'Last Price computes prices for AI agents. To price one product, service, task or usage-based call, POST /api/compute/price with what is sold and its context (currency, current price or unit cost, product type, optional competitor offer); the answer is a price with its band, the reasons, a trace and a receipt.check_url. To check a price before you pay or quote it, POST /api/price-router/verify. Every operation that carries x-payment-info can be paid on its own with no account: send it with no credential, read the 402, pay, and resend. A workspace key (x-api-key) uses a prepaid balance instead. The MCP server at /api/mcp/rpc offers the same tools.'
x-lastprice-any-of-scopes:
description: On an operation, scopes of which a credential must hold at least one (recording an outcome after a single or a batch compute). Otherwise the same rules as `x-lastprice-scopes`; a refusal is 403 `insufficient_scope` listing every scope that would do.
x-lastprice-any-scope:
description: 'On an operation, `true` when any authenticated credential may call it, a key or token limited to specific scopes included: introspection (`GET /api/me`), usage, and operations that check scopes inside (an agent''s own notifications, settings and inbox). An operation with no `x-lastprice-scopes`, `x-lastprice-any-of-scopes`, `x-required-scopes` or this marker names no scope, so only a key with no scope limits or a dashboard session can call it. The usage operations refuse a credential holding only `workspace:claim`, `team:admin` or `launches:read`. `GET /api/openapi?view=scopes` lists every operation with what it needs.'
x-lastprice-auth:
description: 'How to read an operation that declares `security: []`. In OpenAPI an empty list only says no declared scheme applies; it does not mean the operation is open. Every such operation here carries an `x-lastprice-auth` marker saying which of two cases it is. The dashboard session cookie cannot be declared as a scheme, because it is the project-scoped, chunked `sb-<project-ref>-auth-token` and is browser only, so this marker is the machine-readable record of it. Operations with a declared scheme carry no marker.'
values:
public: Needs no credential. Some of these are rate limited per IP, and the demo operations answer from a pinned demo tenant.
session-cookie: Needs a signed-in dashboard browser session. A JWT or an API key is not accepted and gets 401, so an agent or server-side integration cannot call these at all. Use `GET /api/me` to learn the tenant a credential resolves to instead of `GET /api/user/workspaces`.
x-lastprice-scopes:
description: 'The `AgentScope` values an operation requires, every one of them. A credential that lacks one gets 403 `insufficient_scope` naming the missing scopes in the shared `ErrorEnvelope` (see the `InsufficientScope` response). A credential with no recorded scopes (the dashboard session, or a key or token created without any) holds full access and passes, except an agent principal, which must hold the scopes by name or by a wildcard such as `commerce:*`. An operation without the marker names no scope a key can hold, so a scope-limited credential (a key or token with recorded scopes and no `*`, or any agent credential) gets 403 `insufficient_scope` there with no `required_scopes`, while an unscoped key, a person''s token and the dashboard session pass. The exceptions take any authenticated credential of the workspace and check what they need themselves: `GET /api/me`, the `/api/usage` reads, `POST /api/compute/price`, `POST /api/price-router`, `/api/agents/allowance`, `/api/billing/balance`, `POST /api/billing/topup`, `/api/agents/{id}/capabilities`, the `/api/api-keys` routes, the agent claim (`POST /api/agents/claim`, which needs `workspace:claim` by name) and the operations marked with `x-required-scopes`.'
x-required-roles:
description: On an operation, the workspace roles a person must hold to call it from a dashboard session, or with the person token `POST /api/auth/native-token` issues. Checked before the operation runs; any other role, or none, gets 403 `role_forbidden` with `allowed_roles` and the caller's `role`. API keys and other JWTs name no person and are governed by scopes instead. Credentials (API keys, agent keys, embed tokens) need owner, admin or member; integrations and the tenant record need owner or admin; money (balances, top-ups, refunds, credits, invoices, agent allowances) needs owner, admin or billing.
x-required-scopes:
description: 'On an operation, the scopes an API key must hold BY NAME for the operation to accept it. OpenAPI 3.0 cannot put scopes on an `apiKey` requirement, so this list records them. A wildcard (`*`, or a prefix such as `team:*`) and a key with no scopes recorded never satisfy it. Today only the team administration operations carry it, with `team:admin`. It is stricter than `x-lastprice-scopes`: no wildcard, no unscoped key and no legacy `read`, `write` or `admin` label passes it, so those operations are not marked with `x-lastprice-scopes`.'
description: 'Operations tagged Team across 2 of this provider''s published API definitions: last-price-ai-openapi.json, openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.last-price.ai
description: Production API, the canonical host and the default base URL for generated clients. The interactive docs at /api-docs rewrite this origin to their own, because most operations answer no cross-origin browser call at all. They send no CORS headers, and they refuse a request carrying an Origin that is not their own with a 403. The two embeddable operations are the exception and answer registered origins; see the EmbedToken security scheme. Server-side callers send no Origin and are unaffected.
tags:
# --- truncated at 32 KB (82 KB total) ---
# Full source: https://artifacts.apis.io/last-price-ai/openapi/last-price-ai-team-api-openapi.yml