Here is the updated PRD with the additional detail about token validity:
Product Requirements Document (PRD): API Key Management
Objective
Enable Super Admins and Admins to generate, manage, and track API tokens within Agency Handy to support integrations with external applications securely.
Business Need
Security: Secure API access to external systems via unique tokens.
Usability: Provide a simple interface for managing API keys.
Accountability: Track API token creation with relevant details to ensure transparency.
User Goals
As a Super Admin/Admin, I want to generate API tokens to integrate external applications securely.
As a Super Admin/Admin, I want to view and track all generated API tokens, including metadata like name, version, and creation date.
Functional Requirements
1. API Key Section in Workspace Settings
Add a new option called "API Keys" under the Workspace Settings menu.
Only Super Admins and Admins will have access to this section.
2. Token Creation
Form Fields for New Token Creation:
Token Name: (Required, Max 32 characters).
Input validation for character count and blank field check.
Upon submission:
A new API Token (JWT) will be generated by the backend.
The token will be valid for 100 years (long-term validity).
A success message will display: "New API Token successfully generated."
3. API Token Table View
Display all tokens in a tabular format with the following columns:
Token: The generated JWT token.
Name: User-specified name of the token.
Created Date: The date and time when the token was generated.
4. Token Behavior
Token Validity: Tokens are valid for 100 years unless manually replaced or invalidated.
Token Deletion
Delete Option: Super Admins/Admins can delete tokens.
Confirmation Prompt:
"Deleting this token will disconnect all associated connections. Proceed?"
Buttons: Cancel | Confirm
Backend Behavior: Blacklist deleted tokens to invalidate them immediately.
Additional info
About API key
The AgencyHandy API makes it easy for programmers to integrate many of AgencyHandy's features into other applications. Interested in learning more?