Removing User Connections

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

FieldTypeRequiredDescription
fromUserIdinteger (int32)YesThe ID of the user who initiated or holds the connection. Can be a sub-account, primary account, or consumer.
toUserIdinteger (int32)YesThe 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

FieldTypeDescription
profileIdinteger (int32)The profile ID associated with the operation.
errorsstring | nullError message if the operation encountered an issue; null on success.
successbooleanIndicates whether the unlink operation was completed successfully.
changeLogarray | nullList of change log entries recording the request type and description of changes applied.
changeLog[].requestTypeinteger (int32)Numeric code representing the type of banking request performed.
changeLog[].changesstring | nullHuman-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

CodeWhen it happens
400Missing required fields, invalid user IDs, or the connection cannot be unlinked in its current state
401Token missing, expired, or invalid
403Insufficient permissions to remove this connection
404One or both user IDs not found, or no existing connection between the specified users
500Internal server error

Common Mistakes

  • Swapping fromUserId and toUserId — 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 fromUserId or toUserId — 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 users
  • GET /api/LinkedAccount — Retrieve existing connections for a user
  • POST /api/auth/v2 — Obtain a Bearer token for authentication
  • POST /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
  }'
Body Params
Headers
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json