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

    Class ServiceAccountsResource

    Service accounts authenticate applications that administer an organization. Access this resource through AdminClient.serviceAccounts; do not construct it directly. Use AdminClient.apiKeys for project API keys.

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

    const admin = new AdminClient();
    const result = await admin.serviceAccounts.list();
    Index
    • Creates a service account. Save the client secret; it cannot be retrieved later.

      Parameters

      • options: CreateServiceAccountRequest

        The service account name and optional role bindings. Omit bindings to assign roles later.

      Returns Promise<ServiceAccountWithSecret>

      The account details in serviceAccount and the secret in clientSecret.

      Errors.PineconeArgumentError when the service account name is empty.

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

      const admin = new AdminClient();
      const result = await admin.serviceAccounts.create({ name: 'catalog-sync' });
      console.log(result.serviceAccount);
    • Deletes a service account.

      Parameters

      • serviceAccountId: string

        The ID of the service account to delete.

      Returns Promise<void>

      Resolves when the deletion request succeeds.

      Errors.PineconeArgumentError when serviceAccountId is empty.

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

      const admin = new AdminClient();
      await admin.serviceAccounts.delete('7e730a1d-8c0f-48f1-a9a3-1ac66fdd2ef4');
    • Retrieves a service account by ID.

      Parameters

      • serviceAccountId: string

        The service account ID returned when it was created or listed.

      Returns Promise<ServiceAccount>

      The service account details.

      Errors.PineconeArgumentError when serviceAccountId is empty.

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

      const admin = new AdminClient();
      const result = await admin.serviceAccounts.describe('7e730a1d-8c0f-48f1-a9a3-1ac66fdd2ef4');
      console.log(result);
    • Replaces a service account client secret, invalidating the previous secret.

      Save the new secret; it cannot be retrieved later.

      Parameters

      • serviceAccountId: string

        The ID of the service account whose secret to replace.

      Returns Promise<ServiceAccountWithSecret>

      The account details in serviceAccount and the new secret in clientSecret.

      Errors.PineconeArgumentError when the service account ID is empty.

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

      const admin = new AdminClient();
      const result = await admin.serviceAccounts.rotateSecret('7e730a1d-8c0f-48f1-a9a3-1ac66fdd2ef4');
      console.log(result.serviceAccount);
    • Updates a service account. Omitted fields remain unchanged.

      Parameters

      • serviceAccountId: string

        The ID of the service account to update.

      • options: UpdateServiceAccountRequest

        Fields to change, such as name.

      Returns Promise<ServiceAccount>

      The updated service account details.

      Errors.PineconeArgumentError when serviceAccountId is empty.

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

      const admin = new AdminClient();
      const result = await admin.serviceAccounts.update('7e730a1d-8c0f-48f1-a9a3-1ac66fdd2ef4', {
      name: 'catalog-sync-prod',
      });
      console.log(result);