Rest API
Last updated
Last updated
The Xygeni API is based on the OpenAPI ("Swagger") standards and allows retrieval of security issues, project risk summary, trends in security position, and report generation, plus administration.
Most Xygeni API endpoints return JSON output.
The easiest way to find the endpoint for a particular need is by browsing in the .
Instead of providing a downloadable client for different platforms / languages, it is recommended to generate the client from the OpenAPI specification (if you trust the publicly available generators). This allows it to control the generation of the client, and keeps it updated to the latest API version.
For generating an api client for a target programming language, the OpenAPI / Swagger specification can be downloaded from (YAML) or (JSON).
The most interactive way to create a client from a swagger file is using the online swagger editor. Go to Use . Select file, import URL and type in the URL of the Xygeni API URL. Alternatively you can select File
, Import File and upload the downloaded swagger.yaml file.
Next select Generate Client
and select the language of your choice. The end result is a zip file you can download with the generated client code.
An api client generated for your language of choice could be convenient. Alternatively, there are popular frameworks for invoking api endpoints that could be used. A third option is to use a command-line tool like curl
or wget
.
Authenticating api calls require an Authorization header: Authorization: Bearer <TOKEN_HERE>
.
The Xygeni API may also use basic authentication with username and password, but it is not recommended. Use an access token instead.
An example of basic authentication with curl on the same endpoint:
Create projects
Delete project
Instead of using the interactive editor, you may use the . This is the recommended alternative in general, as it provides much more control on the generated client code.
is another nice client generator for api clients from OpenAPI / Swagger documents.
You may download the and run its help command:
There are that wrap the Java-based OpenAPI generator CLI, that you may try for convenience. You may then replace java -jar openapi-generator-cli.jar
with openapi-generator-cli
command, for example.
It is recommended to define a like my_config.yaml
with options for your language of choice, and then call the generator with the config file:
The is the reference to the available endpoints.
Most API endpoints require authentication (except /ping
to check for platform availability). The recommended way to authenticate operations is using an access token (also known as apikey
or API token
). Go to for full details.
Let’s assume that the access token is set in the XYGENI_TOKEN
environment variable. The following is an example using curl
for the endpoint:
Most endpoints for fetching issues need a projectId
parameter. The list of project IDs for the organization’s projects could be fetched using the endpoint:
The endpoints could be used to fetch data for the different issue types. For example, to get the latest misconfigurations:
For automation, you may need to create projects. The endpoint creates a project.
Sometimes projects terminate, software is decommissioned or replaced, and so on. The allows us to remove a given project AND ALL ITS DATA.