Introduction to the FOSSA API
Generate an API key and make your first request to the FOSSA REST API.
Overview
The FOSSA API is a RESTful API for programmatic access to your FOSSA data. This guide walks you from generating an API key to making your first authenticated request.
Note
All API requests are made over HTTPS to https://app.fossa.com/api.
Making your first request
- 1
Generate an API key
In the FOSSA dashboard, go to Account Settings → Integrations → API and create a new token. See Authentication for the difference between Push-Only and Full tokens; most API calls require a Full token.
- 2
Authenticate your request
Pass your token in the
Authorizationheader, prefixed withBearer:Authorization: Bearer YOUR_API_KEY - 3
Call an endpoint
Send a
GETrequest to/api/v2/projectsto list the projects in your organization.
Common requests
Listing all projects
curl --request GET \ --url 'https://app.fossa.com/api/v2/projects' \ --header 'Authorization: Bearer YOUR_API_KEY'Use page and count to paginate, and title to filter by name.
Listing the revisions of a project
Once you have a project locator, retrieve its revisions:
curl --request GET \ --url 'https://app.fossa.com/api/revisions?projectId=<project-locator>' \ --header 'Authorization: Bearer YOUR_API_KEY'Note
Project and revision locators contain characters such as +, /, and $ that must be URL-encoded when used in a path or query string (for example, custom+1234/example becomes custom%2B1234%2Fexample).
Next steps
- Authentication: token types and security best practices.
- Managing issues: query and filter issues programmatically.
- Usage examples: end-to-end recipes for common tasks.
- Endpoint Reference: every endpoint, parameter, and response.