AuthKit is a user management platform that provides a set of user authentication and organization security features designed to provide a fast, scalable integration while handling all of the user management complexity that comes with advanced B2B customer needs.
To automatically respond to AuthKit activities, like authentication and changes related to the users, use the corresponding events.
Creates a new CORS origin for the current environment. CORS origins allow browser-based applications to make requests to the WorkOS API.
curl --request POST \ --url "https://api.workos.com/user_management/cors_origins" \ --header "Authorization: Bearer sk_example_123456789" \ --header "Content-Type: application/json" \ -d @- <<'BODY' { "origin": "https://example.com" } BODY
{ "object": "cors_origin", "id": "cors_origin_01HXYZ123456789ABCDEFGHIJ", "origin": "https://example.com", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl --request POST \ | |
| --url "https://api.workos.com/user_management/cors_origins" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "origin": "https://example.com" | |
| } | |
| BODY |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.create_cors_origin(origin: "https://example.com") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.create_cors_origin(origin="https://example.com") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().CreateCORSOrigin(context.Background(), &workos.UserManagementCreateCORSOriginParams{ | |
| Origin: "https://example.com", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->userManagement()->createCorsOrigin(origin: "https://example.com"); |
| import com.workos.WorkOS; | |
| import com.workos.usermanagement.UserManagementApi.CreateCorsOriginOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| CreateCorsOriginOptions options = | |
| CreateCorsOriginOptions.builder().origin("https://example.com").build(); | |
| workos.userManagement.createCorsOrigin(options); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.CreateCorsOriginAsync(new UserManagementCreateCorsOriginOptions { | |
| Origin = "https://example.com", | |
| }); |
| use workos::Client; | |
| use workos::user_management::CreateCorsOriginParams; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .user_management() | |
| .create_cors_origin( | |
| CreateCorsOriginParams { | |
| origin: "https://example.com".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "cors_origin", | |
| "id": "cors_origin_01HXYZ123456789ABCDEFGHIJ", | |
| "origin": "https://example.com", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
POST/user_management /cors_originsReturns Creates a new redirect URI for an environment.
curl --request POST \ --url "https://api.workos.com/user_management/redirect_uris" \ --header "Authorization: Bearer sk_example_123456789" \ --header "Content-Type: application/json" \ -d @- <<'BODY' { "uri": "https://example.com/callback" } BODY
{ "object": "redirect_uri", "id": "ruri_01EHZNVPK3SFK441A1RGBFSHRT", "uri": "https://example.com/callback", "default": true, "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl --request POST \ | |
| --url "https://api.workos.com/user_management/redirect_uris" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "uri": "https://example.com/callback" | |
| } | |
| BODY |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.create_redirect_uri(uri: "https://example.com/callback") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.create_redirect_uri(uri="https://example.com/callback") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().CreateRedirectURI(context.Background(), &workos.UserManagementCreateRedirectURIParams{ | |
| URI: "https://example.com/callback", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->userManagement() | |
| ->createRedirectUri(uri: "https://example.com/callback"); |
| import com.workos.WorkOS; | |
| import com.workos.usermanagement.UserManagementApi.CreateRedirectUriOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| CreateRedirectUriOptions options = | |
| CreateRedirectUriOptions.builder().uri("https://example.com/callback").build(); | |
| workos.userManagement.createRedirectUri(options); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.CreateRedirectUriAsync(new UserManagementCreateRedirectUriOptions { | |
| Uri = "https://example.com/callback", | |
| }); |
| use workos::Client; | |
| use workos::user_management::CreateRedirectUriParams; | |
| #[tokio::main] | |
| async fn main() -> Result<(), workos::Error> { | |
| let client = Client::builder() | |
| .api_key("sk_example_123456789") | |
| .client_id("client_123456789") | |
| .build(); | |
| let _result = client | |
| .user_management() | |
| .create_redirect_uri( | |
| CreateRedirectUriParams { | |
| uri: "https://example.com/callback".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "redirect_uri", | |
| "id": "ruri_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "uri": "https://example.com/callback", | |
| "default": true, | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
POST/user_management /redirect_urisReturns