// Requires Node.js SDK v8.2.0 or later
import { AdminClient } from '@pinecone-database/pinecone';
// Reads PINECONE_CLIENT_ID and PINECONE_CLIENT_SECRET from the environment
const admin = new AdminClient();
const serviceAccount = await admin.serviceAccounts.update('YOUR_SERVICE_ACCOUNT_ID', {
name: 'ci-prod-renamed',
});
console.log(serviceAccount);
// Requires Go SDK v6.0.0 or later
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v6/pinecone"
)
func main() {
ctx := context.Background()
adminClient, err := pinecone.NewAdminClientWithContext(ctx, pinecone.NewAdminClientParams{
ClientId: os.Getenv("PINECONE_CLIENT_ID"),
ClientSecret: os.Getenv("PINECONE_CLIENT_SECRET"),
})
if err != nil {
log.Fatalf("Failed to create AdminClient: %v", err)
}
name := "ci-prod-renamed"
sa, err := adminClient.ServiceAccount.Update(ctx, "YOUR_SERVICE_ACCOUNT_ID", &pinecone.UpdateServiceAccountParams{
Name: &name,
})
if err != nil {
log.Fatalf("Failed to update service account: %v", err)
}
fmt.Printf("Successfully updated service account: %v\n", sa.Name)
}
# Requires Terraform provider v4.0.0 or later
# Change the name on an existing resource, then run `terraform apply`
resource "pinecone_service_account" "ci_prod" {
name = "ci-prod-renamed"
}
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
PINECONE_SERVICE_ACCOUNT_ID="YOUR_SERVICE_ACCOUNT_ID"
curl -X PATCH "https://api.pinecone.io/admin/service-accounts/$PINECONE_SERVICE_ACCOUNT_ID" \
-H "X-Pinecone-Api-Version: 2026-04" \
-H "Authorization: Bearer $PINECONE_ACCESS_TOKEN" \
-d '{
"name": "ci-prod-renamed"
}'
{
"id": "f8a3b2c1-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"name": "ci-prod-renamed",
"client_id": "l3Ow0CmFyc4jOONcwiKUCRqQKN0tiCAn",
"created_at": "2026-04-10T15:23:00Z",
"updated_at": "2026-04-12T09:11:00Z"
}
Update a service account
Update a service account’s name; role bindings are managed through the role-binding endpoints.
// Requires Node.js SDK v8.2.0 or later
import { AdminClient } from '@pinecone-database/pinecone';
// Reads PINECONE_CLIENT_ID and PINECONE_CLIENT_SECRET from the environment
const admin = new AdminClient();
const serviceAccount = await admin.serviceAccounts.update('YOUR_SERVICE_ACCOUNT_ID', {
name: 'ci-prod-renamed',
});
console.log(serviceAccount);
// Requires Go SDK v6.0.0 or later
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v6/pinecone"
)
func main() {
ctx := context.Background()
adminClient, err := pinecone.NewAdminClientWithContext(ctx, pinecone.NewAdminClientParams{
ClientId: os.Getenv("PINECONE_CLIENT_ID"),
ClientSecret: os.Getenv("PINECONE_CLIENT_SECRET"),
})
if err != nil {
log.Fatalf("Failed to create AdminClient: %v", err)
}
name := "ci-prod-renamed"
sa, err := adminClient.ServiceAccount.Update(ctx, "YOUR_SERVICE_ACCOUNT_ID", &pinecone.UpdateServiceAccountParams{
Name: &name,
})
if err != nil {
log.Fatalf("Failed to update service account: %v", err)
}
fmt.Printf("Successfully updated service account: %v\n", sa.Name)
}
# Requires Terraform provider v4.0.0 or later
# Change the name on an existing resource, then run `terraform apply`
resource "pinecone_service_account" "ci_prod" {
name = "ci-prod-renamed"
}
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
PINECONE_SERVICE_ACCOUNT_ID="YOUR_SERVICE_ACCOUNT_ID"
curl -X PATCH "https://api.pinecone.io/admin/service-accounts/$PINECONE_SERVICE_ACCOUNT_ID" \
-H "X-Pinecone-Api-Version: 2026-04" \
-H "Authorization: Bearer $PINECONE_ACCESS_TOKEN" \
-d '{
"name": "ci-prod-renamed"
}'
{
"id": "f8a3b2c1-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"name": "ci-prod-renamed",
"client_id": "l3Ow0CmFyc4jOONcwiKUCRqQKN0tiCAn",
"created_at": "2026-04-10T15:23:00Z",
"updated_at": "2026-04-12T09:11:00Z"
}
// Requires Node.js SDK v8.2.0 or later
import { AdminClient } from '@pinecone-database/pinecone';
// Reads PINECONE_CLIENT_ID and PINECONE_CLIENT_SECRET from the environment
const admin = new AdminClient();
const serviceAccount = await admin.serviceAccounts.update('YOUR_SERVICE_ACCOUNT_ID', {
name: 'ci-prod-renamed',
});
console.log(serviceAccount);
// Requires Go SDK v6.0.0 or later
package main
import (
"context"
"fmt"
"log"
"os"
"github.com/pinecone-io/go-pinecone/v6/pinecone"
)
func main() {
ctx := context.Background()
adminClient, err := pinecone.NewAdminClientWithContext(ctx, pinecone.NewAdminClientParams{
ClientId: os.Getenv("PINECONE_CLIENT_ID"),
ClientSecret: os.Getenv("PINECONE_CLIENT_SECRET"),
})
if err != nil {
log.Fatalf("Failed to create AdminClient: %v", err)
}
name := "ci-prod-renamed"
sa, err := adminClient.ServiceAccount.Update(ctx, "YOUR_SERVICE_ACCOUNT_ID", &pinecone.UpdateServiceAccountParams{
Name: &name,
})
if err != nil {
log.Fatalf("Failed to update service account: %v", err)
}
fmt.Printf("Successfully updated service account: %v\n", sa.Name)
}
# Requires Terraform provider v4.0.0 or later
# Change the name on an existing resource, then run `terraform apply`
resource "pinecone_service_account" "ci_prod" {
name = "ci-prod-renamed"
}
PINECONE_ACCESS_TOKEN="YOUR_ACCESS_TOKEN"
PINECONE_SERVICE_ACCOUNT_ID="YOUR_SERVICE_ACCOUNT_ID"
curl -X PATCH "https://api.pinecone.io/admin/service-accounts/$PINECONE_SERVICE_ACCOUNT_ID" \
-H "X-Pinecone-Api-Version: 2026-04" \
-H "Authorization: Bearer $PINECONE_ACCESS_TOKEN" \
-d '{
"name": "ci-prod-renamed"
}'
{
"id": "f8a3b2c1-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
"name": "ci-prod-renamed",
"client_id": "l3Ow0CmFyc4jOONcwiKUCRqQKN0tiCAn",
"created_at": "2026-04-10T15:23:00Z",
"updated_at": "2026-04-12T09:11:00Z"
}
Authorizations
An access token must be provided in the Authorization header using the Bearer scheme.
Headers
Required date-based version header
Path Parameters
The unique identifier of the service account.
Body
Updated metadata for the service account.
A new name for the service account. If omitted, the name is unchanged.
1 - 80"ci-prod-renamed"
Response
Service account updated successfully.
A service account. The OAuth client_secret is not included.
The unique identifier for the service account. Use this as the path parameter on /admin/service-accounts/{service_account_id} endpoints and as the principal_id when querying or creating role bindings.
A short human-readable label, set by the caller at creation time.
1 - 80The OAuth client ID used by the service account to obtain access tokens. Used only for OAuth token exchange.
The date and time the service account was created.
The date and time of the service account's most recent metadata update.
Was this page helpful?