Base URL
All API endpoints are prefixed with/api/v1:
Authentication Methods
Personal Access Tokens
Snipe-IT uses OAuth 2.0 personal access tokens for API authentication. These tokens allow you to authenticate API requests without exposing your password.Generating a Token
You can generate a personal access token using the API itself (requires initial authentication) or through the web interface. Via API:Listing Your Tokens
Retrieve all active personal access tokens for the authenticated user:Deleting a Token
Revoke a personal access token when it’s no longer needed:The UUID of the token to delete (e.g.,
9a8f7e6d-5c4b-3a2b-1c0d-9e8f7a6b5c4d)204 No Content.
Using Your Token
Include your personal access token in theAuthorization header of every API request using the Bearer authentication scheme:
Example Request
Token Expiration
By default, personal access tokens expire after 15 years from creation. You can customize this expiration period using theAPI_TOKEN_EXPIRATION_YEARS environment variable:
.env
Content Type Headers
Always include the
Accept: application/json header in your requests to ensure you receive JSON responses.POST, PUT, and PATCH requests, also include:
Authentication Errors
Unauthenticated (401)
Returned when no valid token is provided:Forbidden (403)
Returned when the authenticated user lacks permissions:Invalid Token
If your token is malformed or expired:Security Best Practices
Store tokens securely
Store tokens securely
- Never commit tokens to version control
- Use environment variables or secure secret management systems
- Treat tokens like passwords
Use HTTPS
Use HTTPS
Always use HTTPS to prevent token interception. Configure your Snipe-IT instance with:
.env
Rotate tokens regularly
Rotate tokens regularly
Periodically delete old tokens and generate new ones, especially:
- When team members leave
- If you suspect a token has been compromised
- As part of regular security maintenance
Use descriptive names
Use descriptive names
Name your tokens based on their purpose or application:
- “Production Monitoring Script”
- “Mobile App Integration”
- “Backup Automation”
Limit token scope
Limit token scope
Create separate tokens for different applications or purposes rather than sharing a single token across multiple systems.
Testing Authentication
Verify your authentication setup by retrieving your user profile:If you receive your user details, your authentication is working correctly!
Next Steps
Rate Limits
Learn about API rate limiting and quotas
Assets
Start working with asset endpoints
