Update API key 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.

If the API key belongs to an unrelated account, the endpoint returns 403 Forbidden.

Example requests and responses

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"
}'
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)
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))

}
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

NameReq/OptTypeDescription
apiKeyIdrequiredintegerThe unique identifier of the API key.

Request parameters

NameReq/OptTypeDescription
statusrequiredstringOperational status of the API key.
Allowed values: active, inactive.

Response parameters

This endpoint does not return response parameters.