Overview
Personal access tokens are prefixed withgvx_ and provide a secure way to authenticate Git operations. Unlike password authentication, tokens can be easily revoked without changing your account password.
Use cases
- Push and pull Git repositories over HTTPS
- Clone private repositories
- Authenticate automated workflows and CI/CD pipelines
- Provide temporary access without sharing credentials
Token format
Tokens follow this format:gvx_abc123def456xyz789
Create token
Generate a new personal access token.Request body
Descriptive name for the token to help you identify it later. Must be between 3 and 50 characters.
Token prefix. Defaults to
gvx_ for Gitflare tokens.Optional expiration timestamp in milliseconds. If not provided, the token never expires.
Response
Unique token identifier.
The full token string. This is the only time you’ll see the complete token.
The descriptive name you provided.
First few characters of the token (e.g.,
gvx_abc) for identification.Token prefix.
Whether the token is active.
Token creation timestamp in milliseconds.
Token expiration timestamp, or
null if it never expires.Example response
List tokens
Retrieve all personal access tokens for the authenticated user.Response
Returns an array of token objects. Note that the full tokenkey is not included for security reasons.
Array of token objects.
Example response
Delete token
Revoke a personal access token. This immediately invalidates the token.Request body
The ID of the token to delete.
Response
Indicates whether the token was successfully deleted.
Example response
Using tokens with Git
Once you have a personal access token, use it as your password when performing Git operations over HTTPS.Clone a repository
Configure credentials
For repeated operations, configure Git to cache your credentials:In CI/CD pipelines
Use tokens in automated workflows:Token security
Best practices
Use descriptive names
Use descriptive names
Name tokens based on their purpose (e.g., “CI/CD Pipeline”, “Local Development”) to track usage.
Set expiration dates
Set expiration dates
For temporary access, set an expiration date when creating the token.
Revoke unused tokens
Revoke unused tokens
Regularly review and delete tokens you no longer need.
Use environment variables
Use environment variables
Store tokens in environment variables or secret management systems, never in code.
Rotate tokens regularly
Rotate tokens regularly
Create new tokens and revoke old ones periodically, especially for long-running services.
Limit token scope
Limit token scope
Create separate tokens for different purposes instead of sharing a single token.
What to do if a token is compromised
- Immediately revoke the compromised token via the delete endpoint
- Generate a new token with a different name
- Update all services using the old token
- Review recent activity to identify any unauthorized access
Token metadata
Gitflare tracks usage information for each token:- Last request: Timestamp of the most recent API call
- Request count: Total number of requests made
- Created date: When the token was generated
- Identify unused tokens for deletion
- Monitor token usage patterns
- Detect unusual activity
Rate limiting
Personal access tokens are subject to rate limiting. Rate limiting is currently disabled in Gitflare but can be enabled in the configuration:- Each token has its own rate limit
- Limits reset after the specified time window
- Exceeding limits returns a
429 Too Many Requestserror
Error responses
Error information when a request fails.
Common error codes
400 Bad Request: Invalid parameters (e.g., name too short)401 Unauthorized: No active session or invalid session404 Not Found: Token ID not found429 Too Many Requests: Rate limit exceeded (when enabled)500 Internal Server Error: Server-side error
See also
- Authentication - User authentication and session management
- Git Operations - Using Git with Gitflare
- Access Control - Repository permissions and access management