MCP Gateway
ApiServer oauth

Cleanup expired OAuth states

Admin endpoint to clean up expired OAuth states. Typically called by a scheduled job. Requires admin privileges.

DELETE
/api/v1/oauth/oauth-states/cleanup

Authorization

User API Key
AuthorizationBearer <token>

User API key (mgw_usr_live_* or mgw_usr_test_*)

In: header

Query Parameters

retention_hours?integer
Default1
Range1 <= value <= 24
run_in_background?boolean

Run cleanup in background (faster response) or synchronously

Defaulttrue
access_token?|

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/v1/oauth/oauth-states/cleanup"
{
  "property1": 0,
  "property2": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}