Help & Support

Team Management

This guide explains how to manage your team's access to your Lens primitives.

Lens uses a unified approach to access control for its primitives (apps, graphs, feeds, etc.). There are two types of roles:

  • Owner: The owner has full control over a primitive, including adding and removing admins and transferring ownership. The initial owner is the address that creates the primitive.

  • Admin: An admin can perform most actions except transferring ownership. See the individual primitive documentation for more details.

This document identifies as primitives the following Lens entities:

The steps are the same for all primitives, so we will just refer to them their primitive address.

Add Admins

You MUST be authenticated as Builder to make this request.

1

Prepare the Request

Use the addAdmins action to add Admins to an owned primitive.

Example
import { evmAddress } from "@lens-protocol/client";import { addAdmins } from "@lens-protocol/client/actions";
const result = await addAdmins(sessionClient, {  admins: [evmAddress("0x1234…"), evmAddress("0x5678…")],  address: evmAddress("0x90ab…"), // address of the primitive (app/graph/feed/etc)});

2

Handle Result

Finally, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await addAdmins(sessionClient, {  admins: [evmAddress("0x1234…"), evmAddress("0x5678…")],  address: evmAddress("0x3243…"),}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

Remove Admins

1

Prepare the Request

You MUST be authenticated as Builder to make this request.

Use the removeAdmins action to remove Admins from an owned primitive.

Example
import { evmAddress } from "@lens-protocol/client";import { removeAdmins } from "@lens-protocol/client/actions";
const result = await removeAdmins(sessionClient, {  admins: [evmAddress("0x1234…"), evmAddress("0x5678…")],  address: evmAddress("0x90ab…"), // address of the primitive (app/graph/feed/etc)});

2

Handle Result

Finally, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await removeAdmins(sessionClient, {  admins: [evmAddress("0x1234…"), evmAddress("0x5678…")],  address: evmAddress("0x3243…"),}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

Fetch Admins

In some cases, you may need to fetch the list of admins for a primitive.

Since a Lens Account, by being a smart wallet, can potentially be a primitive's admin, you can also search admins by their username.

Use the paginated fetchAdminsFor action to fetch a list of admins for a primitive.

import { evmAddress } from "@lens-protocol/client";import { fetchAdminsFor } from "@lens-protocol/client/actions";
import { client } from "./client";
const result = await fetchAdminsFor(client, {  address: evmAddress("0x1234…"),});
if (result.isErr()) {  return console.error(result.error);}
// items: Array<Admin>: [{ account: Account, addedAt: DateTime }, …]const { items, pageInfo } = result.value;

See the Pagination guide for more information on how to handle paginated results.

Transfer Ownership

The owner of a primitive can transfer ownership to another address.

1

Prepare the Request

You MUST be authenticated as Builder to make this request.

Use the transferPrimitiveOwnership action to prepare the transfer of ownership of a primitive.

Example
import { evmAddress } from "@lens-protocol/client";import { transferPrimitiveOwnership } from "@lens-protocol/client/actions";
const result = await transferPrimitiveOwnership(sessionClient, {  address: evmAddress("0x5678…"),  newOwner: evmAddress("0x1234…"),});

2

Handle Result

Finally, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await transferPrimitiveOwnership(sessionClient, {  address: evmAddress("0x5678…"),  newOwner: evmAddress("0x1234…"),}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.