{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Base URLs & environments","description":"Reference, guides, and webhooks for the Aiwyn API: clients, contacts, engagements, projects, billing, payments, time, and files.","llmstxt":{"title":"Aiwyn API","description":"Aiwyn Product API documentation. Start with reference/quickstart.md; the API reference lists every endpoint, its required role, its request and response schemas, and the webhook payload."}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"base-urls--environments","__idx":0},"children":["Base URLs & environments"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Product API is available in the following environments. Send all requests to the"," ","base URL for the environment you are targeting."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Environment"},"children":["Environment"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Base URL"},"children":["Base URL"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Purpose"},"children":["Purpose"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Sandbox"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.sandbox.aiwyn.app"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Runs the latest development build. Use for early integration and experimentation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Staging"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.staging.aiwyn.app"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Mirrors production behavior and stability. Use for pre-release validation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Production"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.aiwyn.ai"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your firm's live data."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Each environment has its own API keys: a key issued for Sandbox does not work on Staging or Production."," ","All three are selectable as the server in the API reference's ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Try it"]}," panel. Requests made there"," ","against Production read and change live data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Authenticate every request with a bearer token. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/authentication"},"children":["Authentication"]},", or"," ","the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/quickstart"},"children":["Quickstart"]}," for the whole flow."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"path-prefixes","__idx":1},"children":["Path prefixes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Every path carries the API version, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v1"]},", and starts with one of three prefixes. The prefix tells"," ","you how the endpoint behaves:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Prefix"},"children":["Prefix"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Used for"},"children":["Used for"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Conventions"},"children":["Conventions"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/v1/auth/"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Token exchange"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/auth/token"]}," only."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/gql/v1/"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Reading records"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["List"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /gql/v1/clients"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ \"pageSize\", \"page\" }"]}," in the body. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Search"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /gql/v1/clients/search"]},", which adds ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["where"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["orderBy"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["By id"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]},", usually under the singular resource name, as in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /gql/v1/client/{id}"]},". Responses are keyed by the resource name, with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["total.aggregate.count"]}," on lists and searches. See ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/pagination"},"children":["Pagination"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/api/v1/"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Creating, changing, and deleting records; records, codes, and entries; event subscriptions; files"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Standard HTTP methods on resource paths. Most responses use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["{ data, error, meta }"]}," envelope; each endpoint's reference page shows its exact body."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two client endpoints repeat the version: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /api/v1/clients/v1/onboard"]}," and"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /api/v1/clients/v1/link/payment"]},". The second ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v1"]}," is part of their path and does not mean"," ","anything; they are ordinary ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v1"]}," endpoints and keep these paths for as long as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["v1"]}," is supported."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"cloudflare-access-sandbox-and-staging","__idx":2},"children":["Cloudflare Access (Sandbox and Staging)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Sandbox and Staging environments sit behind Cloudflare Access. In addition to your"," ","Aiwyn credentials, ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["every request"]}," to these environments, including"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/auth/token"]},", must carry a Cloudflare Access service token. Production does not"," ","use Cloudflare Access; send only your Aiwyn credentials there."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Header"},"children":["Header"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CF-Access-Client-Id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Cloudflare Access client ID issued to you by Aiwyn"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CF-Access-Client-Secret"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Cloudflare Access client secret issued to you by Aiwyn"]}]}]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --request POST 'https://api.staging.aiwyn.app/gql/v1/clients' \\\n  --header 'CF-Access-Client-Id: <cf-access-client-id>' \\\n  --header 'CF-Access-Client-Secret: <cf-access-client-secret>' \\\n  --header 'Authorization: Bearer <token>' \\\n  --header 'Content-Type: application/json' \\\n  --data '{ \"pageSize\": 5, \"page\": 0 }'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The Cloudflare Access credentials are separate from your Aiwyn API key. They only get"," ","the request past Cloudflare; the API still authenticates and authorizes it with your"," ","API key or bearer token."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Each environment has its own client ID and secret. Contact"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"mailto:api-support@aiwyn.ai"},"children":["api-support@aiwyn.ai"]}," to request them."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treat the client secret like a password: keep it server-side and out of source control."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A request without valid Cloudflare Access headers is rejected by Cloudflare before it"," ","reaches the API, so the response is Cloudflare's, not the JSON error body described in"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/reference/errors"},"children":["Errors"]},"."]}]}]},"headings":[{"value":"Base URLs & environments","id":"base-urls--environments","depth":1},{"value":"Path prefixes","id":"path-prefixes","depth":2},{"value":"Cloudflare Access (Sandbox and Staging)","id":"cloudflare-access-sandbox-and-staging","depth":2}],"frontmatter":{"seo":{"title":"Base URLs & environments"}},"lastModified":"2026-11-23T07:25:47.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/reference/base-urls","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}