TrollflixDevelopers
API keys

Rotate your API key

Replace your API key with a new one. The old key stops working immediately.

POST https://backend.trollflix.com/api/php/user_settings/rotate_api_key

Generates a new key and revokes the old one in the same step: there is no moment when both work. Requires a signed-in session.

Rotation keeps created_at_unix, sets rotated_at_unix, and resets the usage stats (last_used_at_unix, uses_count), which always describe the current key.

Every script or service still using the old key gets api_key_invalid from its next request. Update them with the new key right after rotating.

Request

No parameters. Send an empty JSON object.

POST /api/php/user_settings/rotate_api_key
Content-Type: application/json

{}

Response

{
  "success": true,
  "error_message_code": null,
  "api_key": "tfx_9be04d1a2c3b4f5e6d7c8b9a0f1e2d3c4b5a69788776e0d4",
  "key": {
    "key_hint": "tfx_9be0...e0d4",
    "created_at_unix": 1790841600,
    "rotated_at_unix": 1791446400,
    "last_used_at_unix": null,
    "uses_count": 0
  }
}
{
  "success": false,
  "error_message_code": "api_key_not_found",
  "api_key": null,
  "key": null
}

Prop

Type

On this page