Skip to main content
Our B2B SaaS Authentication API is organized around REST principles and has resource-oriented URLs, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. All B2B API resources are scoped to the Project of the API keys you provide.

API keys

To use the Stytch API, authenticate your requests using your project_id and secret from the Project ID & API keys section in the Dashboard.
  • For direct API calls, pass these credentials into the Authorization request header using basic authentication.
  • When using our backend SDKs, provide these credentials when initializing the Stytch SDK client.
curl --request POST \
  --url https://test.stytch.com/v1/b2b/organizations \
  -u 'PROJECT_ID:{$secret}' \
  -H 'Content-Type: application/json' \
  -d '{
    "organization_name": "Example Org Inc.",
    "organization_slug": "example-org"
  }'

Environments

By default, a Stytch project includes one Live and one Test environment. Your Live environment should map to production. You can make as many Test environments as you need for your various stacks (development, staging, QA, etc.). Each environment type has its own API root URL:
  • Test environments: test.stytch.com
  • Live environment: api.stytch.com
All resources and data objects are tied to the environment they were created in. Additionally, the IDs include their respective environment. For example, member-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6 indicates a Member was created in a specific Test environment.