> For the complete documentation index, see [llms.txt](https://magicpay.gitbook.io/magicpay-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://magicpay.gitbook.io/magicpay-documentation/api-key/update-api-key-by-id.md).

# Update API Key By Id

## 14.5 Update API Key By Id

**Request**

| Method | URL                       |
| ------ | ------------------------- |
| PUT    | /api\_keys/{api\_key\_id} |

Copy

```
{
  "name": "Yeni API Anahtarı Adı",
  "permission_id":[8,9]
}
```

**Response**

| Status | Response                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 200    | <p>{</p><p>"permission\_id": \[</p><p>8,</p><p>9</p><p>],</p><p>"secret\_key": "magic-uHyomPzAmva2xls9tVZ89Jop3h1k6\_sJh7mrEZGUqnM",</p><p>"api\_key": "magic-W-O9vzYULk3I6eQo3kD0nHofmELmvCLgJqI1cWwQimY",</p><p>"merchant\_id": 1,</p><p>"createdDate": "2024-01-29T08:35:24.947598",</p><p>"updatedDate": "2024-01-29T08:53:44.901461",</p><p>"is\_active": true,</p><p>"name": "Yeni API Anahtarı Adı",</p><p>"id": 70,</p><p>"deletedDate": null</p><p>}</p> |
| 403    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 400    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 401    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 401    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| 500    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

[<br>](https://hilals-organization.gitbook.io/magicpay-documentation/14.-api-key/14.4-delete-permission-by-api-key)
