Skip to main content

Update Credential Metadata

Update credential metadata (not the credentials themselves). This endpoint allows partial updates to credential information such as name, description, scopes, and status without modifying the actual authentication tokens.


Endpoint

Method: PATCH URL: {{base_url}}/api/v1/credentials/{integrationId}/{credentialId}


Authentication

This endpoint uses Bearer Token authentication via a JWT (JSON Web Token). The token must be included in the Authorization header. Requires appropriate permissions to manage credentials.


Headers

HeaderDescriptionRequired
AuthorizationBearer token (JWT) for authenticationYes
acceptSpecifies acceptable response formats (application/json)Yes
content-typeMust be application/jsonYes
x-tenantidUUID identifying the tenant/organizationYes
realmnameThe authentication realm nameNo

Path Parameters

ParameterTypeDescriptionRequired
integrationIdstringThe unique identifier of the integrationYes
credentialIdstring (UUID)The unique identifier of the credentialYes

Query Parameters

None.


Request Body Schema

All fields are optional — only include fields you want to update.

FieldTypeDescriptionRequired
credentialNamestringHuman-readable name for the credentialNo
descriptionstringDescription of the credential's purposeNo
scopesarrayList of permission scopes (replaces existing)No
metadataobjectAdditional custom properties (replaces existing)No
statusstringCredential status: active or inactiveNo

Request Body Example

{
"credentialName": "string",
"description": "string",
"scopes": [
"string"
],
"metadata": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"status": "active"
}

Update Name and Description:

{
"credentialName": "ServiceNow Production v2",
"description": "Updated OAuth credentials for ServiceNow ITSM - migrated instance"
}

Update Scopes:

{
"scopes": [
"read",
"write",
"admin",
"reports"
]
}

Update Metadata:

{
"metadata": {
"environment": "production",
"instanceUrl": "https://new-instance.service-now.com",
"version": "utah",
"migrationDate": "2025-07-10"
}
}

Deactivate Credential:

{
"status": "inactive"
}

Example cURL

curl --request PATCH \
--url '{{base_url}}/api/v1/credentials/servicenow-prod-001/cred-550e8400-e29b-41d4-a716-446655440001' \
--header 'accept: application/json' \
--header 'authorization: Bearer {{access_token}}' \
--header 'content-type: application/json' \
--header 'x-tenantid: {{tenant_id}}' \
--data '{
"credentialName": "ServiceNow Production v2",
"description": "Updated OAuth credentials for ServiceNow ITSM",
"scopes": [
"read",
"write",
"admin"
],
"metadata": {
"environment": "production",
"version": "utah"
},
"status": "active"
}'

Success Response Example

Status Code: 200 OK

{
"success": true,
"message": "Credential metadata updated successfully",
"data": {
"id": "cred-550e8400-e29b-41d4-a716-446655440001",
"integrationId": "servicenow-prod-001",
"credentialName": "ServiceNow Production v2",
"description": "Updated OAuth credentials for ServiceNow ITSM",
"authType": "oauth2_bearer",
"scopes": [
"read",
"write",
"admin"
],
"metadata": {
"environment": "production",
"version": "utah"
},
"status": "active",
"expiresAt": "2025-07-10T14:15:00.000Z",
"updatedAt": "2025-07-10T13:55:00.000Z",
"updatedBy": {
"id": "1876278a-3634-4833-b73e-1536d806e117",
"name": "Deepak purohit",
"email": "deepak.purohit@rezolve.ai"
},
"changes": {
"credentialName": {
"from": "ServiceNow Production",
"to": "ServiceNow Production v2"
},
"scopes": {
"added": ["admin"],
"removed": []
}
}
},
"timestamp": "2025-07-10T13:55:00.000Z"
}
Metadata Only

This endpoint updates metadata only. To update the actual credentials (tokens, secrets), use the credential rotation endpoint or store new credentials.


Error Responses

Status CodeErrorDescription
400 Bad RequestInvalid request bodyMalformed JSON or invalid field values
401 UnauthorizedAuthentication failedBearer token is missing, expired, or invalid
403 ForbiddenInsufficient permissionsUser lacks permission to update credentials
404 Not FoundCredential not foundNo credential exists with the specified IDs
422 Unprocessable EntityValidation errorInvalid status value or scope format
500 Internal Server ErrorServer errorUnexpected server-side error

Example Error Response:

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request body",
"details": {
"status": "Invalid status value: 'disabled'. Allowed: active, inactive"
}
},
"timestamp": "2025-07-10T13:55:00.000Z"
}

Notes

  1. Metadata Only: This endpoint updates credential metadata. It does not modify the actual authentication tokens (accessToken, refreshToken).

  2. Partial Update: Only fields included in the request body are modified. Omitted fields retain their current values.

  3. Array Replacement: Array fields (scopes) and object fields (metadata) are replaced entirely, not merged.

  4. Status Changes: Setting status to inactive prevents the credential from being used without deleting it.

  5. Token Update: To update actual tokens, use POST /credentials/{credentialId}/rotate or store new credentials.

  6. Audit Trail: All changes are logged with the user who made the change and timestamp.

  7. Change Tracking: The response includes a changes object showing what was modified.

  8. Required Roles: Typically requires integration_admin role to update credential metadata.

  9. Related Endpoints:

    • GET /credentials/{integrationId} — Get credential with decrypted data
    • GET /credentials/{integrationId}/details — Get credential metadata
    • POST /credentials — Store new credentials
    • DELETE /credentials/{credentialId} — Delete credential
    • POST /credentials/{credentialId}/rotate — Rotate credential tokens