---
updatedAt: 2026-03-01T18:47:04.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/iam-api/llms.txt
---

# Update a credential

```curl cURL
credentialId=123456
clientId="2cdgugz2tjbtowmy"

egcurl --eg-section default --request PUT \
  --url "https://$hostname/identity-management/v3/api-clients/$clientId/credentials/$credentialId" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '
{
    "status": "ACTIVE",
    "expiresOn": "2020-10-11T23:06:59.000Z",
    "description": "Update this credential"
```

```node Node
const EdgeGrid = require("akamai-edgegrid");
const os = require("os");
const edgercPath = os.homedir + "/.edgerc.txt";
const edgercSection = "default";
const eg = new EdgeGrid({
  path: edgercPath,
  section: edgercSection,
});

const credentialId = 123456;
const clientId = "2cdgugz2tjbtowmy";

eg.auth({
  path: `/identity-management/v3/api-clients/${clientId}/credentials/${credentialId}`,
  method: "PUT",
  headers: {
    "Content-Type": "application/json",

    Accept: "application/json",
  },
  body: {
    status: "ACTIVE",
    expiresOn: "2020-10-11T23:06:59.000Z",
    description: "Update this credential",
  },
});
eg.send(function (error, response, body) {
  console.log(JSON.stringify(JSON.parse(body), null, 2));
});
```

```python Python
import requests
import json
from akamai.edgegrid import EdgeGridAuth, EdgeRc
from urlparse import urljoin

edgerc = EdgeRc('~/.edgerc.txt')
section = 'default'
baseurl = 'https://%s' % edgerc.get(section, 'host')

session = requests.Session()
session.auth = EdgeGridAuth.from_edgerc(edgerc, section)
credentialId = 123456
clientId = "2cdgugz2tjbtowmy"
 

path = '/identity-management/v3/api-clients/{}/credentials/{}'.format(clientId, credentialId)
headers = {
  "Content-Type": "application/json",

  "Accept": "application/json"}
payload = {
    "status": "ACTIVE",
    "expiresOn": "2020-10-11T23:06:59.000Z",
    "description": "Update this credential"
}  

result = session.put(urljoin(baseurl, path), headers=headers, json=payload)
print(result.status_code)
print(json.dumps(result.json(), indent=2))
```

```json Response Example
{
  "description": "Update this credential",
  "expiresOn": "2020-10-11T23:06:59.000Z",
  "status": "ACTIVE"
}
```

# Set up authentication

<!-- curl@4 -->
<!-- node@1-8 -->
<!-- python@1-11 -->

Before you can this API, you need to [Create authentication credentials](https://techdocs.akamai.com/developer/docs/set-up-authentication-credentials). 

Then, you can use these code samples to apply the token values to your requests.

# Fetch the clientId

<!-- curl@1 -->
<!-- node@10 -->
<!-- python@12 -->

Run the [List API clients](https://techdocs.akamai.com/iam-api/reference/get-api-clients) operation and store `clientId` of the user you want to modify the credential for.

# Fetch the client's credentials

<!-- curl@2 -->
<!-- node@10 -->
<!-- python@12 -->

Run the [Get a credential](https://techdocs.akamai.com/iam-api/reference/list-credentials) operation with the stored `clientId` and store `credentialId` from the response.

# Form the URL

<!-- curl@5 -->
<!-- node@14 -->
<!-- python@16 -->

Inject the `credentialId` and  `clientId` values into the URL template.

# Modify the object

<!-- curl@10-12 -->
<!-- node@22-24 -->
<!-- python@22-24 -->

You can change the expiration date (`expiresOn`), `description`, or toggle the activation `status` to either `ACTIVE` or `INACTIVE`.

# Call the API

<!-- curl@0-100 -->
<!-- node@0-100 -->
<!-- python@0-100 -->

Call PUT on the request URL, providing the object in the body of the request.

# Review the response

<!-- curl@0 -->
<!-- node@0 -->
<!-- python@0 -->

The response returns the 200 code and the credential's updated information.