Skip to main content
The connections module acts on the logged-in user’s own mutual connections — bidirectional relationships, similar to “friends.” Use it to list accepted connections, inspect outgoing and incoming pending requests, and accept, decline, or remove connections.
To request a connection with someone, check the connection status against a specific user, or remove a connection by the other user’s ID, use the users module.

fetchConnections

Returns a paginated list of your accepted connections.
number
Page number (1-indexed). Defaults to 1.
number
Results per page: a whole number from 1 to 100. Defaults to 20. A larger value is rejected with 400 connection/invalid-query, never lowered to 100.
string
Optional search term. Filters the list to connections whose other user’s username or name contains this text (case-insensitive). When omitted, no filtering is applied.
string
Restricts which field query matches against — username or name. When omitted, query matches either field.
Returns — Promise<PaginatedResponse<AcceptedConnectionRow>>, where AcceptedConnectionRow is { id, user, status: "accepted", createdAt, respondedAt } and user is the other user in the connection.

fetchConnectionsCount

Returns the number of your accepted connections.
Returns — Promise<{ count: number }>

fetchSentPendingConnections

Returns a paginated list of your outgoing connection requests that are still pending.
number
Page number (1-indexed). Defaults to 1.
number
Results per page: a whole number from 1 to 100. Defaults to 20. A larger value is rejected with 400 connection/invalid-query, never lowered to 100.
Returns — Promise<PaginatedResponse<ConnectionRow>>, where ConnectionRow is { id, user, type, message, status, createdAt, respondedAt }. Here user is the user the request was sent to, type is "sent", status is "pending" and respondedAt is null.

fetchReceivedPendingConnections

Returns a paginated list of incoming connection requests you have received.
number
Page number (1-indexed). Defaults to 1.
number
Results per page: a whole number from 1 to 100. Defaults to 20. A larger value is rejected with 400 connection/invalid-query, never lowered to 100.
Returns — Promise<PaginatedResponse<ConnectionRow>>. Here user is the user who sent the request, type is "received", status is "pending" and respondedAt is null.

acceptConnection

Accepts a pending incoming connection request.
string
required
The ID of the pending connection request to accept.
Returns — Promise<ConnectionRow>: the accepted connection from your side (user is the requester, type is "received", status is "accepted"). See ConnectionRow.

declineConnection

Declines a pending incoming connection request.
string
required
The ID of the pending connection request to decline.
Returns — Promise<ConnectionRow>: the declined connection from your side (user is the requester, type is "received", status is "declined"). See ConnectionRow.

removeConnection

Removes a connection by its connection ID: withdraws a pending request you sent, or disconnects an accepted connection (either user can).
string
required
The connection ID to remove.
Returns — Promise<void>. It resolves with no value once the connection is removed (the server answers 204 No Content).