[BUG]: API Calls - API Tokens- Create / Update API calls are not saving the correct data
🐞 Bug Summary
API Calls - API Tokens- Create / Update API calls are not saving the correct data. Create not saving is_active": false or "is_revoked": true. Update is not updating any value.
🧩 Affected Component
Select the area of the project impacted:
- [X]
mcpgateway- API - [ ]
mcpgateway- UI (admin panel) - [ ]
mcpgateway.wrapper- stdio wrapper - [ ] Federation or Transports
- [ ] CLI, Makefiles, or shell scripts
- [ ] Container setup (Docker/Podman/Compose)
- [ ] Other (explain below)
🔁 Steps to Reproduce
- Go to Swagger or use curl
- Use POST or PUT on http://localhost:8000/tokens/d53c89d4-84d1-4c19-9497-afa0bbe24bec or http://localhost:4444/tokens
- Check results
🤔 Results
The data on API Tokens is not updated as requested.
🤔 Expected Behavior
The API calls should update the value as requested.
📓 Logs / Error Output
Paste any relevant stack traces or logs here. ⚠️ Do not paste secrets, credentials, or tokens.
🧠 Environment Info
You can retrieve most of this from the /version endpoint.
| Key | Value |
|---|---|
| Version or commit | v0.128.0 |
| Runtime | Python 3.12.3 |
| Platform / OS | Linux 6.6.87.2-microsoft-standard-WSL2 (x86_64) |
| Container | none |
🧩 Additional Context (optional)
Related with #2390
Thank you for the detailed report.
Confirmed: The is_active field exists in TokenResponse but is missing from TokenCreateRequest and TokenUpdateRequest schemas. Values passed to these fields are silently ignored by Pydantic.
Fix: Add is_active to the request schemas and wire it through the service layer. For is_revoked, this will remain read-only since token revocation uses a dedicated endpoint (DELETE /tokens/{id}) that maintains an audit trail.