# Members ## List workspace members `workspace_admin.members.list(workspace_id, **kwargs) -> CursorPagination` **get** `/v1/account/workspaces/{workspaceId}/members` Lists the members of a workspace. Admin only. ### Parameters - `workspace_id: String` - `cursor: String` Pagination cursor from previous response - `limit: Integer` Maximum number of results to return ### Returns - `class WorkspaceMember` A member of a workspace: the profile granted access plus the actor row that links it to the workspace. Returned by member list/add operations. - `actor_id: String` The actor row linking the profile to the workspace (the junction record). - `profile_id: String` The account profile that has access to the workspace. - `added_at: Time` When the member was added to the workspace. - `email: String` Email address of the member's profile. - `name: String` Display name of the member's profile. ### Example ```ruby require "cadenya" cadenya = Cadenya::Client.new(api_key: "My API Key") page = cadenya.workspace_admin.members.list("workspaceId") puts(page) ``` #### Response ```json { "items": [ { "actorId": "actorId", "profileId": "profileId", "addedAt": "2019-12-27T18:11:19.117Z", "email": "email", "name": "name" } ], "pagination": { "nextCursor": "nextCursor", "total": 0 } } ``` ## Add a member to a workspace `workspace_admin.members.add(workspace_id, **kwargs) -> WorkspaceMember` **post** `/v1/account/workspaces/{workspaceId}/members` Grants a profile access to the workspace by creating (or reactivating) the actor that links the profile to the workspace. Accepts either an existing profile_id or an email to resolve-or-invite. Idempotent for an already-active member. Admin only. ### Parameters - `workspace_id: String` - `email: String` Email address to add (resolve-or-invite). Mutually exclusive with profile_id. - `profile_id: String` An existing account profile to add. Mutually exclusive with email. ### Returns - `class WorkspaceMember` A member of a workspace: the profile granted access plus the actor row that links it to the workspace. Returned by member list/add operations. - `actor_id: String` The actor row linking the profile to the workspace (the junction record). - `profile_id: String` The account profile that has access to the workspace. - `added_at: Time` When the member was added to the workspace. - `email: String` Email address of the member's profile. - `name: String` Display name of the member's profile. ### Example ```ruby require "cadenya" cadenya = Cadenya::Client.new(api_key: "My API Key") workspace_member = cadenya.workspace_admin.members.add("workspaceId") puts(workspace_member) ``` #### Response ```json { "actorId": "actorId", "profileId": "profileId", "addedAt": "2019-12-27T18:11:19.117Z", "email": "email", "name": "name" } ``` ## Remove a member from a workspace `workspace_admin.members.remove(profile_id, **kwargs) -> void` **delete** `/v1/account/workspaces/{workspaceId}/members/{profileId}` Revokes a member's access by deactivating their actor; the member is immediately cut off. The underlying profile is not deleted. Admin only. ### Parameters - `workspace_id: String` - `profile_id: String` ### Example ```ruby require "cadenya" cadenya = Cadenya::Client.new(api_key: "My API Key") result = cadenya.workspace_admin.members.remove("profileId", workspace_id: "workspaceId") puts(result) ```