Skip to main content

Get Credentials

Get credential with decrypted data. This endpoint retrieves stored credentials for a specific integration, returning the decrypted authentication data for use in third-party integrations.


Endpoint

Method: GET URL: {{base_url}}/api/v1/credentials/{integrationId}


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 access credentials.


Headers

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

Path Parameters

ParameterTypeDescriptionRequired
integrationIdstringThe unique identifier of the integrationYes

Query Parameters

ParameterTypeDescriptionRequired
credentialIdstring (UUID)Credential ID (optional) - use to retrieve a specific credential when multiple exist for an integrationNo

Request Body Schema

Not applicable — this is a GET request with no request body.


Example cURL

curl --request GET \
--url '{{base_url}}/api/v1/credentials/servicenow-prod-001' \
--header 'accept: application/json' \
--header 'authorization: Bearer {{access_token}}' \
--header 'x-tenantid: {{tenant_id}}'

With Credential ID:

curl --request GET \
--url '{{base_url}}/api/v1/credentials/servicenow-prod-001?credentialId=cred-550e8400-e29b-41d4-a716-446655440001' \
--header 'accept: application/json' \
--header 'authorization: Bearer {{access_token}}' \
--header 'x-tenantid: {{tenant_id}}'

Success Response Example

Status Code: 200 OK

{
"success": true,
"message": "Credentials retrieved successfully",
"data": {
"id": "cred-550e8400-e29b-41d4-a716-446655440001",
"integrationId": "servicenow-prod-001",
"credentialName": "ServiceNow Production",
"description": "OAuth credentials for ServiceNow ITSM production instance",
"authType": "oauth2_bearer",
"scopes": [
"read",
"write"
],
"tokenEndpoint": "https://instance.service-now.com/oauth_token.do",
"authorizationEndpoint": "https://instance.service-now.com/oauth_auth.do",
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "dGhpcyBpcyBhIHJlZnJlc2ggdG9rZW4...",
"metadata": {
"environment": "production",
"instanceUrl": "https://instance.service-now.com",
"version": "tokyo"
},
"status": "active",
"expiresAt": "2025-07-10T14:15:00.000Z",
"createdAt": "2025-07-10T13:15:00.000Z",
"createdBy": {
"id": "1876278a-3634-4833-b73e-1536d806e117",
"name": "Deepak purohit",
"email": "deepak.purohit@rezolve.ai"
},
"lastAccessedAt": "2025-07-10T13:45:00.000Z",
"tenant": {
"id": "{{tenant_id}}",
"name": "{{tenant_name}}"
}
},
"timestamp": "2025-07-10T13:50:00.000Z"
}
Security Notice

This endpoint returns decrypted sensitive data. Ensure proper access controls and audit logging are in place. Never log or expose the response in client-side applications.


Error Responses

Status CodeErrorDescription
400 Bad RequestInvalid parametersInvalid integrationId or credentialId format
401 UnauthorizedAuthentication failedBearer token is missing, expired, or invalid
403 ForbiddenInsufficient permissionsUser lacks permission to access credentials
404 Not FoundCredential not foundNo credential exists for the specified integration
500 Internal Server ErrorServer errorUnexpected server-side error

Example Error Response (Not Found):

{
"success": false,
"error": {
"code": "CREDENTIAL_NOT_FOUND",
"message": "Credential not found",
"details": "No credential exists for integration ID: servicenow-prod-999"
},
"timestamp": "2025-07-10T13:50:00.000Z"
}

Example Error Response (Invalid Credential ID):

{
"success": false,
"error": {
"code": "INVALID_PARAMETER",
"message": "Invalid credentialId format",
"details": "credentialId must be a valid UUID"
},
"timestamp": "2025-07-10T13:50:00.000Z"
}

Notes

  1. Decrypted Data: This endpoint returns decrypted credential data including access tokens and refresh tokens. Handle with care.

  2. Access Logging: All access to credentials is logged for security auditing purposes.

  3. Multiple Credentials: If multiple credentials exist for an integration, use the credentialId query parameter to retrieve a specific one.

  4. Token Expiration: Check the expiresAt field to determine if tokens need to be refreshed.

  5. Last Accessed: The lastAccessedAt field tracks when the credential was last retrieved.

  6. Status Check: Verify the status field is active before using the credentials.

  7. Caching: Avoid caching decrypted credentials. Retrieve them fresh when needed.

  8. Required Roles: Typically requires integration_admin or specific integration access roles.

  9. Related Endpoints:

    • POST /credentials — Store new credentials
    • PATCH /credentials/{credentialId} — Update credential
    • DELETE /credentials/{credentialId} — Delete credential
    • POST /credentials/{credentialId}/rotate — Rotate credential tokens