Quickstart
This article describes how to quickly get started with the Endor Labs REST API using the Endor Labs command line tool endorctl or curl. For a more detailed guide, see Getting started with the REST API.
The following is an example request to get the number of findings in your namespace:
-
Authenticate with Endor Labs using
endorctl init. For more information, see endorctl init.endorctl init --auth-mode google -
Use the
endorctlcommand-line tool to make your request. Note that you do not have to provide the namespace or access token when usingendorctlto access the Endor Labs REST API. For more information, see the Endor Labs CLI documentation.endorctl api list -r Finding --count
-
Install
curlif it isn’t already installed on your machine. To check ifcurlis installed, executecurl --versionon the command line. If the output provides information about the version ofcurl, that meanscurlis installed. If you get a message similar to command not found: curl, you need to download and install curl. For more information, see the curl project download page. -
Authenticate with Endor Labs using
endorctl init. For more information, see endorctl init.endorctl init --auth-mode google -
Create an access token. The access token produced below has the same scopes/permissions as the API key created through
endorctl init. Treat your access token like a password. For more information, see Authentication.export ENDOR_TOKEN=$(endorctl auth --print-access-token) -
Use the Curl command to make your request. Pass your token in an Authorization header. The following is an example request to get the number of findings in a given namespace. If needed, replace
$ENDOR_NAMESPACEwith the name of your namespace, or export it as a variable usingexport ENDOR_NAMESPACE=<insert-namespace>.curl --get \ --header "Authorization: Bearer $ENDOR_TOKEN" \ --header "Accept-Encoding: gzip" \ --url "https://api.endorlabs.com/v1/namespaces/$ENDOR_NAMESPACE/findings?list_parameters.count=true"
For more information on HTTP headers and parameters, see Getting Started.
For more examples of common use cases, see Use cases.
Feedback
Was this page helpful?
Thanks for the feedback. Write to us at support@endor.ai to tell us more.
Thanks for the feedback. Write to us at support@endor.ai to tell us more.