Trillet AI logo

Delete API Key

Delete an API key. The key stops working for authentication immediately.

DELETEhttps://api.trillet.ai/v1/api/keys/{id}

You can only delete keys that belong to you. Another user's key, or a workspace service key, returns 404.

Your role needs the api_keys:delete permission. Otherwise the request fails with 403 {"error": "Insufficient permissions", ...}. Connected apps (OAuth tokens) get 403 {"error": "API keys cannot be managed by connected apps."}.

Headers

x-workspace-idstringrequired

The workspace used for the permission check.

Path Parameters

idstringrequired

The key record's _id (not the key itself).

Response Fields

successboolean

true when the key was deleted.

Errors

StatusBodyWhen
403{"error": "Insufficient permissions", ...}Your role lacks api_keys:delete
403{"error": "API keys cannot be managed by connected apps."}The request used an OAuth (connected app) token
404{"error": "API key not found"}No key with that ID belongs to you
500{"error": "Internal server error", "message": "..."}Unexpected server error
{
  "success": true
}

Last updated on