--- title: "Update API key status" source_url: https://dev.digicert.com/partner-subscriptions-api/api-key-management/update-api-key-status.html api_method: PUT api_endpoint: "/partner-subscription/api/v1/api-key//status" api_url: "https://www.digicert.com/partner-subscription/api/v1/api-key/{{apiKeyId}}/status" --- **PUT** `https://www.digicert.com/partner-subscription/api/v1/api-key/{{apiKeyId}}/status` Use this endpoint to activate or deactivate an API key. Parent accounts can update their own API keys and API keys that belong to their subaccounts. Subaccounts can update only their own API keys. > **Info** > > If the API key belongs to an unrelated account, the endpoint returns 403 Forbidden. ## Example requests and responses **cURL** ```bash curl -X PUT \ https://www.digicert.com/partner-subscription/api/v1/api-key/12345/status \ -H 'Content-Type: application/json' \ -H 'X-PARTNER-APIKEY: {{partner_api_key}}' \ -d '{ "status": "inactive" }' ``` **Python** ```python import requests url = "https://www.digicert.com/partner-subscription/api/v1/api-key/12345/status" payload = "{\n \"status\": \"inactive\"\n}" headers = { 'X-PARTNER-APIKEY': "{{partner_api_key}}", 'Content-Type': "application/json" } response = requests.request("PUT", url, data=payload, headers=headers) print(response.text) ``` **Go** ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://www.digicert.com/partner-subscription/api/v1/api-key/12345/status" payload := strings.NewReader("{\n \"status\": \"inactive\"\n}") req, _ := http.NewRequest("PUT", url, payload) req.Header.Add("X-PARTNER-APIKEY", "{{partner_api_key}}") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` **NodeJS** ```javascript var request = require("request"); var options = { method: 'PUT', url: 'https://www.digicert.com/partner-subscription/api/v1/api-key/12345/status', headers: { 'Content-Type': 'application/json', 'X-PARTNER-APIKEY': '{{partner_api_key}}' }, body: { status: 'inactive' }, json: true }; request(options, function (error, response, body) { if (error) throw new Error(error); console.log(body); }); ``` ## 204 No Content The API key status was updated successfully. The response does not include a body. ## URL path and query parameters
Name Req/Opt Type Description
apiKeyId required integer The unique identifier of the API key.
## Request parameters
Name Req/Opt Type Description
status required string Operational status of the API key.
Allowed values: active, inactive.
## Response parameters This endpoint does not return response parameters.