# Update a service account

**PATCH** `/admin/service-accounts/{service_account_id}`

:::code-group
```bash title="cURL"
curl --request PATCH \
  --url https://api.pinecone.io/admin/service-accounts/{service_account_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'X-Pinecone-Api-Version: <x-pinecone-api-version>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "ci-prod-renamed"
}'
```

```python title="Python"
import requests

url = "https://api.pinecone.io/admin/service-accounts/{service_account_id}"

payload = {
  "name": "ci-prod-renamed"
}
headers = {
    "Authorization": "Bearer <token>",
    "X-Pinecone-Api-Version": "<x-pinecone-api-version>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

```javascript title="JavaScript"
const options = {method: "PATCH", headers: {"Authorization": "Bearer <token>", "X-Pinecone-Api-Version": "<x-pinecone-api-version>", "Content-Type": "application/json"}, body: JSON.stringify({
  "name": "ci-prod-renamed"
})};

fetch("https://api.pinecone.io/admin/service-accounts/{service_account_id}", options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

```php title="PHP"
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.pinecone.io/admin/service-accounts/{service_account_id}",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "PATCH",
  CURLOPT_POSTFIELDS => "{\"name\":\"ci-prod-renamed\"}",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>",
    "X-Pinecone-Api-Version: <x-pinecone-api-version>",
    "Content-Type: application/json"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
```

```go title="Go"
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.pinecone.io/admin/service-accounts/{service_account_id}"

	payload := strings.NewReader("{\"name\":\"ci-prod-renamed\"}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

```java title="Java"
HttpResponse<String> response = Unirest.patch("https://api.pinecone.io/admin/service-accounts/{service_account_id}")
  .header("Authorization", "Bearer <token>")
  .header("X-Pinecone-Api-Version", "<x-pinecone-api-version>")
  .header("Content-Type", "application/json")
  .body("{\"name\":\"ci-prod-renamed\"}")
  .asString();
```

```ruby title="Ruby"
require 'uri'
require 'net/http'

url = URI("https://api.pinecone.io/admin/service-accounts/{service_account_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["X-Pinecone-Api-Version"] = '<x-pinecone-api-version>'
request["Content-Type"] = 'application/json'
request.body = "{\"name\":\"ci-prod-renamed\"}"

response = http.request(request)
puts response.read_body
```
:::

:::code-group
```json title="200"
{
  "client_id": "l3Ow0CmFyc4jOONcwiKUCRqQKN0tiCAn",
  "created_at": "2026-04-10T15:23:00.000Z",
  "id": "f8a3b2c1-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
  "name": "My Service Account",
  "updated_at": "2026-04-12T09:11:00.000Z"
}
```

```json title="400"
{
  "error": {
    "code": "INVALID_ARGUMENT",
    "message": "Bad request. The request body included invalid request parameters."
  },
  "status": 400
}
```

```json title="401"
{
  "error": {
    "code": "UNAUTHENTICATED",
    "message": "Invalid API key."
  },
  "status": 401
}
```

```json title="403"
{
  "error": {
    "code": "QUOTA_EXCEEDED",
    "message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
  },
  "status": 429
}
```

```json title="404"
{
  "error": {
    "code": "QUOTA_EXCEEDED",
    "message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
  },
  "status": 429
}
```

```json title="500"
{
  "error": {
    "code": "UNKNOWN",
    "message": "Internal server error"
  },
  "status": 500
}
```

```json title="4XX"
{
  "error": {
    "code": "QUOTA_EXCEEDED",
    "message": "The index exceeds the project quota of 5 pods by 2 pods. Upgrade your account or change the project settings to increase the quota."
  },
  "status": 429
}
```
:::

#### Authorizations

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `Authorization` | `string` | - |  |

An [access token](/guides/admin-organizations-manage-service-accounts#retrieve-an-access-token) must be provided in the `Authorization` header using the `Bearer` scheme.

#### Headers

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `X-Pinecone-Api-Version` | `string` | `2026-07` | Required date-based version header |

#### Path Parameters

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `service_account_id` | `string` | - | The unique identifier of the service account. |

#### Body

Updated metadata for the service account.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name?` | `string` | - | A new name for the service account. If omitted, the name is unchanged. Required string length: 1 - 80. Example: ci-prod-renamed |

#### Response

`200` — Service account updated successfully.

A service account. The OAuth `client_secret` is not included.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `id` | `string` | - | 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. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `name` | `string` | - | A short human-readable label, set by the caller at creation time. Required string length: 1 - 80 |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `client_id` | `string` | - | The OAuth client ID used by the service account to obtain access tokens. Used only for OAuth token exchange. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `created_at` | `string` | - | The date and time the service account was created. |

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `updated_at` | `string` | - | The date and time of the service account's most recent metadata update. |

## Related pages

- [List service accounts](./admin-2-service-accounts-list-service-accounts.md)
- [Create a service account](./admin-2-service-accounts-create-a-service-account.md)
- [Get service account details](./admin-2-service-accounts-get-service-account-details.md)
- [Delete a service account](./admin-2-service-accounts-delete-a-service-account.md)
- [Rotate a service account's OAuth client secret](./admin-2-service-accounts-rotate-a-service-accounts-oauth-client-secret.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
