# Members ## List workspace members `$ cadenya workspace-admin:members list` **get** `/v1/account/workspaces/{workspaceId}/members` Lists the members of a workspace. Admin only. ### Parameters - `--workspace-id: string` The workspace whose members will be listed (path). - `--cursor: optional string` Pagination cursor from previous response - `--limit: optional number` Maximum number of results to return ### Returns - `ListWorkspaceMembersResponse: object { items, pagination }` - `items: optional array of WorkspaceMember` - `actorId: string` The actor row linking the profile to the workspace (the junction record). - `profileId: string` The account profile that has access to the workspace. - `addedAt: optional string` When the member was added to the workspace. - `email: optional string` Email address of the member's profile. - `name: optional string` Display name of the member's profile. - `pagination: optional object { nextCursor, total }` - `nextCursor: optional string` - `total: optional number` ### Example ```cli cadenya workspace-admin:members list \ --api-key 'My API Key' \ --workspace-id workspaceId ``` #### 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 `$ cadenya workspace-admin:members add` **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` The workspace to add the member to (path). - `--email: optional string` Email address to add (resolve-or-invite). Mutually exclusive with profile_id. - `--profile-id: optional string` An existing account profile to add. Mutually exclusive with email. ### Returns - `workspace_member: object { actorId, profileId, addedAt, 2 more }` 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. - `actorId: string` The actor row linking the profile to the workspace (the junction record). - `profileId: string` The account profile that has access to the workspace. - `addedAt: optional string` When the member was added to the workspace. - `email: optional string` Email address of the member's profile. - `name: optional string` Display name of the member's profile. ### Example ```cli cadenya workspace-admin:members add \ --api-key 'My API Key' \ --workspace-id workspaceId ``` #### Response ```json { "actorId": "actorId", "profileId": "profileId", "addedAt": "2019-12-27T18:11:19.117Z", "email": "email", "name": "name" } ``` ## Remove a member from a workspace `$ cadenya workspace-admin:members remove` **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` The workspace to remove the member from (path). - `--profile-id: string` The profile to remove from the workspace (path). ### Example ```cli cadenya workspace-admin:members remove \ --api-key 'My API Key' \ --workspace-id workspaceId \ --profile-id profileId ```