Bulk Assign Package Labels

posthttps://app.fossa.com/api/package-label-assignments/bulk

Assign a single Package Label to multiple packages at once. Note - This endpoint is not available for organizations on the Free plan.

Request body (required) · application/json

packageLocatorsstring[]required

Array of revision locators to assign the label to. Must include the version (e.g., 'npm+lodash$4.17.21').

labelIdintegerrequired

The ID of the label to assign to all packages.

scopeenumrequired

The scope of the package label assignment.

orgprojectrevision
scopeIdstring

The ID of the scope to assign labels to. Required if scope is 'project' or 'revision'.

shouldUseSpecificVersionboolean

If true, labels will apply to the specific versions provided in the packageLocators. If false, labels will apply to all versions of the packages (ignoring the version part of the locator). Defaults to true.

Responses

201Created
packageLabelAssignmentsobject[]required

The package label assignments that were written. Newly created assignments only -- existing (duplicate) assignments are not returned.

idintegerrequired

The ID of the package label assignment.

createdAtstring <date-time>required

The date and time the package label assignment was created.

updatedAtstring <date-time>required

The date and time the package label assignment was last updated.

organizationIdintegerrequired

The ID of the organization that owns the package label assignment.

labelIdintegerrequired

The ID of the label that was assigned to the package.

packageIdstringrequired

The ID of the package that the label was assigned to.

packageVersionstring

The version of the package that the label was assigned to or null if the label was assigned to all versions.

scopeenumrequired

The scope of the package label assignment.

orgprojectrevision
scopeIdstringrequired

The ID of the scope that the label was assigned to or null if the label was assigned to all scopes.

400Bad request - Invalid input such as empty packageLocators array, missing required fields, or invalid scope.
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

403Forbidden - User does not have permission to assign labels or organization is on Free plan.
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

404Not Found - Package label or one or more packages do not exist.
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

500Internal server error
uuidstring

Unique identifier associated with the error

codeinteger

fossa specific error code

messagestring

message associated with this error

namestring

name of the error

httpStatusCodeinteger

http status code number

Try this endpoint

Build a request and run it against app.fossa.com.

Bearer

Stored in this browser for 24 hours. Try It uses a docs proxy for CORS and does not store tokens server-side.

POST https://app.fossa.com/api/package-label-assignments/bulk
curl --request POST \  --url 'https://app.fossa.com/api/package-label-assignments/bulk' \  --header 'accept: application/json' \  --header 'content-type: application/json' \  --data '{  "packageLocators": [    "npm+lodash$4.17.21",    "npm+react$17.0.2",    "maven+com.google.guava:guava$30.1-jre"  ],  "labelId": 1,  "scope": "org",  "shouldUseSpecificVersion": true}'

Real request. Mutating methods can change data.

Click Try It to run a request and see the response here.
application/json