Removing User Connections
This endpoint removes an existing connection between two Netevia users, regardless of the connection's current status (active or pending). It can be used to unlink sub-accounts, primary accounts, or consumers from one another. Once the unlink operation is successful, the directional relationship established by the original link request is fully dissolved.
Endpoint
POST /api/LinkedAccount/unlink
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a partner needs to revoke an authorized connection between two user profiles — for example, when an authorized user's access is terminated or when a business relationship between accounts ends. It is also appropriate for canceling a pending connection that has not yet been accepted or activated. Both the source and target user identifiers must be known before calling this endpoint.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
fromUserId | integer (int32) | Yes | The ID of the user who initiated or holds the connection. Can be a sub-account, primary account, or consumer. |
toUserId | integer (int32) | Yes | The ID of the user to whom the connection was made. Can be a sub-account, primary account, or consumer. |
{
"fromUserId": 1001,
"toUserId": 2045
}Response
200 OK
| Field | Type | Description |
|---|---|---|
profileId | integer (int32) | The profile ID associated with the operation. |
errors | string | null | Error message if the operation encountered an issue; null on success. |
success | boolean | Indicates whether the unlink operation was completed successfully. |
changeLog | array | null | List of change log entries recording the request type and description of changes applied. |
changeLog[].requestType | integer (int32) | Numeric code representing the type of banking request performed. |
changeLog[].changes | string | null | Human-readable description of the change made. |
{
"profileId": 1001,
"errors": null,
"success": true,
"changeLog": [
{
"requestType": 5,
"changes": "User connection removed between profileId 1001 and profileId 2045."
}
]
}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields, invalid user IDs, or the connection cannot be unlinked in its current state |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to remove this connection |
| 404 | One or both user IDs not found, or no existing connection between the specified users |
| 500 | Internal server error |
Common Mistakes
- Swapping
fromUserIdandtoUserId— the directionality of the original link must be preserved; reversing the IDs may result in a 404 if no connection exists in that direction. - Attempting to unlink users that were never connected — always verify the connection exists before calling this endpoint to avoid unexpected 400 or 404 responses.
- Sending string values for
fromUserIdortoUserId— both fields are integer (int32) types and must not be quoted or passed as strings. - Reusing an expired Bearer token — tokens expire after 10 minutes; refresh before making requests if the session has been idle.
Related Endpoints
POST /api/LinkedAccount/link— Create a new connection between two usersGET /api/LinkedAccount— Retrieve existing connections for a userPOST /api/auth/v2— Obtain a Bearer token for authenticationPOST /api/auth/refresh— Refresh an existing Bearer token
Example
curl -X POST https://api.banking.netevia.dev/api/LinkedAccount/unlink \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"fromUserId": 1001,
"toUserId": 2045
}'