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', | |
| }); |
| { | |
| "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', | |
| }); |
| { | |
| "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', | |
| ); |
| { | |
| "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', | |
| }); |
| { | |
| "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', | |
| }); |
| { | |
| "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', | |
| }); |
| { | |
| "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, | |
| }); |
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, | |
| }); |
DELETE/authorization /organizations /:organization_id /resources /:resource_type_slug /:external_idParameters Returns