Stytch's Programmatic Workspace Actions API endpoints allow you to manage your Stytch project settings programmatically.
You can use the Stytch Management Go SDK, Stytch Terraform Provider or cURL/ Postman/ any other HTTP client to access the Programmatic Workspace Actions API. All client endpoints are also available in a Postman API Collection (compatible with Insomnia upon export) here.
Authentication
Our Programmatic Workspace Actions endpoints use HTTP Basic Authentication with a Workspace Management Key ID as the username and a Workspace Management Secret as the password. Workspace Management Keys are different from your Stytch API keys in that they allow you to manage your Stytch projects and project settings, but do not allow you to make calls to Stytch's authentication APIs.
The Stytch Management Go SDK and the Stytch Terraform provider also require a Workspace Key ID and a Workspace Secret for authentication purposes.
In order to create a new Workspace Management Key, navigate to the Workspace settings / Management API tab in the Stytch Dashboard and click + Add new. Remember to save the secret somewhere secure since you won't be able to view it again.
Here is an example cURL request to the Create project endpoint using Basic Authentication with a Workspace Key ID and Workspace Management Secret:
curl -s -X POST https://management.stytch.com/v1/projects \
-H "Content-Type: application/json" \
-u "workspace-key-prod-0000000-0000-0000-0000-000000000:key-secret" \
-d '{"project_name": "Created with PWA", "vertical": "B2B}'