Using our Programmatic Workspace Actions requires you to first create a Workspace Management Key. These are different from API keys in that they give you access to manage your Stytch projects and project settings. They will work only for the specific set of products set up for workspace management.
To create a new Workspace Management Key, first login to the Stytch dashboard, then navigate to Workspace settings -> Management API. Click "Add new" to create a new Workspace Management Key.
Remember to save the secret somewhere secure since you won't be able to view it again. When making requests to the routes defined below, you will use HTTP Basic Authentication to authenticate your requests to your workspace. The user ID will be the Key ID and the password is the Secret.
The base URL for all routes is https://management.stytch.com. For example, to create a project, you would make a POST to https://management.stytch.com/v1/projects with the appropriate HTTP Body.
All client endpoints are available in an Insomnia API Collection (compatible with Postman) here (ask Stytch for permissions). An example cURL request is given below:
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}'
Now you can use either the Stytch Management Go SDK, Stytch Terraform Provider or cURL/Postman/another HTTP client to make API calls to the Stytch Management API. If using a client other than the Management Go SDK, be sure to set the following:
Set the header "Content-Type: application/json"
Use HTTP Basic Authentication with the workspace API key ID and secret you received earlier
Use the workspace key ID as the user_id
Use the workspace key secret as the password