---
updatedAt: 2026-03-01T18:45:56.000Z
agentTools:
  siteIndex: https://techdocs.akamai.com/llms.txt
  projectIndex: https://techdocs.akamai.com/key-traffic-mgmt/llms.txt
---

# Move keys to an existing collection

```curl cURL
egcurl --eg-section default --request POST \
  --url "https://$hostname/apikey-manager-api/v2/keys/move" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '
{
    "destinationCollectionId": 51235,
    "keyIds": [
        6897346
    ]
}'

```

```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,
});

eg.auth({
  path: `/apikey-manager-api/v2/keys/move`,
  method: "POST",
  headers: {
    "Content-Type": "application/json",

    Accept: "application/json",
  },
  body: {
    destinationCollectionId: 51235,
    keyIds: [6897346],
  },
});
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)
 

path = '/apikey-manager-api/v2/keys/move'
headers = {
  "Content-Type": "application/json",

  "Accept": "application/json"}
payload = {
    "destinationCollectionId": 51235,
    "keyIds": [
        6897346
    ]
}  

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

```

```json Response Example
{
  "destinationCollectionId": 51235,
  "movedKeyIds": [
    6897346
  ]
}
```

# Set up authorization



Before you can use 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 key collection

<!-- curl@7 -->
<!-- node@19 -->
<!-- python@20 -->

Fetch the `collectionId` value of the key collection you want to move keys to. Run the [List key collections](https://techdocs.akamai.com/key-traffic-mgmt/reference/get-collections) operation to get it.

# Fetch keys

<!-- curl@8-10 -->
<!-- node@20 -->
<!-- python@21-23 -->

Fetch `keyIds` values of keys you want to move. Run the [List keys](https://techdocs.akamai.com/key-traffic-mgmt/reference/get-keys) operation to get them.

# Call the API

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

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

# Review the response



The operation responds with the 200 status.