A resource is an instance of a resource type that represents an entity in your application. Resources can be workspaces, projects, apps, or any other object that users can access.
Resources are organized in a hierarchy. When a role is assigned to a user on a parent resource, they automatically gain access to child resources through permission inheritance.
Get a paginated list of authorization resources.
curl "https://api.workos.com/authorization/resources" \ --header "Authorization: Bearer sk_example_123456789"
{ "object": "list", "data": [ { "object": "authorization_resource", "name": "Website Redesign", "description": "Company website redesign project", "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", "id": "authz_resource_01HXYZ123456789ABCDEFGH", "external_id": "proj-456", "resource_type_slug": "project", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" } ], "list_metadata": { "before": "authz_resource_01HXYZ123456789ABCDEFGHIJ", "after": "authz_resource_01HXYZ987654321KJIHGFEDCBA" } }
| curl "https://api.workos.com/authorization/resources" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const resources = await workos.authorization.listResources({ | |
| organizationId: 'org_01ABC123', | |
| resourceTypeSlug: 'project', | |
| parentResourceId: 'authz_resource_01XYZ789', | |
| search: 'budget', | |
| limit: 10, | |
| order: 'desc', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.authorization.list_resources |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.authorization.list_resources() |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Authorization().ListResources(context.Background()) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->authorization()->listResources(); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.authorization.listResources(); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Authorization.ListResourcesAsync(); |
| 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 | |
| .authorization() | |
| .list_resources() | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "list", | |
| "data": [ | |
| { | |
| "object": "authorization_resource", | |
| "name": "Website Redesign", | |
| "description": "Company website redesign project", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", | |
| "id": "authz_resource_01HXYZ123456789ABCDEFGH", | |
| "external_id": "proj-456", | |
| "resource_type_slug": "project", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } | |
| ], | |
| "list_metadata": { | |
| "before": "authz_resource_01HXYZ123456789ABCDEFGHIJ", | |
| "after": "authz_resource_01HXYZ987654321KJIHGFEDCBA" | |
| } | |
| } |
GET/authorization /resourcesParameters Returns objectCreate a new authorization resource. The resource is associated with an organization and resource type.
You can optionally specify a parent resource to place it in a hierarchy. The parent can be identified either by parent_resource_id or by the combination of parent_resource_external_id and parent_resource_type_slug.
The external_id must be unique within the organization and resource type
combination.
curl --request POST \ --url "https://api.workos.com/authorization/resources" \ --header "Authorization: Bearer sk_example_123456789" \ --header "Content-Type: application/json" \ -d @- <<'BODY' { "external_id": "my-workspace-01", "name": "Acme Workspace", "resource_type_slug": "workspace", "organization_id": "org_01EHQMYV6MBK39QC5PZXHY59C3" } BODY
{ "object": "authorization_resource", "name": "Acme Workspace", "description": "Primary workspace for the Acme team", "organization_id": "org_01EHQMYV6MBK39QC5PZXHY59C3", "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", "id": "authz_resource_01HXYZ123456789ABCDEFGH", "external_id": "my-workspace-01", "resource_type_slug": "workspace", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl --request POST \ | |
| --url "https://api.workos.com/authorization/resources" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "external_id": "my-workspace-01", | |
| "name": "Acme Workspace", | |
| "resource_type_slug": "workspace", | |
| "organization_id": "org_01EHQMYV6MBK39QC5PZXHY59C3" | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| // Option 1: by parent resource ID | |
| const resource = await workos.authorization.createResource({ | |
| organizationId: 'org_01ABC123', | |
| resourceTypeSlug: 'project', | |
| externalId: 'proj-456', | |
| name: 'Website Redesign', | |
| description: 'Company website redesign project', | |
| parentResourceId: 'authz_resource_01XYZ789', | |
| }); | |
| // Option 2: by parent external ID + type | |
| const resourceByExternal = await workos.authorization.createResource({ | |
| organizationId: 'org_01ABC123', | |
| resourceTypeSlug: 'project', | |
| externalId: 'proj-789', | |
| name: 'Mobile App', | |
| parentResourceExternalId: 'ws-123', | |
| parentResourceTypeSlug: 'workspace', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.authorization.create_resource( | |
| external_id: "my-workspace-01", | |
| name: "Acme Workspace", | |
| resource_type_slug: "workspace", | |
| organization_id: "org_01EHQMYV6MBK39QC5PZXHY59C3" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.authorization.create_resource( | |
| external_id="my-workspace-01", | |
| name="Acme Workspace", | |
| resource_type_slug="workspace", | |
| organization_id="org_01EHQMYV6MBK39QC5PZXHY59C3", | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Authorization().CreateResource(context.Background(), &workos.AuthorizationCreateResourceParams{ | |
| ExternalID: "my-workspace-01", | |
| Name: "Acme Workspace", | |
| ResourceTypeSlug: "workspace", | |
| OrganizationID: "org_01EHQMYV6MBK39QC5PZXHY59C3", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->authorization() | |
| ->createResource( | |
| externalId: "my-workspace-01", | |
| name: "Acme Workspace", | |
| resourceTypeSlug: "workspace", | |
| organizationId: "org_01EHQMYV6MBK39QC5PZXHY59C3", | |
| ); |
| import com.workos.WorkOS; | |
| import com.workos.authorization.AuthorizationApi.CreateResourceOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| CreateResourceOptions options = CreateResourceOptions.builder() | |
| .externalId("my-workspace-01") | |
| .name("Acme Workspace") | |
| .resourceTypeSlug("workspace") | |
| .organizationId("org_01EHQMYV6MBK39QC5PZXHY59C3") | |
| .build(); | |
| workos.authorization.createResource(options); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Authorization.CreateResourceAsync(new AuthorizationCreateResourceOptions { | |
| ExternalId = "my-workspace-01", | |
| Name = "Acme Workspace", | |
| ResourceTypeSlug = "workspace", | |
| OrganizationId = "org_01EHQMYV6MBK39QC5PZXHY59C3", | |
| }); |
| use workos::Client; | |
| use workos::authorization::CreateResourceParams; | |
| #[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 | |
| .authorization() | |
| .create_resource( | |
| CreateResourceParams { | |
| external_id: "my-workspace-01".into(), | |
| name: "Acme Workspace".into(), | |
| resource_type_slug: "workspace".into(), | |
| organization_id: "org_01EHQMYV6MBK39QC5PZXHY59C3".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "authorization_resource", | |
| "name": "Acme Workspace", | |
| "description": "Primary workspace for the Acme team", | |
| "organization_id": "org_01EHQMYV6MBK39QC5PZXHY59C3", | |
| "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", | |
| "id": "authz_resource_01HXYZ123456789ABCDEFGH", | |
| "external_id": "my-workspace-01", | |
| "resource_type_slug": "workspace", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
POST/authorization /resourcesReturns Retrieve the details of an authorization resource by its ID.
curl "https://api.workos.com/authorization/resources/authz_resource_01HXYZ123456789ABCDEFGHIJ" \ --header "Authorization: Bearer sk_example_123456789"
{ "object": "authorization_resource", "name": "Website Redesign", "description": "Company website redesign project", "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", "id": "authz_resource_01HXYZ123456789ABCDEFGH", "external_id": "proj-456", "resource_type_slug": "project", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl "https://api.workos.com/authorization/resources/authz_resource_01HXYZ123456789ABCDEFGHIJ" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const resource = await workos.authorization.getResource( | |
| 'authz_resource_01HXYZ123456789ABCDEFGH', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.authorization.get_resource(resource_id: "authz_resource_01HXYZ123456789ABCDEFGHIJ") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.authorization.get_resource( | |
| resource_id="authz_resource_01HXYZ123456789ABCDEFGHIJ" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Authorization().GetResource(context.Background(), "authz_resource_01HXYZ123456789ABCDEFGHIJ") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->authorization() | |
| ->getResource(resourceId: "authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.authorization.getResource("authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Authorization.GetResourceAsync("authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| 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 | |
| .authorization() | |
| .get_resource("authz_resource_01HXYZ123456789ABCDEFGHIJ") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "authorization_resource", | |
| "name": "Website Redesign", | |
| "description": "Company website redesign project", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", | |
| "id": "authz_resource_01HXYZ123456789ABCDEFGH", | |
| "external_id": "proj-456", | |
| "resource_type_slug": "project", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
GET/authorization /resources /:resource_idParameters Returns Retrieve the details of an authorization resource by its external ID, organization, and resource type. This is useful when you only have the external ID from your system and need to fetch the full resource details.
curl "https://api.workos.com/authorization/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/resources/project/proj-456" \ --header "Authorization: Bearer sk_example_123456789"
{ "object": "authorization_resource", "name": "Website Redesign", "description": "Company website redesign project", "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", "id": "authz_resource_01HXYZ123456789ABCDEFGH", "external_id": "proj-456", "resource_type_slug": "project", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl "https://api.workos.com/authorization/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/resources/project/proj-456" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const resource = await workos.authorization.getResourceByExternalId({ | |
| organizationId: 'org_01ABC123', | |
| resourceTypeSlug: 'project', | |
| externalId: 'proj-456', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.authorization.get_resource_by_external_id( | |
| organization_id: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resource_type_slug: "project", | |
| external_id: "proj-456" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.authorization.get_resource_by_external_id( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resource_type_slug="project", | |
| external_id="proj-456", | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Authorization().GetResourceByExternalID(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->authorization() | |
| ->getResourceByExternalId( | |
| organizationId: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resourceTypeSlug: "project", | |
| externalId: "proj-456", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.authorization.getResourceByExternalId( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Authorization.GetResourceByExternalIdAsync("org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456"); |
| 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 | |
| .authorization() | |
| .get_resource_by_external_id( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "project", | |
| "proj-456" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "authorization_resource", | |
| "name": "Website Redesign", | |
| "description": "Company website redesign project", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", | |
| "id": "authz_resource_01HXYZ123456789ABCDEFGH", | |
| "external_id": "proj-456", | |
| "resource_type_slug": "project", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
GET/authorization /organizations /:organization_id /resources /:resource_type_slug /:external_idParameters Returns Update an existing authorization resource.
curl --request PATCH \ --url "https://api.workos.com/authorization/resources/authz_resource_01HXYZ123456789ABCDEFGHIJ" \ --header "Authorization: Bearer sk_example_123456789" \ --header "Content-Type: application/json" \ -d @- <<'BODY' { "name": "Updated Name", "description": "Updated description", "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ" } BODY
{ "object": "authorization_resource", "name": "Updated Name", "description": "Updated description", "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", "id": "authz_resource_01HXYZ123456789ABCDEFGH", "external_id": "proj-456", "resource_type_slug": "project", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl --request PATCH \ | |
| --url "https://api.workos.com/authorization/resources/authz_resource_01HXYZ123456789ABCDEFGHIJ" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "name": "Updated Name", | |
| "description": "Updated description", | |
| "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ" | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const resource = await workos.authorization.updateResource({ | |
| resourceId: 'authz_resource_01HXYZ123456789ABCDEFGH', | |
| name: 'Updated Name', | |
| description: 'Updated description', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.authorization.update_resource(resource_id: "authz_resource_01HXYZ123456789ABCDEFGHIJ") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.authorization.update_resource( | |
| resource_id="authz_resource_01HXYZ123456789ABCDEFGHIJ" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Authorization().UpdateResource(context.Background(), "authz_resource_01HXYZ123456789ABCDEFGHIJ") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->authorization() | |
| ->updateResource(resourceId: "authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.authorization.updateResource("authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Authorization.UpdateResourceAsync("authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| 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 | |
| .authorization() | |
| .update_resource("authz_resource_01HXYZ123456789ABCDEFGHIJ") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "authorization_resource", | |
| "name": "Updated Name", | |
| "description": "Updated description", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", | |
| "id": "authz_resource_01HXYZ123456789ABCDEFGH", | |
| "external_id": "proj-456", | |
| "resource_type_slug": "project", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
PATCH/authorization /resources /:resource_idParameters Returns Update an existing authorization resource using its external ID.
curl --request PATCH \ --url "https://api.workos.com/authorization/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/resources/project/proj-456" \ --header "Authorization: Bearer sk_example_123456789" \ --header "Content-Type: application/json" \ -d @- <<'BODY' { "name": "Updated Name", "description": "Updated description", "parent_resource_external_id": "parent-workspace-01", "parent_resource_type_slug": "workspace" } BODY
{ "object": "authorization_resource", "name": "Updated Name", "description": "Updated description", "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", "id": "authz_resource_01HXYZ123456789ABCDEFGH", "external_id": "proj-456", "resource_type_slug": "project", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z" }
| curl --request PATCH \ | |
| --url "https://api.workos.com/authorization/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/resources/project/proj-456" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "name": "Updated Name", | |
| "description": "Updated description", | |
| "parent_resource_external_id": "parent-workspace-01", | |
| "parent_resource_type_slug": "workspace" | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const resource = await workos.authorization.updateResourceByExternalId({ | |
| organizationId: 'org_01ABC123', | |
| resourceTypeSlug: 'project', | |
| externalId: 'proj-456', | |
| name: 'Updated Name', | |
| description: 'Updated description', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.authorization.update_resource_by_external_id( | |
| organization_id: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resource_type_slug: "project", | |
| external_id: "proj-456" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.authorization.update_resource_by_external_id( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resource_type_slug="project", | |
| external_id="proj-456", | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Authorization().UpdateResourceByExternalID(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->authorization() | |
| ->updateResourceByExternalId( | |
| organizationId: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resourceTypeSlug: "project", | |
| externalId: "proj-456", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.authorization.updateResourceByExternalId( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Authorization.UpdateResourceByExternalIdAsync("org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456"); |
| 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 | |
| .authorization() | |
| .update_resource_by_external_id( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "project", | |
| "proj-456" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "authorization_resource", | |
| "name": "Updated Name", | |
| "description": "Updated description", | |
| "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "parent_resource_id": "authz_resource_01HXYZ123456789ABCDEFGHIJ", | |
| "id": "authz_resource_01HXYZ123456789ABCDEFGH", | |
| "external_id": "proj-456", | |
| "resource_type_slug": "project", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z" | |
| } |
PATCH/authorization /organizations /:organization_id /resources /:resource_type_slug /:external_idParameters Returns Delete an authorization resource. By default, this will fail if the resource has child resources or role assignments. Set cascade_delete to true to delete the resource along with all its descendants and role assignments.
Deleting a resource also removes all role assignments on that resource. This action cannot be undone.
curl --request DELETE \ --url "https://api.workos.com/authorization/resources/authz_resource_01HXYZ123456789ABCDEFGHIJ" \ --header "Authorization: Bearer sk_example_123456789"
| curl --request DELETE \ | |
| --url "https://api.workos.com/authorization/resources/authz_resource_01HXYZ123456789ABCDEFGHIJ" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| await workos.authorization.deleteResource({ | |
| resourceId: 'authz_resource_01HXYZ123456789ABCDEFGH', | |
| cascadeDelete: true, | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.authorization.delete_resource(resource_id: "authz_resource_01HXYZ123456789ABCDEFGHIJ") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.authorization.delete_resource( | |
| resource_id="authz_resource_01HXYZ123456789ABCDEFGHIJ" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Authorization().DeleteResource(context.Background(), "authz_resource_01HXYZ123456789ABCDEFGHIJ") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->authorization() | |
| ->deleteResource(resourceId: "authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.authorization.deleteResource("authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Authorization.DeleteResourceAsync("authz_resource_01HXYZ123456789ABCDEFGHIJ"); |
| 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 | |
| .authorization() | |
| .delete_resource("authz_resource_01HXYZ123456789ABCDEFGHIJ") | |
| .await?; | |
| Ok(()) | |
| } |
DELETE/authorization /resources /:resource_idParameters Returns Delete an authorization resource using its external ID. By default, this will fail if the resource has child resources or role assignments. Set cascade_delete to true to delete the resource along with all its descendants and role assignments.
Deleting a resource also removes all role assignments on that resource. This action cannot be undone.
curl --request DELETE \ --url "https://api.workos.com/authorization/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/resources/project/proj-456" \ --header "Authorization: Bearer sk_example_123456789"
| curl --request DELETE \ | |
| --url "https://api.workos.com/authorization/organizations/org_01EHZNVPK3SFK441A1RGBFSHRT/resources/project/proj-456" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| await workos.authorization.deleteResourceByExternalId({ | |
| organizationId: 'org_01ABC123', | |
| resourceTypeSlug: 'project', | |
| externalId: 'proj-456', | |
| cascadeDelete: true, | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.authorization.delete_resource_by_external_id( | |
| organization_id: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resource_type_slug: "project", | |
| external_id: "proj-456" | |
| ) |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.authorization.delete_resource_by_external_id( | |
| organization_id="org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resource_type_slug="project", | |
| external_id="proj-456", | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.Authorization().DeleteResourceByExternalID(context.Background(), "org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->authorization() | |
| ->deleteResourceByExternalId( | |
| organizationId: "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| resourceTypeSlug: "project", | |
| externalId: "proj-456", | |
| ); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.authorization.deleteResourceByExternalId( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.Authorization.DeleteResourceByExternalIdAsync("org_01EHZNVPK3SFK441A1RGBFSHRT", "project", "proj-456"); |
| 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 | |
| .authorization() | |
| .delete_resource_by_external_id( | |
| "org_01EHZNVPK3SFK441A1RGBFSHRT", | |
| "project", | |
| "proj-456" | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
DELETE/authorization /organizations /:organization_id /resources /:resource_type_slug /:external_idParameters Returns