clean-piano-39737
01/20/2025, 3:12 PMbrief-egg-61061
01/20/2025, 3:12 PMbrief-egg-61061
01/20/2025, 3:12 PMbash curl -X POST --location "<https://api.console.ory.sh/projects/$PROJECT_ID/organizations>" \ -H "Authorization: Bearer $WORKSPACE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "label": "xyz", "domains": ["<http://example.com|example.com>"] }'
This will return the organization ID. Let's assume it's 6bb1c7d1-3b3e-4995-9e09-35649dc45a2b
. 2. Create the identity with the organization ID: bash curl -X POST -H "Authorization: Bearer $WORKSPACE_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "schema_id": "<preset://email>", "traits": { "email": "<mailto:user@example.com|user@example.com>" }, "credentials": { "password": { "config": { "password": "securepassword" } } }, "organization_id": "6bb1c7d1-3b3e-4995-9e09-35649dc45a2b" }' \ https://$<http://PROJECT_SLUG.projects.oryapis.com/admin/identities|PROJECT_SLUG.projects.oryapis.com/admin/identities>
Make sure to replace the following variables: - `$PROJECT_ID`: Your Ory project ID - `$WORKSPACE_API_KEY`: Your Ory workspace API key - `$PROJECT_SLUG`: Your Ory project slug This process will create a new identity associated with the "xyz" organization. Sources: [Create SSO connections for an organization](https://www.ory.sh/docs/kratos/organizations#create-sso-connections-for-an-organization) [Create an Identity](https://www.ory.sh/docs/kratos/manage-identities/create-users-identities)