Pinecone TypeScript SDK - v9.0.0
    Preparing search index...

    Class ProjectsResource

    Projects group indexes, assistants, and API keys within an organization. Access this resource through AdminClient.projects; do not construct it directly. Use AdminClient.organizations to manage the parent organization.

    import { AdminClient } from '@pinecone-database/pinecone';

    const admin = new AdminClient();
    const result = await admin.projects.list();
    Index
    • Creates a project.

      Parameters

      • options: CreateProjectRequest

        A descriptive project name, such as product-search.

      Returns Promise<Project>

      The project details, including its id.

      Errors.PineconeArgumentError when the project name is empty.

      import { AdminClient } from '@pinecone-database/pinecone';

      const admin = new AdminClient();
      const project = await admin.projects.create({ name: 'product-search' });
      console.log(project.id);
    • Deletes a project. Delete its indexes, assistants, backups, and collections first.

      Parameters

      • projectId: string

        The ID of the project to delete.

      Returns Promise<void>

      Resolves when the deletion request succeeds.

      Errors.PineconeArgumentError when projectId is empty.

      import { AdminClient } from '@pinecone-database/pinecone';

      const admin = new AdminClient();
      await admin.projects.delete('8a3e2d1c-0b9f-4e6d-8c7b-5a4f3e2d1c0b');
    • Retrieves a project by ID.

      Parameters

      • projectId: string

        The project ID returned when it was created or listed.

      Returns Promise<Project>

      The project details.

      Errors.PineconeArgumentError when projectId is empty.

      import { AdminClient } from '@pinecone-database/pinecone';

      const admin = new AdminClient();
      const result = await admin.projects.describe('8a3e2d1c-0b9f-4e6d-8c7b-5a4f3e2d1c0b');
      console.log(result);
    • Lists all projects in the organization.

      Returns Promise<ProjectList>

      Results in data.

      import { AdminClient } from '@pinecone-database/pinecone';

      const admin = new AdminClient();
      const result = await admin.projects.list();
      console.log(result.data);
    • Updates a project. Omitted fields remain unchanged.

      Parameters

      • projectId: string

        The ID of the project to update.

      • options: UpdateProjectRequest

        Fields to change, such as name.

      Returns Promise<Project>

      The updated project details.

      Errors.PineconeArgumentError when projectId is empty.

      import { AdminClient } from '@pinecone-database/pinecone';

      const admin = new AdminClient();
      const result = await admin.projects.update('8a3e2d1c-0b9f-4e6d-8c7b-5a4f3e2d1c0b', {
      name: 'product-search-prod',
      });
      console.log(result);