The following examples are using the available chainloop cloud API endpoints, if you are using a self-hosted instance you will need to replace the endpoints with your own.
Chainloop platform backend API is only available on Chainloop’s platform paid plans.
- Chainloop controlplane, i.e
https://api.cp.chainloop.dev
, handles operations onorganizations
,workflows
,workflow runs
,contracts
,discovery
, … - Chainloop platform backend, i.e
https://api.app.chainloop.dev
, handles operations onpolicies
,policy groups
,frameworks
,requirements
,projects
List Available API operations
You can use thebuf curl
command to list the available operations for a given API
Calling the API
Authentication and Authorization
The API is currently authenticated viauser
tokens and api tokens
- user tokens are credentials valid for 24 hours that are generated after logging in the platform or using
chainloop auth login
command. It is not recommended to use this token for unattended operations because of its ephemerality properties. - API tokens are credentials with an optional expiration date associated with an organization meant to be used for unattended workflows, i.e CI attestations or automation in general. The set of operations that they can perform today is not configurable but this will likely change in the future
Some operations are restricted to only user tokens. We are working on offering a way to configure API tokens permissions in the future, in the meantime, please contact us if there is a specific operation you need to perform that you can’t do with an API token.
Authorization
header with your token of choice, example.
chainloop org ls
API Clients
By default, these APIs are exposed as gRPC although some of those APIs are exposed as REST API, more on that below. This means that you can leverage any gRPC client to interact with the API.buf curl
To call the API from the terminal you can use buf curlpostman or grpcui
Use a user interface such as grpcUI or PostmanNative gRPC client
You can compile the proto definitions and use the native gRPC client to interact with the API. Controlplane API- Pre-compiled gRPC web typescript clients can be found here
- Pre-compiled gRPC go clients can be found here
- If those are not enough you can compile the proto definitions yourself and generate the gRPC client. The source protocol buffer code can be found here and you can use the
make api
orbuf generate
commands.