Skip to content

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>
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",
  },
});
{
  "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

Photon-VersionPhotonVersion

Selects the API contract date. Without it, the request is served as 2026-07-01.

Idempotency-Keystringrequired

Identifies one logical mutation across retries.

apiKeyIdstringrequired
projectIdstringrequired

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.

apiKeyApiKeyrequired