# Reject Connection

## Reject the connection request for the requesting user.

> Reject the connection between the requesting user and request sender. If both users are in the same private pod,\
> an error will be returned because both users have an implicit connection which cannot be rejected.<br>

```json
{"openapi":"3.1.1","info":{"title":"Pod API","version":"20.17.1"},"servers":[{"url":"http://yourpodURL.symphony.com/pod"}],"paths":{"/v1/connection/reject":{"post":{"summary":"Reject the connection request for the requesting user.","description":"Reject the connection between the requesting user and request sender. If both users are in the same private pod,\nan error will be returned because both users have an implicit connection which cannot be rejected.\n","parameters":[{"schema":{"type":"string"},"name":"sessionToken","description":"Session authentication token.","in":"header","required":true}],"tags":["Connection"],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserConnection"}}}},"400":{"description":"Client error, see response body for further details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized: Invalid session token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Forbidden: Caller lacks necessary entitlement.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found: Connection cannot be found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Server error, see response body for further details.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserConnectionRequest"}}},"required":true}}}},"components":{"schemas":{"UserConnection":{"type":"object","description":"Connection status between two users","properties":{"userId":{"type":"integer","format":"int64","description":"user id"},"status":{"type":"string","description":"Connection status between the requesting user and the request sender","enum":["PENDING_INCOMING","PENDING_OUTGOING","ACCEPTED","REJECTED"]},"firstRequestedAt":{"type":"integer","format":"int64","description":"unix timestamp when the first request was made"},"updatedAt":{"type":"integer","format":"int64","description":"unix timestamp on the last updated date"},"requestCounter":{"type":"integer","format":"int32","description":"number of requests made"}}},"Error":{"type":"object","properties":{"code":{"type":"integer","format":"int32"},"message":{"type":"string"}}},"UserConnectionRequest":{"type":"object","description":"Request body for the Connection APIs","properties":{"userId":{"type":"integer","format":"int64","description":"user id"}}}}}}
```

This endpoint allows the user to reject a specific connection request. To define which connection request is to be rejected, the `userId` of the user who initiated the connection request must be included in the body.

Pods from all users involved need to have `crossPod` enabled between them.

> #### 📘 Rejected Connections
>
> Reject the connection between the requesting user and request sender. If both users are in the same private pod, an error will be returned because both users have an implicit connection which cannot be rejected.

### Connection Behaviour

Currently, there are four possible connection status:

* PENDING\_INCOMING: The specified user requested to connect with the calling user.
* PENDING\_OUTGOING: The calling user requested to connect with the specified user.
* ACCEPTED: The two users are connected.
* REJECTED: The two users are not connected.

The following table shows the connection current behaviors:

| Initial Connection Status       | Request Action | New Connection Status |
| ------------------------------- | -------------- | --------------------- |
| None (connection did not exist) | Connect        | PENDING\_OUTGOING     |
| PENDING\_INCOMING               | Accept         | ACCEPTED              |
| PENDING\_INCOMING               | Reject         | REJECTED              |
