Project API

API to manage projects, versions, and documents in Ketryx

Ketryx exposes an API to manage projects programmatically. There is also a formal OpenAPI specification defining this API, and a separate page about authentication and API keys.

Projects

Get a list of projects

get

Gets a list of Ketryx projects in the current organization.

Authorizations
Query parameters
namestringOptional

Project name to filter for

startAtintegerOptional

Start listing projects at the given index. Defaults to 0.

maxResultsintegerOptional

Maximum number of projects to return. Defaults to no limit.

Responses
200
OK
application/json
get
GET /api/v1/projects HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "projects": [
    {
      "id": "text",
      "name": "text"
    }
  ]
}

Create a new project

post
Authorizations
Body
namestringRequired

Name of the new project

Example: My project
Responses
200
OK
application/json
post
POST /api/v1/projects HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 127

{
  "name": "My project",
  "repositories": [
    {
      "url": "text",
      "mainRef": "text",
      "releaseRef": "text",
      "authUser": "text",
      "authToken": "text"
    }
  ]
}
{
  "id": "text"
}

Project

Get the project settings

get
Authorizations
Path parameters
projectIdstringRequired
Responses
200
OK
application/json
get
GET /api/v1/projects/{projectId} HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "text",
  "name": "text",
  "repositories": [
    {
      "url": "text",
      "mainRef": "text",
      "releaseRef": "text",
      "hasAuth": true
    }
  ]
}

Change the project settings

post
Authorizations
Body
settingsobjectOptional

Object with advanced setting names as keys and a JSON value for each setting

Example: { "statusMapping": { "Backlog": "OPEN", "Done": "RESOLVED" } }
Responses
200
OK
application/json
post
POST /api/v1/projects/{projectId} HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 193

{
  "repositories": [
    {
      "url": "text",
      "mainRef": "text",
      "releaseRef": "text",
      "authUser": "text",
      "authToken": "text"
    }
  ],
  "settings": "{ \"statusMapping\": { \"Backlog\": \"OPEN\", \"Done\": \"RESOLVED\" } }"
}
{
  "id": "text"
}

Delete a project

delete
Authorizations
Path parameters
projectIdstringRequired
Responses
204
Deletion successful, no content returned
delete
DELETE /api/v1/projects/{projectId} HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Versions

Get a list of versions

get

Gets a list of versions in the given project.

Authorizations
Path parameters
projectIdstringRequired
Responses
200
OK
application/json
get
GET /api/v1/projects/{projectId}/versions HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "versions": [
    {
      "id": "text",
      "name": "text"
    }
  ]
}

Create a new version

post
Authorizations
Body
namestringOptionalExample: My project
Responses
200
OK
application/json
post
POST /api/v1/projects/{projectId}/versions HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 21

{
  "name": "My project"
}
{
  "id": "text"
}

Version

Change the version settings

post
Authorizations
Body
namestringOptional
post
POST /api/v1/projects/{projectId}/versions/{versionId} HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 224

{
  "name": "text",
  "referencedVersions": [
    {
      "project": {
        "id": "KXPRJ49GQYFQ5RR9KRTPWTRTC39YZ9W"
      },
      "version": {
        "id": "KXPRJ49GQYFQ5RR9KRTPWTRTC39YZ9W"
      }
    }
  ],
  "repositorySettings": [
    {
      "url": "text",
      "releaseRefPattern": "refs/tags/version-1.0"
    }
  ]
}

Delete a version

delete
Authorizations
Path parameters
projectIdstringOptional
versionIdstringOptional
Responses
204
Deletion successful, no content returned
delete
DELETE /api/v1/projects/{projectId}/versions/{versionId} HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Generated documents

Use this API to generate and download the SBOM document for a given project. Optionally, a certain version ID can be specified:

  • If no versionId is specified, the document for the "current draft" state (corresponding to the main analyzed branch, not specific to a certain version) is downloaded.

  • If a versionId is specified, the document is generated for the given version (and its corresponding release ref).

By default, the response is an Excel file in binary form (xslx). Optionally, a format parameter with value cyclonedx can be used to generate and download the SBOM document in CycloneDX JSON format (specifically, CyclonedX version 1.5).

Generate and retrieve the SBOM document

get
Authorizations
Path parameters
projectIdstringOptional
Query parameters
versionIdstringOptional

Ketryx version ID. If not specified, defaults to using the "current draft" state.

formatstring · enumOptional

SBOM format to return. Defaults to "xslx".

Example: cyclonedxPossible values:
get
GET /api/v1/projects/{projectId}/generated-documents/sbom HTTP/1.1
Host: app.ketryx.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

Last updated

Was this helpful?