Implementation:Elevenlabs Elevenlabs python ResourceMetadataResponseModel
| Metadata | Value |
|---|---|
| source | Elevenlabs_Elevenlabs_python |
| domain | Workspace, Access Control, Sharing |
| last_updated | 2026-02-15 |
Overview
Description: ResourceMetadataResponseModel is a Pydantic model that represents the metadata and access control information for a shared resource within an ElevenLabs workspace. It includes the resource identity (resource ID, resource type), creator information, anonymous access level override for public sharing, role-to-group mappings for granular access control, and a list of sharing options for users who do not yet have access to the resource.
Usage: This model is returned by the ElevenLabs API when querying resource metadata within a workspace. It enables managing resource sharing permissions, checking who has access to a resource, configuring public access levels, and discovering available sharing options for new users.
Code Reference
Source file: src/elevenlabs/types/resource_metadata_response_model.py
Class signature:
class ResourceMetadataResponseModel(UncheckedBaseModel):
...
Import statement:
from elevenlabs.types import ResourceMetadataResponseModel
I/O Contract
| Field | Type | Required | Description |
|---|---|---|---|
| resource_id | str | Yes | The ID of the resource |
| resource_type | WorkspaceResourceType | Yes | The type of the resource |
| creator_user_id | Optional[str] | No | The ID of the user who created the resource |
| anonymous_access_level_override | Optional[ResourceMetadataResponseModelAnonymousAccessLevelOverride] | No | The access level for anonymous users; if None, the resource is not shared publicly |
| role_to_group_ids | Dict[str, List[str]] | Yes | A mapping of roles to group IDs; when shared with a user, the group ID is the user's ID |
| share_options | List[ShareOptionResponseModel] | Yes | List of options for sharing the resource further in the workspace (users without access) |
Usage Examples
from elevenlabs.types import ResourceMetadataResponseModel
# Working with resource metadata from the API
resource = ResourceMetadataResponseModel(
resource_id="res_abc123",
resource_type="voice",
creator_user_id="user_xyz789",
role_to_group_ids={
"editor": ["group_001", "user_002"],
"viewer": ["group_003"],
},
share_options=[],
)
# Check resource ownership
print(f"Resource: {resource.resource_id}")
print(f"Type: {resource.resource_type}")
print(f"Creator: {resource.creator_user_id}")
# Inspect access control
for role, group_ids in resource.role_to_group_ids.items():
print(f"Role '{role}': {len(group_ids)} groups/users")
# Check public access
if resource.anonymous_access_level_override is not None:
print(f"Public access: {resource.anonymous_access_level_override}")
else:
print("Not publicly shared")