# Twinbay - [Introduction](https://docs.twinbay.ai/index.md): Private, stateful copies of the APIs your agent calls - [Quickstart](https://docs.twinbay.ai/quickstart.md): Start an environment, point an SDK at it, read back what your code sent - [Concepts](https://docs.twinbay.ai/concepts.md): Twins, environments, credentials, records, seeds, logs, exports and time - [Available twins](https://docs.twinbay.ai/twins.md): Every provider twin you can provision, and where each one stops - [Attio](https://docs.twinbay.ai/twins/attio.md): Objects, attributes and records, with lists, notes and tasks on top - [BILL](https://docs.twinbay.ai/twins/bill.md): Vendors, bills, the approval gate and the payments that clear them - [Brex](https://docs.twinbay.ai/twins/brex.md): Cards, budgets and spend limits, transactions, vendor payments, expenses and their receipts - [GitHub](https://docs.twinbay.ai/twins/github.md): Repositories, issues, pull requests and Projects v2, over REST and GraphQL - [HubSpot](https://docs.twinbay.ai/twins/hubspot.md): Contacts, companies, deals and associations — with the search index one step behind the write - [Klaviyo](https://docs.twinbay.ai/twins/klaviyo.md): Profiles, lists, events, derived segments and campaign sends, in Klaviyo's JSON:API - [Linear](https://docs.twinbay.ai/twins/linear.md): A GraphQL workspace: teams, workflow states, issues and their comments - [Mercury](https://docs.twinbay.ai/twins/mercury.md): Accounts and balances, transactions, recipients, payments and approvals, events and webhooks, cards and invoices - [NetSuite](https://docs.twinbay.ai/twins/netsuite.md): Customers, accounts and items, with invoices, the payments that settle them, and SuiteQL - [Notion](https://docs.twinbay.ai/twins/notion.md): Databases, data sources, pages, blocks and comments, at version 2025-09-03 - [Plaid](https://docs.twinbay.ai/twins/plaid.md): Linked bank logins, Plaid's own tokens and Item errors, signed webhooks, and the financial-data, payments and reporting products Sandbox gives an application - [QuickBooks](https://docs.twinbay.ai/twins/quickbooks.md): Customers, items and accounts, with invoices and the payments that settle them - [Resend](https://docs.twinbay.ai/twins/resend.md): Transactional sends, broadcasts, and the delivery events that follow them - [Shopify](https://docs.twinbay.ai/twins/shopify.md): The GraphQL Admin API with its calculated-cost bucket, its three error channels and an order stuck half-shipped - [Slack](https://docs.twinbay.ai/twins/slack.md): Channels, messages, threads and reactions, with Slack's ok:false envelope - [Stripe](https://docs.twinbay.ai/twins/stripe.md): Payment intents, charges, refunds, disputes and payouts as state machines over a real clock - [Tally](https://docs.twinbay.ai/twins/tally.md): Forms built from blocks, the questions Tally derives from them, and the submissions that come in - [WebEDI](https://docs.twinbay.ai/twins/webedi.md): The supplier portal's Documents workspace, with a PO acknowledgment ready to send - [Xero](https://docs.twinbay.ai/twins/xero.md): Contacts, invoices and payments in a Xero organisation, tax and all - [Zendesk](https://docs.twinbay.ai/twins/zendesk.md): Tickets, comments, users and search, with Zendesk's named wrappers and all three of its error envelopes - [CLI](https://docs.twinbay.ai/cli.md): Provision and inspect environments from a shell, a CI job, or a coding agent - [MCP server](https://docs.twinbay.ai/mcp-server.md): Give a coding agent the environment operations as tools - [Record a HAR file in Chrome](https://docs.twinbay.ai/har-file.md): Record the provider's web app so we can build a twin of an API Twinbay does not cover yet - [Read the authenticated user](https://docs.twinbay.ai/api-reference/users/read-the-authenticated-user.md): Returns the caller, the organization their token acts in, and every organization they belong to with their role in each. A caller who has not joined an organization yet gets a null active organization, which is how the client knows to show onboarding. - [List your organizations](https://docs.twinbay.ai/api-reference/organizations/list-your-organizations.md): Every organization the caller is a member of, with their role in each, newest membership first. Independent of the organization the current token acts in. Paginated: walk the pages with `page` and `size`. - [Create an organization](https://docs.twinbay.ai/api-reference/organizations/create-an-organization.md): Creates the organization in WorkOS with the caller as an admin, then mirrors it locally. The caller's current token is unchanged; refresh the AuthKit session into the new organization to act inside it. - [Create your first organization](https://docs.twinbay.ai/api-reference/organizations/create-your-first-organization.md): Idempotent: answers with the caller's oldest organization when they already belong to one, and otherwise creates one named after them, with the caller as an admin. This is what signing up calls, so that onboarding never has to ask for a name. Refresh the AuthKit session into the organization to act… - [Read the active organization](https://docs.twinbay.ai/api-reference/organizations/read-the-active-organization.md): The organization the access token acts in, plus the caller's role in it. Fails with 403 when the token names no organization. - [Rename the active organization](https://docs.twinbay.ai/api-reference/organizations/rename-the-active-organization.md): Requires the **admin** role or above in the active organization. - [List active organization members](https://docs.twinbay.ai/api-reference/organizations/list-active-organization-members.md): Reads the active organization's roster from WorkOS. Available to members and admins. Paginated: walk the pages with `page` and `size`. - [List pending organization invitations](https://docs.twinbay.ai/api-reference/organizations/list-pending-organization-invitations.md): Reads pending invitations for the active organization from WorkOS. Invitation tokens and acceptance URLs are never returned. - [Invite an organization member](https://docs.twinbay.ai/api-reference/organizations/invite-an-organization-member.md): Sends a WorkOS invitation to join the active organization. Requires an AuthKit session and the **admin** role. - [List API keys](https://docs.twinbay.ai/api-reference/api-keys/list-api-keys.md): Every key of the active organization that has not been revoked, newest first. A key that has expired is still listed, so that it can be read and cleaned up rather than vanishing unexplained; `expires_at` says which. Tokens are never included. Paginated: walk the pages with `page` and `size`. - [Create an API key](https://docs.twinbay.ai/api-reference/api-keys/create-an-api-key.md): Mints a key for the active organization. It acts with the caller's role, read from their membership on every request, so it can never outrank them. The response is the only time the token is readable. - [Revoke an API key](https://docs.twinbay.ai/api-reference/api-keys/revoke-an-api-key.md): The key stops working immediately. Its row stays, so a key seen in a log can still be named, and its token can never be minted again. - [Read the plan, credits and current usage](https://docs.twinbay.ai/api-reference/billing/read-the-plan-credits-and-current-usage.md): The active organization's plan, the limits it imposes, its remaining credit balance, and the draft invoice for the current period. - [List issued invoices](https://docs.twinbay.ai/api-reference/billing/list-issued-invoices.md): The active organization's most recent finalized invoices, newest first, with the payment status and PDF Stripe reports for each. - [Read the payment method](https://docs.twinbay.ai/api-reference/billing/read-the-payment-method.md): The card pay as you go charges, or null when none is saved. - [Start an upgrade](https://docs.twinbay.ai/api-reference/billing/start-an-upgrade.md): Opens a Stripe Checkout page that saves a card. Stripe returns the caller to `return_url` with a `checkout_session` query parameter to finish the upgrade with. Requires the **admin** role. - [Upgrade to pay as you go](https://docs.twinbay.ai/api-reference/billing/upgrade-to-pay-as-you-go.md): Finishes a checkout: its card becomes the default, and the organization moves to pay as you go. Limits lift at once; charges start at the next hour. Requires the **admin** role. - [Downgrade to Free](https://docs.twinbay.ai/api-reference/billing/downgrade-to-free.md): New seed and test generation stops at once, and every live environment gets the Free plan's deadline, counted from now. Requires the **admin** role. - [List available twins](https://docs.twinbay.ai/api-reference/catalog/list-available-twins.md): Returns registered twins, newest release first unless sorted by name. - [Retrieve a twin](https://docs.twinbay.ai/api-reference/catalog/retrieve-a-twin.md) - [List environments](https://docs.twinbay.ai/api-reference/environments/list-environments.md) - [Create an environment](https://docs.twinbay.ai/api-reference/environments/create-an-environment.md): Records the environment and queues each twin for provisioning. The twins are not serving yet: read each one with `wait_for=ready`, then collect its API key. - [Retrieve an environment](https://docs.twinbay.ai/api-reference/environments/retrieve-an-environment.md) - [List recent environment request logs](https://docs.twinbay.ai/api-reference/environments/list-recent-environment-request-logs.md) - [Retrieve an environment request log](https://docs.twinbay.ai/api-reference/environments/retrieve-an-environment-request-log.md) - [List an environment's exports](https://docs.twinbay.ai/api-reference/environments/list-an-environments-exports.md) - [Export an environment's traffic](https://docs.twinbay.ai/api-reference/environments/export-an-environments-traffic.md): Records the slice to export and answers immediately; a worker writes the file. An empty body exports the whole environment for all of time. - [Retrieve an export](https://docs.twinbay.ai/api-reference/environments/retrieve-an-export.md) - [Sign a link to an exported file](https://docs.twinbay.ai/api-reference/environments/sign-a-link-to-an-exported-file.md): A short-lived download URL for a ready export. JSON rather than a redirect, so the expiry is visible and no client has to follow one. - [Retrieve a twin](https://docs.twinbay.ai/api-reference/twins/retrieve-a-twin.md): With `wait_for`, the answer is held until the twin reaches that state, a run of it settles, or the wait runs out — so a caller waiting for a twin to serve sends one request rather than polling. - [Start a twin](https://docs.twinbay.ai/api-reference/twins/start-a-twin.md): Queues a fresh container. Its state and credentials are new. - [Stop a twin](https://docs.twinbay.ai/api-reference/twins/stop-a-twin.md): Queues the container for destruction. Everything it holds is lost. - [Collect the twin's API key](https://docs.twinbay.ai/api-reference/twins/collect-the-twins-api-key.md): Returns the key the twin's current container minted. - [List twin state](https://docs.twinbay.ai/api-reference/twins/list-twin-state.md) - [Replace a twin record](https://docs.twinbay.ai/api-reference/twins/replace-a-twin-record.md) - [Advance a deterministic twin lifecycle](https://docs.twinbay.ai/api-reference/twins/advance-a-deterministic-twin-lifecycle.md) - [List scenarios](https://docs.twinbay.ai/api-reference/scenarios/list-scenarios.md): Start an environment from a scenario by sending its id as `scenario` to `POST /environments`. - [Create a scenario](https://docs.twinbay.ai/api-reference/scenarios/create-a-scenario.md): Save providers and optional reusable seeds without starting an environment. - [Retrieve a scenario](https://docs.twinbay.ai/api-reference/scenarios/retrieve-a-scenario.md): A community scenario another organization published is readable here with `owned` false; editing, deleting and starting it stay with its organization. - [Delete a scenario](https://docs.twinbay.ai/api-reference/scenarios/delete-a-scenario.md): Referenced seeds and environments already started from it are untouched. - [Update a scenario](https://docs.twinbay.ai/api-reference/scenarios/update-a-scenario.md): Change the name or replace provider selections. Existing environments are untouched. - [List seeds](https://docs.twinbay.ai/api-reference/seeds/list-seeds.md) - [Generate a seed](https://docs.twinbay.ai/api-reference/seeds/generate-a-seed.md): Describes the starting state you want and answers immediately; a worker expands it into rows. Read the seed until it is `ready`, then pass its id as a twin's `seed` when you create an environment. - [List suggested starting states](https://docs.twinbay.ai/api-reference/seeds/list-suggested-starting-states.md): Described states the product ships for each twin that can be seeded. Send one back as a seed's `prompt`, edited or as it stands. - [Retrieve a seed](https://docs.twinbay.ai/api-reference/seeds/retrieve-a-seed.md) - [Delete a seed](https://docs.twinbay.ai/api-reference/seeds/delete-a-seed.md): Refused while an environment or a scenario still uses it. - [List tests](https://docs.twinbay.ai/api-reference/tests/list-tests.md) - [Create a test](https://docs.twinbay.ai/api-reference/tests/create-a-test.md): Records the test and its immutable version 1. Nothing is compiled or run. - [Retrieve a test](https://docs.twinbay.ai/api-reference/tests/retrieve-a-test.md) - [Update a test](https://docs.twinbay.ai/api-reference/tests/update-a-test.md): Appends an immutable definition. Existing runs remain pinned to their version. - [List a test's versions](https://docs.twinbay.ai/api-reference/tests/list-a-tests-versions.md) - [Retrieve a test version](https://docs.twinbay.ai/api-reference/tests/retrieve-a-test-version.md) - [List evaluators](https://docs.twinbay.ai/api-reference/tests/list-evaluators.md): Lists every compilation for a test, optionally filtered by version. - [Create an evaluator](https://docs.twinbay.ai/api-reference/tests/create-an-evaluator.md): Queues compilation of a test definition into immutable request matchers. The latest test version is pinned when no version is supplied. - [Retrieve an evaluator](https://docs.twinbay.ai/api-reference/tests/retrieve-an-evaluator.md): Poll until `status` is `ready`, when rules and provenance are frozen, or `error`, when `last_error` explains the failure. - [List test runs](https://docs.twinbay.ai/api-reference/tests/list-test-runs.md) - [Start a test run](https://docs.twinbay.ai/api-reference/tests/start-a-test-run.md): Opens an attempt: traffic the environment serves from now on is attributed to it. Does not launch an agent or reset twins. An environment runs one attempt at a time. - [Retrieve a test run](https://docs.twinbay.ai/api-reference/tests/retrieve-a-test-run.md) - [Evaluate a test run](https://docs.twinbay.ai/api-reference/tests/evaluate-a-test-run.md): Queues a capture and grading with the run's evaluator. Naming another evaluator regrades the latest ready capture for the same phase. - [List a test run's evaluations](https://docs.twinbay.ai/api-reference/tests/list-a-test-runs-evaluations.md) - [Retrieve an evaluation](https://docs.twinbay.ai/api-reference/tests/retrieve-an-evaluation.md): Evaluation is asynchronous: poll until `status` is `completed` or `error`; `verdict` is `pending` until then. Only a `passed` verdict is a pass: `failed`, `inconclusive` and `error` are not. `coverage_status` says whether the capture holds every call the attempt's window served, and each result cite… - [Sign a link to a preserved capture](https://docs.twinbay.ai/api-reference/tests/sign-a-link-to-a-preserved-capture.md) - [Read Root](https://docs.twinbay.ai/api-reference/healthchecks/read-root.md) - [Read Health](https://docs.twinbay.ai/api-reference/healthchecks/read-health.md) ## OpenAPI Specs - [openapi](https://api.twinbay.ai/openapi.json) This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.