An Organization is a top-level resource in WorkOS. Each Connection, Directory, and Audit Trail Event belongs to an Organization. An Organization will usually represent one of your customers. There is no limit to the number of organizations you can create in WorkOS.
Get the details of an existing organization.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const organization = await workos.organizations.getOrganization( 'org_01EHZNVPK3SFK441A1RGBFSHRT', );
{ "object": "organization", "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", "name": "Acme Inc.", "domains": [ { "object": "organization_domain", "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", "domain": "foo-corp.com", "state": "pending", "verification_prefix": "superapp-domain-verification-z3kjny", "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", "verification_strategy": "dns", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" } ], "metadata": { "tier": "diamond" }, "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organization = await workos.organizations.getOrganization( | |
| 'org_01EHZNVPK3SFK441A1RGBFSHRT', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations.get_organization(id: "org_01EHZNVPK3SFK441A1RGBFSHRT") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations.get_organization(id_="org_01EHZNVPK3SFK441A1RGBFSHRT") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Organizations().Get(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->organizations()->getOrganization(id: "org_01EHZNVPK3SFK441A1RGBFSHRT"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizations.getOrganization("org_01EHZNVPK3SFK441A1RGBFSHRT"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Organizations.GetAsync("org_01EHZNVPK3SFK441A1RGBFSHRT"); |
| use workos::Client; | |
| #[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 | |
| .organizations() | |
| .get_organization("org_01EHZNVPK3SFK441A1RGBFSHRT") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "organization", | |
| "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "name": "Acme Inc.", | |
| "domains": [ | |
| { | |
| "object": "organization_domain", | |
| "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", | |
| "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", | |
| "domain": "foo-corp.com", | |
| "state": "pending", | |
| "verification_prefix": "superapp-domain-verification-z3kjny", | |
| "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", | |
| "verification_strategy": "dns", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "metadata": { | |
| "tier": "diamond" | |
| }, | |
| "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", | |
| "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
GET/organizations /:idParameters Returns Get the details of an existing organization by an external identifier.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const organization = await workos.organizations.getOrganizationByExternalId( '2fe01467-f7ea-4dd2-8b79-c2b4f56d0191', );
{ "object": "organization", "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", "name": "Acme Inc.", "domains": [ { "object": "organization_domain", "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", "domain": "foo-corp.com", "state": "pending", "verification_prefix": "superapp-domain-verification-z3kjny", "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", "verification_strategy": "dns", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" } ], "metadata": { "tier": "diamond" }, "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl "https://api.workos.com/organizations/external_id/2fe01467-f7ea-4dd2-8b79-c2b4f56d0191" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organization = await workos.organizations.getOrganizationByExternalId( | |
| '2fe01467-f7ea-4dd2-8b79-c2b4f56d0191', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations.get_organization_by_external_id(external_id: "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations.get_organization_by_external_id( | |
| external_id="2fe01467-f7ea-4dd2-8b79-c2b4f56d0191" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Organizations().GetByExternalID(context.Background(), "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizations() | |
| ->getOrganizationByExternalId( | |
| externalId: "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizations.getOrganizationByExternalId("2fe01467-f7ea-4dd2-8b79-c2b4f56d0191"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Organizations.GetByExternalIdAsync("2fe01467-f7ea-4dd2-8b79-c2b4f56d0191"); |
| use workos::Client; | |
| #[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 | |
| .organizations() | |
| .get_organization_by_external_id("2fe01467-f7ea-4dd2-8b79-c2b4f56d0191") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "organization", | |
| "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "name": "Acme Inc.", | |
| "domains": [ | |
| { | |
| "object": "organization_domain", | |
| "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", | |
| "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", | |
| "domain": "foo-corp.com", | |
| "state": "pending", | |
| "verification_prefix": "superapp-domain-verification-z3kjny", | |
| "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", | |
| "verification_strategy": "dns", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "metadata": { | |
| "tier": "diamond" | |
| }, | |
| "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", | |
| "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
GET/organizations /external_id /:external_idParameters Returns Get a list of all of your existing organizations matching the criteria specified.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const organizations = await workos.organizations.listOrganizations({ domains: ['foo-corp.com'], }); console.log(organizations.data);
{ "object": "list", "data": [ { "object": "organization", "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", "name": "Acme Inc.", "domains": [ { "object": "organization_domain", "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", "domain": "foo-corp.com", "state": "pending", "verification_prefix": "superapp-domain-verification-z3kjny", "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", "verification_strategy": "dns", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" } ], "metadata": { "tier": "diamond" }, "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" } ], "list_metadata": { "before": "org_01HXYZ123456789ABCDEFGHIJ", "after": "org_01HXYZ987654321KJIHGFEDCBA" } }
| curl "https://api.workos.com/organizations" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organizations = await workos.organizations.listOrganizations({ | |
| domains: ['foo-corp.com'], | |
| }); | |
| console.log(organizations.data); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations.list_organizations |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations.list_organizations() |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Organizations().List(context.Background()) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->organizations()->listOrganizations(); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizations.listOrganizations(); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Organizations.ListAsync(); |
| use workos::Client; | |
| #[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 | |
| .organizations() | |
| .list_organizations() | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "list", | |
| "data": [ | |
| { | |
| "object": "organization", | |
| "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "name": "Acme Inc.", | |
| "domains": [ | |
| { | |
| "object": "organization_domain", | |
| "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", | |
| "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", | |
| "domain": "foo-corp.com", | |
| "state": "pending", | |
| "verification_prefix": "superapp-domain-verification-z3kjny", | |
| "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", | |
| "verification_strategy": "dns", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "metadata": { | |
| "tier": "diamond" | |
| }, | |
| "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", | |
| "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "list_metadata": { | |
| "before": "org_01HXYZ123456789ABCDEFGHIJ", | |
| "after": "org_01HXYZ987654321KJIHGFEDCBA" | |
| } | |
| } |
GET/organizationsParameters Returns objectCreates a new organization in the current environment.
You can include one or more domains to associate with the organization, but you should verify the ownership of every domain before setting its state to verified.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const organization = await workos.organizations.createOrganization({ name: 'Foo Corp', domainData: [ { domain: 'foo-corp.com', state: 'pending', }, ], externalId: '2fe01467-f7ea-4dd2-8b79-c2b4f56d0191', metadata: { tier: 'diamond', }, });
{ "object": "organization", "name": "Foo Corp", "domains": [ { "object": "organization_domain", "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", "domain": "foo-corp.com", "state": "pending", "verification_prefix": "superapp-domain-verification-z3kjny", "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", "verification_strategy": "dns", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" } ], "metadata": { "tier": "diamond" }, "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "allow_profiles_outside_organization": false, "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", "external_id": "ext_12345" }
| curl --request POST \ | |
| --url "https://api.workos.com/organizations" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "name": "Foo Corp", | |
| "domain_data": [ | |
| { | |
| "domain": "foo-corp.com", | |
| "state": "pending" | |
| } | |
| ], | |
| "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191", | |
| "metadata": { | |
| "tier": "diamond" | |
| } | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organization = await workos.organizations.createOrganization({ | |
| name: 'Foo Corp', | |
| domainData: [ | |
| { | |
| domain: 'foo-corp.com', | |
| state: 'pending', | |
| }, | |
| ], | |
| externalId: '2fe01467-f7ea-4dd2-8b79-c2b4f56d0191', | |
| metadata: { | |
| tier: 'diamond', | |
| }, | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations.create_organization(name: "Foo Corp") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations.create_organization(name="Foo Corp") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Organizations().Create(context.Background(), &workos.OrganizationsCreateParams{ | |
| Name: "Foo Corp", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->organizations()->createOrganization(name: "Foo Corp"); |
| import com.workos.WorkOS; | |
| import com.workos.organizations.OrganizationsApi.CreateOrganizationOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| CreateOrganizationOptions options = | |
| CreateOrganizationOptions.builder().name("Foo Corp").build(); | |
| workos.organizations.createOrganization(options); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Organizations.CreateAsync(new OrganizationsCreateOptions { | |
| Name = "Foo Corp", | |
| }); |
| use workos::Client; | |
| use workos::organizations::CreateOrganizationParams; | |
| #[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 | |
| .organizations() | |
| .create_organization( | |
| CreateOrganizationParams { | |
| name: "Foo Corp".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "organization", | |
| "name": "Foo Corp", | |
| "domains": [ | |
| { | |
| "object": "organization_domain", | |
| "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", | |
| "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", | |
| "domain": "foo-corp.com", | |
| "state": "pending", | |
| "verification_prefix": "superapp-domain-verification-z3kjny", | |
| "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", | |
| "verification_strategy": "dns", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "metadata": { | |
| "tier": "diamond" | |
| }, | |
| "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "allow_profiles_outside_organization": false, | |
| "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY", | |
| "external_id": "ext_12345" | |
| } |
POST/organizationsReturns Updates an organization in the current environment.
You can include one or more domains to associate with the organization, but you should verify the ownership of every domain before setting its state to verified.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const organization = await workos.organizations.updateOrganization({ organization: 'org_01EHZNVPK3SFK441A1RGBFSHRT', name: 'Foo Corp', domainData: [ { domain: 'foo-corp.com', state: 'verified', }, ], externalId: '2fe01467-f7ea-4dd2-8b79-c2b4f56d0191', metadata: { tier: 'diamond', }, stripeCustomerId: 'cus_R9qWAGMQ6nGE7V', });
{ "object": "organization", "name": "Foo Corp", "domains": [ { "object": "organization_domain", "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", "domain": "foo-corp.com", "state": "pending", "verification_prefix": "superapp-domain-verification-z3kjny", "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", "verification_strategy": "dns", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" } ], "metadata": { "tier": "diamond" }, "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "allow_profiles_outside_organization": false, "id": "org_01EHZNVPK3SFK441A1RGBFSHRT", "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191" }
| curl --request PUT \ | |
| --url "https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "name": "Foo Corp", | |
| "allow_profiles_outside_organization": false, | |
| "domain_data": [ | |
| { | |
| "domain": "foo-corp.com", | |
| "state": "verified" | |
| } | |
| ], | |
| "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", | |
| "metadata": { | |
| "tier": "diamond" | |
| }, | |
| "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191" | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organization = await workos.organizations.updateOrganization({ | |
| organization: 'org_01EHZNVPK3SFK441A1RGBFSHRT', | |
| name: 'Foo Corp', | |
| domainData: [ | |
| { | |
| domain: 'foo-corp.com', | |
| state: 'verified', | |
| }, | |
| ], | |
| externalId: '2fe01467-f7ea-4dd2-8b79-c2b4f56d0191', | |
| metadata: { | |
| tier: 'diamond', | |
| }, | |
| stripeCustomerId: 'cus_R9qWAGMQ6nGE7V', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organizations.update_organization(id: "org_01EHZNVPK3SFK441A1RGBFSHRT") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organizations.update_organization(id_="org_01EHZNVPK3SFK441A1RGBFSHRT") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Organizations().Update(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizations() | |
| ->updateOrganization(id: "org_01EHZNVPK3SFK441A1RGBFSHRT"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizations.updateOrganization("org_01EHZNVPK3SFK441A1RGBFSHRT"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Organizations.UpdateAsync("org_01EHZNVPK3SFK441A1RGBFSHRT"); |
| use workos::Client; | |
| #[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 | |
| .organizations() | |
| .update_organization("org_01EHZNVPK3SFK441A1RGBFSHRT") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "organization", | |
| "name": "Foo Corp", | |
| "domains": [ | |
| { | |
| "object": "organization_domain", | |
| "id": "org_domain_01EHZNVPK2QXHMVWCEDQEKY69A", | |
| "organization_id": "org_01HE8GSH8FQPASKSY27THRKRBP", | |
| "domain": "foo-corp.com", | |
| "state": "pending", | |
| "verification_prefix": "superapp-domain-verification-z3kjny", | |
| "verification_token": "m5Oztg3jdK4NJLgs8uIlIprMw", | |
| "verification_strategy": "dns", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "metadata": { | |
| "tier": "diamond" | |
| }, | |
| "stripe_customer_id": "cus_R9qWAGMQ6nGE7V", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "allow_profiles_outside_organization": false, | |
| "id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "external_id": "2fe01467-f7ea-4dd2-8b79-c2b4f56d0191" | |
| } |
PUT/organizations /:idParameters Returns Permanently deletes an organization in the current environment. It cannot be undone.
curl --request DELETE \ --url https://api.workos.com/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT \ --header "Authorization: Bearer sk_example_123456789"
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); await workos.organizations.deleteOrganization('org_01EHZNVPK3SFK441A1RGBFSHRT');
require "workos" WorkOS.configure do |config| config.api_key = "sk_example_123456789" end WorkOS.client.organizations.delete_organization(id: "org_01EHZNVPK3SFK441A1RGBFSHRT")
from workos import WorkOSClient client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") client.organizations.delete_organization(id_="org_01EHZNVPK3SFK441A1RGBFSHRT")
package main import ( "context" "github.com/workos/workos-go/v9" ) func main() { client := workos.NewClient("sk_example_123456789") _, err := client.Organizations().Delete(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT") if err != nil { panic(err) } }
<?php use WorkOS\WorkOS; $workos = new WorkOS( apiKey: "sk_example_123456789", clientId: "client_123456789", ); $workos ->organizations() ->deleteOrganization(id: "org_01EHZNVPK3SFK441A1RGBFSHRT");
import com.workos.WorkOS; WorkOS workos = new WorkOS("sk_example_123456789"); workos.organizations.deleteOrganization("org_01EHZNVPK3SFK441A1RGBFSHRT");
using WorkOS; var client = new WorkOSClient(new WorkOSOptions { ApiKey = "sk_example_123456789", ClientId = "client_123456789", }); await client.Organizations.DeleteAsync("org_01EHZNVPK3SFK441A1RGBFSHRT");
use workos::Client; #[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 .organizations() .delete_organization("org_01EHZNVPK3SFK441A1RGBFSHRT") .await?; Ok(()) }
DELETE/organizations /:idParameters