DELETE v4/packages/:pkg_sku/assets - Delete

Remove asset/sku from a specific package. You can only remove assets from a package in which the requesting API key created the package.

Supported Roles and Authentication Protocols

Type Supported Values
Authentication Protocols API Key
Valid for Roles System to System

API Request

HTTP Verbs and URLs

DELETE v4/packages/:pkg_sku/assets
  • :pkg_sku is the SKU generated by VitalSource at creation and returned in the response

Request Headers

Content-Type: application/json

Request Body


"products": ["L-999-70461"]

Element Descriptions

Element Description Required
products {sku} A list of assets or sku identifiers that when provided are removed from a specific package. This immediately removes access for a specific title within a package for all users Yes

Request Response

curl -X DELETE "X-VitalSource-API-Key: ABCDEFGHIJKLMNOP" -H "Content-Type: application/json" -d '{ 
"products": ["1234]
}' ""
HTTP Code: 200
"removed_count": 1
require 'uri'
require 'net/http'

url = URI("")

http =, url.port)
http.use_ssl = true

request =
request["x-vitalsource-api-key"] = 'ABCDEFGHIJKLMNOP'
request["content-type"] = 'application/json'
request.body = "{ \n \"products\": [\"L-999-70461\"]\n}"

response = http.request(request)
puts response.read_body

client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
"products": ["L-999-70461"]


'content-type' => 'application/json',
'x-vitalsource-api-key' => 'ABCDEFGHIJKLMNOP',

$response = $client->getResponse();

echo $response->getBody(); ?php>
var client = new RestClient("");
var request = new RestRequest(Method.DELETE);
request.AddHeader("content-type", "application/json");
request.AddHeader("x-vitalsource-api-key", "ABCDEFGHIJKLMNOP");
request.AddParameter("application/json", "{ \n \"products\": [\"L-999-70461\"]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var http = require("https");

var options = {
"method": "DELETE",
"hostname": "",
"port": null,
"path": "/v4/packages/:id/assets",
"x-vitalsource-api-key": "ABCDEFGHIJKLMNOP",
"content-type": "application/json",

var req = http.request(options, function (res) {
var chunks = [];

res.on("data", function (chunk) {

res.on("end", function () {
var body = Buffer.concat(chunks);

req.write(JSON.stringify({ products: [ 'L-999-70461' ] }));
import http.client

conn = http.client.HTTPSConnection("")

payload = "{ \n \"products\": [\"L-999-70461\"]\n}"

headers = {
'x-vitalsource-api-key': "ABCDEFGHIJKLMNOP",
'content-type': "application/json",

conn.request("DELETE", "/v4/packages/:id/assets", payload, headers)

res = conn.getresponse()
data =

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{ \n \"products\": [\"L-999-70461\"]\n}");
Request request = new Request.Builder()
.addHeader("x-vitalsource-api-key", "ABCDEFGHIJKLMNOP")
.addHeader("content-type", "application/json")

Response response = client.newCall(request).execute();

Element Descriptions

Element Description
removed_count Number of items successfully removed from the package.

Specific error codes for this endpoint

403: Permission Denied
404: Package not found

See our full list of error codes and messages.

Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.