> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove Truststore

> Removes the truststore assignment from a credential. The credential will no longer use the truststore for mutual TLS (mTLS) connections. The credential is automatically deployed to all environments after the truststore is removed.

## Endpoint

```
DELETE /apiops/projects/{projectName}/credentials/{username}/truststore/
```

## 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 |

### Notes

* Credential must exist
* Credential must have a truststore assigned, otherwise the operation returns an error

## Response

### Success Response (200 OK)

```json theme={null}
{
  "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)

```json theme={null}
{
  "error": "bad_request",
  "error_description": "Credential (username: api-user) was not found!"
}
```

### Error Response (401 Unauthorized)

```json theme={null}
{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}
```

### Error Response (404 Not Found)

```json theme={null}
{
  "error": "not_found",
  "error_description": "Project(MyProject) was not found or user does not have privilege to access it!"
}
```

## cURL Example

```bash theme={null}
curl -X DELETE \
  "https://demo.apinizer.com/apiops/projects/MyProject/credentials/api-user/truststore/" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Notes and Warnings

* **Credential Requirements**:
  * Credential must exist
  * Credential must have a truststore assigned, otherwise the operation returns a 400 error

* **Automatic Deployment**:
  * Credential is automatically deployed to all environments after truststore removal
  * Deployment results are returned in the response

* **No Impact on Truststore**:
  * The truststore itself is not deleted
  * Only the assignment to the credential is removed

* **mTLS Impact**:
  * Removing truststore may affect mTLS connections
  * Ensure alternative truststore is configured if needed

## Permissions

* User must have **`IDENTITY` + `MANAGE`** permission in the project
* For automatic deployment, user must also have **`IDENTITY` + `DEPLOY_UNDEPLOY`** permission

## Related Documentation

* [Set Truststore](/api-reference/credentials/secrets/set-truststore) - Assign truststore to credential
* [Set Keystore](/api-reference/credentials/secrets/set-keystore) - Assign keystore to credential
* [List Credentials](/api-reference/credentials/crud/list-credentials) - List all credentials
