Set Truststore
Endpoint
PUT /apiops/projects/{projectName}/credentials/{username}/truststore/{keystoreName}/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
| username | string | Yes | Username of the credential |
| keystoreName | string | Yes | Name of the truststore (keystore) to assign |
Notes
- Truststore (keystore) must exist in the project or in the admin project
- Credential must exist
- Only one truststore can be assigned to a credential at a time
- Assigning a new truststore replaces the existing one if present
- Truststore is used for mTLS (mutual TLS) connections
Response
Success Response (200 OK)
{
"success": true,
"deploymentResult": {
"success": true,
"message": "Deployment completed successfully",
"environmentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployed successfully"
},
{
"environmentName": "staging",
"success": true,
"message": "Deployed successfully"
}
]
}
}
Error Response (400 Bad Request)
{
"error": "bad_request",
"error_description": "Credential (username: api-user) was not found!"
}
or
{
"error": "bad_request",
"error_description": "Truststore (name: my-truststore) is not found!"
}
Error Response (401 Unauthorized)
{
"error": "unauthorized_client",
"error_description": "Invalid token"
}
Error Response (404 Not Found)
{
"error": "not_found",
"error_description": "Project(MyProject) was not found or user does not have privilege to access it!"
}
cURL Example
curl -X PUT \
"https://demo.apinizer.com/apiops/projects/MyProject/credentials/api-user/truststore/my-truststore/" \
-H "Authorization: Bearer YOUR_TOKEN"
Notes and Warnings
-
Truststore Requirements:
- Truststore (keystore) must exist in the project or admin project
- Truststore name is case-sensitive
- Truststore is used for mTLS connections
-
Credential Requirements:
- Credential must exist
- Credential must be in the same project or accessible from the project
-
Replacement Behavior:
- Assigning a new truststore replaces any existing truststore
- Previous truststore assignment is automatically removed
-
mTLS Usage:
- Truststore is specifically used for mutual TLS connections
- Contains trusted certificates for client authentication
-
Automatic Deployment:
- Credential is automatically deployed to all environments after truststore assignment
- Deployment results are returned in the response
Permissions
- User must have
IDENTITY+MANAGEpermission in the project - For automatic deployment, user must also have
IDENTITY+DEPLOY_UNDEPLOYpermission
Related Documentation
- Remove Truststore - Remove truststore from credential
- Set Keystore - Assign keystore to credential
- List Credentials - List all credentials