Revoke project API key
Revoke project API key: revokeProjectApiKey in the TypeScript, Python, Rust and Go clients.
DELETE /v1/projects/{projectId}/api-keys/{apiKeyId}
Revokes the identified key on the selected project and returns its revoked metadata. Repeating the deletion returns the same revokedAt value. This operation does not rotate the key or return a replacement secret. Supply the required Idempotency-Key header.
photon.projects.revokeProjectApiKey(input: RevokeProjectApiKeyInput, options?: RequestOptions): Promise<RevokeProjectApiKeyOutput>photon.projects.revoke_project_api_key(input: RevokeProjectApiKeyInput, *, options: RequestOptions | None = None) -> models.ProjectApiKeyResponseclient.revoke_project_api_key(idempotency_key: String, api_key_id: String, project_id: String).await -> Result<ResponseValue<types::ProjectApiKeyResponse>, Error<RevokeProjectApiKeyError>>client.Projects.RevokeProjectApiKey(ctx context.Context, params *RevokeProjectApiKeyParams, opts ...RequestOption) (*ProjectApiKeyResponse, error)import { Photon } from "@photon-ai/api";
const photon = new Photon({
headers: { Authorization: `Bearer ${process.env.PHOTON_API_TOKEN}` },
});
const result = await photon.projects.revokeProjectApiKey({
path: {
apiKeyId: "apiKeyId",
projectId: "projectId",
},
headers: {
idempotencyKey: "idempotencyKey",
},
});import os
from photon_api import Photon
from photon_api.rpc_generated import RevokeProjectApiKeyInput
photon = Photon(headers={"Authorization": f"Bearer {os.environ['PHOTON_API_TOKEN']}"})
result = photon.projects.revoke_project_api_key(
RevokeProjectApiKeyInput.model_validate({
"path": {
"apiKeyId": "apiKeyId",
"projectId": "projectId",
},
"headers": {
"Idempotency-Key": "idempotencyKey",
},
})
)use photon_ai_api::{Credential, PhotonClientBuilder, SecretString};
let token = std::env::var("PHOTON_API_TOKEN")?;
let client = PhotonClientBuilder::new()
.credential("accountServiceKey", Credential::Bearer(SecretString::from(token)))
.build()?;
let result = client
.revoke_project_api_key(
"idempotencyKey".to_owned(),
"apiKeyId".to_owned(),
"projectId".to_owned(),
)
.await
.map_err(|error| format!("{error:?}"))?
.into_inner();import (
"context"
"os"
photonapi "github.com/photon-hq/api/packages/go"
)
ctx := context.Background()
client := photonapi.NewClient(photonapi.WithAPIKey(os.Getenv("PHOTON_API_TOKEN")))
result, err := client.Projects.RevokeProjectApiKey(ctx, &photonapi.RevokeProjectApiKeyParams{
IdempotencyKey: "idempotencyKey",
APIKeyID: "apiKeyId",
ProjectID: "projectId",
})
if err != nil {
return err
}
_ = result{
"apiKey": {
"apiKeyId": "string",
"createdAt": "2026-01-01T00:00:00.000Z",
"createdByAccountId": "string",
"expiresAt": null,
"name": "string",
"permissions": [
"string"
],
"permissionsUpdatedAt": null,
"projectId": "string",
"revokedAt": null
}
}Parameters
Selects the API contract date. Without it, the request is served as 2026-07-01.
Identifies one logical mutation across retries.
Returns
200 The revoked key metadata. Repeated revocation is stable and never returns a secret. ProjectApiKeyResponse
Headers: Photon-Version. The raw response carries these headers; see Raw responses.