deleteAccountKeysWithHttpInfo method
Revokes the caller's own API key of the requested class.
Revokes the caller's own API key of the requested class. The class is the same field mint takes — ?type=publishable, defaulting to secret — so revoking the key that ships in a browser bundle does not sign its holder out of their own API: the other key keeps working. Revoking is how a key is replaced when it does not need replacing; minting the same class again rotates it in one step. IAM drops the credential immediately, but the gateway caches keys for a few minutes, so a request that beat the cache expiry may still be served. For callers written against the older shape, the class is also accepted in a JSON request body, read only when ?type= is absent.
Note: This method returns the HTTP Response.
Parameters:
- String type: Type is the key class to act on: "secret" (sk-, session-equivalent, belongs on a server) or "publishable" (pk-, org-identifying, safe in a browser bundle). Omitted means secret, which is what every existing caller means.
Implementation
Future<Response> deleteAccountKeysWithHttpInfo({ String? type, }) async {
// ignore: prefer_const_declarations
final path = r'/v1/account/keys';
// ignore: prefer_final_locals
Object? postBody;
final queryParams = <QueryParam>[];
final headerParams = <String, String>{};
final formParams = <String, String>{};
if (type != null) {
queryParams.addAll(_queryParams('', 'type', type));
}
const contentTypes = <String>[];
return apiClient.invokeAPI(
path,
'DELETE',
queryParams,
postBody,
headerParams,
formParams,
contentTypes.isEmpty ? null : contentTypes.first,
);
}