Ana içeriğe geç

Change Credential Password

Endpoint

PATCH /apiops/projects/{projectName}/credentials/{username}/

Authentication

Requires a Personal API Access Token.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {token}Yes
Content-Typeapplication/jsonYes

Path Parameters

ParameterTypeRequiredDescription
projectNamestringYesProject name
usernamestringYesUsername of the credential

Request Body

Full JSON Body Example

{
"password": "NewSecurePassword123!"
}

Request Body Fields

FieldTypeRequiredDefaultDescription
passwordstringYes-New password for the credential

Notes

  • Only password field is required
  • Other fields are ignored if provided
  • Password must not be empty
  • Credential must exist

Response

Success Response (200 OK)

{
"success": true,
"deploymentResult": {
"success": true,
"message": "Deployment completed successfully",
"environmentResults": [
{
"environmentName": "production",
"success": true,
"message": "Deployed successfully"
}
]
}
}

Error Response (400 Bad Request)

{
"error": "bad_request",
"error_description": "Credential password can not be empty!"
}

or

{
"error": "bad_request",
"error_description": "Credential (username: api-user) was 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 PATCH \
"https://demo.apinizer.com/apiops/projects/MyProject/credentials/api-user/" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"password": "NewSecurePassword123!"
}'

Notes and Warnings

  • Password Only:

    • Only password is updated
    • Other fields remain unchanged
  • Password Required:

    • Password must not be empty
  • Credential Must Exist:

    • Credential with specified username must exist
  • Automatic Deployment:

    • Credential is automatically deployed after password change
    • Deployment results are returned in the response