Skip to main content

Comprehensive Guide to Commvault REST API

This guide provides an in-depth overview of how to use Commvault's REST APIs to create custom interfaces tailored to your specific needs. Whether you're a seasoned developer or new to API integration, this documentation will help you navigate through the capabilities of Commvault's RESTful services. 🚀

What is Commvault REST API?​

Commvault REST (Representational State Transfer) APIs represent operations performed in the CommandCenter. You can use these APIs to create custom interfaces that focus on the operations your users need. The REST APIs are built on the HTTP protocol, making them compatible with your preferred programming languages and tools. 🌐

Supported HTTP Methods​

Commvault REST APIs support the following HTTP methods:

🔍 GET​

The GET method lists objects and includes the information needed to perform additional operations on the object. This method is read-only and does not alter any resources.

Sample Use Case: List all of the users in the CommCell.

GET /v4/user

📝 POST​

The POST method creates an object. Most requests using the POST method require JSON in the request body.

Sample Use Case: Create a server group.

POST /v4/servergroup
Content-Type: application/json

{
"name": "string",
"serverGroupType": "MANUAL",
"description": "string"
"manualAssociation": {
"associatedservers": [
{
"id": 0,
"name": "string"
}
]
}
}

✏️ PUT​

The PUT method updates an existing object.

Sample Use Case: Update an existing user.

PUT /v4/user/123
Content-Type: application/json

{
"fullName": "string",
"newName": "string",
"email": "string"
}

🗑️ DELETE​

The DELETE method removes objects.

Sample Use Case: Delete a storage policy.

DELETE /storagePolicies/456

🛠️ Responses​

Responses to these API requests are served in JSON format.

Sample Request for JSON:

GET /user
Accept: application/json

🔒 Authentication​

Commvault APIs are secured by an AuthToken in the request header, which you obtain after logging in. This token must be included in the header of each request to authenticate and authorize access.

Sample Authentication Header:

GET /users
AuthToken: your_auth_token_here

Obtaining the AuthToken​

To obtain the AuthToken, you need to log in with your credentials.

POST /login
Content-Type: application/json

{
"username": "your_username",
"password": "your_password"
}

Response:

{
"token": "QSDK ..."
}

🎯 Conclusion​

The Commvault REST API provides powerful tools to integrate and automate your data management operations. By leveraging these APIs, you can build robust and efficient interfaces that cater to the unique needs of your users.

For more detailed information and advanced use cases, refer to the Commvault API Reference.