Grants a role to a user, service account, API key, or invite.
The principal, role, and resource scope. Supply resourceId for a project-scoped role.
The new role binding, including its id.
Errors.PineconeArgumentError when the principal ID, principal type, resource type, or role is empty.
import { AdminClient } from '@pinecone-database/pinecone';
const admin = new AdminClient();
const binding = await admin.roleBindings.create({
principalType: 'service_account',
principalId: '7e730a1d-8c0f-48f1-a9a3-1ac66fdd2ef4',
resourceType: 'project',
resourceId: '8a3e2d1c-0b9f-4e6d-8c7b-5a4f3e2d1c0b',
role: 'ProjectViewer',
});
console.log(binding.id);
Deletes a role binding, removing the role it grants.
The ID of the role binding to delete.
Resolves when the deletion request succeeds.
Errors.PineconeArgumentError when roleBindingId is empty.
Retrieves a role binding by ID.
The role binding ID returned when it was created or listed.
The role binding details.
Errors.PineconeArgumentError when roleBindingId is empty.
Lists one page of role bindings, optionally filtered by principal, resource, or role.
Filters and pagination settings. Omit to fetch the first page without filters.
Results in data; pass pagination.next as paginationToken to fetch the next page.
Role bindings grant a user, service account, API key, or invite a role on an organization or project. Access this resource through AdminClient.roleBindings; do not construct it directly. Use AdminClient.invites to invite someone who is not yet a member.
Example