Licenses (v1)

This document uses the v1 API. For more details, see the v1 API.

Note: When you import or update Projects, changes will be reflected in the endpoint results after a one-hour delay.

List all licenses

post

Required permissions

  • View Organization

  • View Project

  • View Project Snapshot

Path parameters
orgIdstringRequired

The organization ID to list projects for. The API_KEY must have access to this organization.

Example: 4a18d42f-0706-4ad0-b127-24078731fbed
Query parameters
sortByall ofOptional

The field to sort results by.

string · enumOptionalPossible values:
and
anyOptional

The field to sort results by.

Example: license
orderall ofOptional

The direction to sort results by.

string · enumOptionalPossible values:
and
anyOptional

The direction to sort results by.

Body
all ofOptional
and
anyOptionalExample: {"filters":{"languages":["node","ruby","java","cpp"],"projects":[],"dependencies":[],"licenses":[],"severity":["none","high","medium","low"]}}
Responses
200Success
application/json; charset=utf-8
Responseall of
and
anyOptionalExample: {"results":[{"id":"MIT","severity":"none","instructions":"","dependencies":[{"id":"[email protected]","name":"accepts","version":"1.0.0","packageManager":"npm"}],"projects":[{"name":"atokeneduser/goof","id":"6d5813be-7e6d-4ab8-80c2-1e3e2a454545"}]}],"total":1}
post
POST /v1/org/{orgId}/licenses HTTP/1.1
Host: api.snyk.io
Content-Type: application/json
Accept: */*
Content-Length: 142

{
  "filters": {
    "languages": [
      "node",
      "ruby",
      "java",
      "cpp"
    ],
    "projects": [],
    "dependencies": [],
    "licenses": [],
    "severity": [
      "none",
      "high",
      "medium",
      "low"
    ]
  }
}
200Success
{
  "results": [
    {
      "id": "MIT",
      "severity": "none",
      "instructions": "",
      "dependencies": [
        {
          "id": "[email protected]",
          "name": "accepts",
          "version": "1.0.0",
          "packageManager": "npm"
        }
      ],
      "projects": [
        {
          "name": "atokeneduser/goof",
          "id": "6d5813be-7e6d-4ab8-80c2-1e3e2a454545"
        }
      ]
    }
  ],
  "total": 1
}

Last updated

Was this helpful?

Revision created

Add comment to emphasize required filters hidden in GitBook collapsed field