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.key = "sk_example_123456789" | |
| end | |
| organization = WorkOS::Organizations.get_organization( | |
| id: "org_01EHZNVPK3SFK441A1RGBFSHRT" | |
| ) |
| from workos import WorkOSClient | |
| workos_client = WorkOSClient( | |
| api_key="sk_example_123456789", client_id="client_123456789" | |
| ) | |
| organization = workos_client.organizations.get_organization( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v3/pkg/organizations" | |
| ) | |
| func main() { | |
| organizations.SetAPIKey("sk_example_123456789") | |
| org, err := organizations.GetOrganization( | |
| context.Background(), | |
| organizations.GetOrganizationOpts{ | |
| Organization: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| }, | |
| ) | |
| } |
| <?php | |
| WorkOS\WorkOS::setApiKey("sk_example_123456789"); | |
| $organizations = new WorkOS\Organizations(); | |
| $organization = $organizations->getOrganization( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT" | |
| ); |
| import com.workos.WorkOS; | |
| import com.workos.organizations.models.Organization; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| String organizationId = "org_01EHZNVPK3SFK441A1RGBFSHRT"; | |
| Organization organization = workos.organizations.getOrganization(organizationId); |
| WorkOS.SetApiKey("sk_example_123456789"); | |
| var organizationsService = new OrganizationsService(); | |
| var organizationId = "org_01EHZNVPK3SFK441A1RGBFSHRT"; | |
| var organization = await organizationsService.GetOrganization(organizationId); |
| { | |
| "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', | |
| ); |
| { | |
| "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.key = "sk_example_123456789" | |
| end | |
| organizations = WorkOS::Organizations.list_organizations( | |
| domains: ["foo-corp.com"] | |
| ) |
| from workos import WorkOSClient | |
| workos_client = WorkOSClient( | |
| api_key="sk_example_123456789", client_id="client_123456789" | |
| ) | |
| organizations = workos_client.organizations.list_organizations(domains=["foo-corp.com"]) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v3/pkg/organizations" | |
| ) | |
| func main() { | |
| organizations.SetAPIKey("sk_example_123456789") | |
| list, err := organizations.ListOrganizations( | |
| context.Background(), | |
| organizations.ListOrganizationsOpts{Domains: []string{"foo-corp.com"}}, | |
| ) | |
| } |
| <?php | |
| WorkOS\WorkOS::setApiKey("sk_example_123456789"); | |
| $organizations = new WorkOS\Organizations(); | |
| [$before, $after, $list] = $organizations->listOrganizations( | |
| domains: ["foo-corp.com"] | |
| ); |
| import com.workos.WorkOS; | |
| import com.workos.organizations.OrganizationsApi.ListOrganizationsOptions; | |
| import com.workos.organizations.models.OrganizationList; | |
| import java.util.List; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| List<String> domains = List.of("foo-corp.com"); | |
| ListOrganizationsOptions options = | |
| ListOrganizationsOptions.builder().domains(domains).build(); | |
| OrganizationList organizationList = workos.organizations.listOrganizations(options); |
| WorkOS.SetApiKey("sk_example_123456789"); | |
| var organizationsService = new OrganizationsService(); | |
| var options = new ListOrganizationsOptions { | |
| Domains = | |
| new string[] { | |
| "foo-corp.com", | |
| }, | |
| }; | |
| var organizationList = await organizationsService.ListOrganizations(options); |
| { | |
| "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.key = "sk_example_123456789" | |
| end | |
| organization = WorkOS::Organizations.create_organization( | |
| name: "Foo Corp", | |
| domain_data: [ | |
| { | |
| domain: "foo-corp.com", | |
| state: "pending" | |
| } | |
| ] | |
| ) |
| from workos import WorkOSClient | |
| workos_client = WorkOSClient( | |
| api_key="sk_example_123456789", client_id="client_123456789" | |
| ) | |
| organization = workos_client.organizations.create_organization( | |
| name="Foo Corp", | |
| domain_data=[ | |
| { | |
| "domain": "foo-corp.com", | |
| "state": "pending", | |
| } | |
| ], | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v3/pkg/organizations" | |
| ) | |
| func main() { | |
| organizations.SetAPIKey("sk_example_123456789") | |
| org, err := organizations.CreateOrganization( | |
| context.Background(), | |
| organizations.CreateOrganizationOpts{ | |
| Name: "Foo Corp", | |
| DomainData: []OrganizationDomainData{ | |
| { | |
| Domain: "foo-corp.com", | |
| State: "pending", | |
| }, | |
| }, | |
| }, | |
| ) | |
| } |
| <?php | |
| WorkOS\WorkOS::setApiKey("sk_example_123456789"); | |
| $organizations = new WorkOS\Organizations(); | |
| $organization = $organizations->createOrganization( | |
| name: "Foo Corp", | |
| domain_data: [ | |
| [ | |
| "domain" => "foo-corp.com", | |
| "state" => "pending", | |
| ], | |
| ] | |
| ); |
| import com.workos.WorkOS; | |
| import com.workos.organizations.OrganizationsApi.CreateOrganizationOptions; | |
| import com.workos.organizations.models.Organization; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| CreateOrganizationOptions options = | |
| CreateOrganizationOptions.builder().name("Foo Corp").build(); | |
| Organization organization = workos.organizations.createOrganization(options); |
| WorkOS.SetApiKey("sk_example_123456789"); | |
| var organizationsService = new OrganizationsService(); | |
| var options = new CreateOrganizationOptions { | |
| Name = "Foo Corp", | |
| DomainData = | |
| new OrganizationDomainDataOptions[] { | |
| new OrganizationDomainDataOptions { | |
| Domain = "foo-corp.com", | |
| State = OrganizationDomainDataState.Pending, | |
| }, | |
| }, | |
| }; | |
| var organization = await organizationsService.CreateOrganization(options); |
| { | |
| "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.key = "sk_example_123456789" | |
| end | |
| organization = WorkOS::Organizations.update_organization( | |
| organization: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| name: "Foo Corp", | |
| domain_data: [ | |
| { | |
| domain: "foo-corp.com", | |
| state: "verified" | |
| } | |
| ] | |
| ) |
| from workos import WorkOSClient | |
| workos_client = WorkOSClient( | |
| api_key="sk_example_123456789", client_id="client_123456789" | |
| ) | |
| organization = workos_client.organizations.update_organization( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| name="Foo Corp", | |
| domain_data=[ | |
| { | |
| "domain": "foo-corp.com", | |
| "state": "verified", | |
| } | |
| ], | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v3/pkg/organizations" | |
| ) | |
| func main() { | |
| organizations.SetAPIKey("sk_example_123456789") | |
| org, err := organizations.UpdateOrganization( | |
| context.Background(), | |
| organizations.UpdateOrganizationOpts{ | |
| Organization: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| Name: "Foo Corp", | |
| DomainData: []OrganizationDomainData{ | |
| { | |
| Domain: "foo-corp.com", | |
| State: "verified", | |
| }, | |
| }, | |
| }, | |
| ) | |
| } |
| <?php | |
| WorkOS\WorkOS::setApiKey("sk_example_123456789"); | |
| $organizations = new WorkOS\Organizations(); | |
| $organization = $organizations->updateOrganization( | |
| organization: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| name: "Foo Corp", | |
| domain_data: [ | |
| [ | |
| "domain" => "foo-corp.com", | |
| "state" => "verified", | |
| ], | |
| ] | |
| ); |
| import com.workos.WorkOS; | |
| import com.workos.organizations.OrganizationsApi.UpdateOrganizationOptions; | |
| import com.workos.organizations.models.Organization; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| String organizationId = "org_01EHZNVPK3SFK441A1RGBFSHRT"; | |
| UpdateOrganizationOptions options = | |
| UpdateOrganizationOptions.builder().name("Foo Corp").build(); | |
| Organization organization = | |
| workos.organizations.updateOrganization(organizationId, options); |
| WorkOS.SetApiKey("sk_example_123456789"); | |
| var organizationsService = new OrganizationsService(); | |
| var options = new UpdateOrganizationOptions { | |
| Organization = "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| Name = "Foo Corp", | |
| DomainData = | |
| new OrganizationDomainDataOptions[] { | |
| new OrganizationDomainDataOptions { | |
| Domain = "foo-corp.com", | |
| State = OrganizationDomainDataState.Verified, | |
| }, | |
| }, | |
| }; | |
| var organization = await organizationsService.UpdateOrganization(options); |
| { | |
| "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.key = "sk_example_123456789" end WorkOS::Organizations.delete_organization( id: "org_01EHZNVPK3SFK441A1RGBFSHRT" )
from workos import WorkOSClient workos_client = WorkOSClient( api_key="sk_example_123456789", client_id="client_123456789" ) workos_client.organizations.delete_organization( organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT" )
package main import ( "context" "github.com/workos/workos-go/v3/pkg/organizations" ) func main() { organizations.SetAPIKey("sk_example_123456789") err := organizations.DeleteOrganization( context.Background(), organizations.DeleteOrganizationOpts{ Organization: "org_01EHZNVPK3SFK441A1RGBFSHRT", }, ) }
<?php WorkOS\WorkOS::setApiKey("sk_example_123456789"); $organizations = new WorkOS\Organizations(); $organizations->deleteOrganization("org_01EHZNVPK3SFK441A1RGBFSHRT");
import com.workos.WorkOS; WorkOS workos = new WorkOS("sk_example_123456789"); String organizationId = "org_01EHZNVPK3SFK441A1RGBFSHRT"; workos.organizations.deleteOrganization(organizationId);
WorkOS.SetApiKey("sk_example_123456789"); var organizationsService = new OrganizationsService(); await organizationsService.DeleteOrganization("org_01EHZNVPK3SFK441A1RGBFSHRT");
DELETE/organizations /:idParameters