Appearance
15. Application Programming Interface (API)
15.1. What is the API?
The API (Application Programming Interface) allows the majority of actions performed in the user interface (UI) to be performed programmatically. This requires some level of comfort with working on the command line, but can be a powerful way of performing multiple repetitive tasks quickly instead of tedious manual operations in Mosaic.
Tasks that are well suited to the API include creating projects in bulk, importing or updating attribute values for many samples or projects at once, loading data programmatically, and integrating Mosaic with other systems in your laboratory's workflow. The API is also how certain configuration is applied — for example, flagging a project as a template.
15.2. How do I access the API?
The API documentation can be accessed from the top menu bar under Learn, where all available API endpoints are described. There is also a public Python client for the API that can be found on the public GitHub page.
15.3. The Python Client
For users who prefer Python to working directly with the endpoints, the public Python client wraps the API in a set of convenient functions and is a good starting point for scripting common tasks. Installation and usage instructions are maintained alongside the code on the GitHub repository.
15.4. Getting Help
Actions taken through the API have the same effect as actions taken in the interface and are subject to the same permissions: you can only do through the API what your role and project access allow. If you would like help getting started with the API, or have a workflow you would like to automate, please contact the Frameshift team.
