# Unfollow a user

<mark style="color:red;">`DELETE`</mark> `https://us-central1-appgregator.cloudfunctions.net/twitter/users/unfollow-user/`

#### Query Parameters

| Name                                               | Type   | Description                                        |
| -------------------------------------------------- | ------ | -------------------------------------------------- |
| name<mark style="color:red;">\*</mark>             | String | qantor.co.id                                       |
| connection\_name<mark style="color:red;">\*</mark> | String | twitter-1                                          |
| consumer\_key<mark style="color:red;">\*</mark>    | String | A2e5O2qsMA7BLUTPv5Q5NJVQ6                          |
| consumer\_secret<mark style="color:red;">\*</mark> | String | rfIzsxYoLbzbYEj5mwQ9imtusVwua6NBabv8TK57xGkzgxtFkN |
| access\_token<mark style="color:red;">\*</mark>    | String | 245297600-2EScP0ZudcOPpFwJ6yo2TlSpAmLTUpyXX1zdmh13 |
| token\_secret<mark style="color:red;">\*</mark>    | String | d2dmLjbuK4AYY9Cfq2xF52UdSev21ewNJrirUaB4Ok4vX      |

#### Headers

| Name                                        | Type   | Description                      |
| ------------------------------------------- | ------ | -------------------------------- |
| x-api-key<mark style="color:red;">\*</mark> | String | 43c464439b5507293ba7b315c9875907 |

{% tabs %}
{% tab title="200: OK Success" %}
```javascript
{
    "following": false
}
```
{% endtab %}

{% tab title="400: Bad Request Bad request" %}
```javascript
{
    "type": "response",
    "code": 400,
    "error": {
        "errors": [
            {
                "parameters": {
                    "target_user_id": [
                        "692311870"
                    ]
                },
                "message": "You cannot unfollow an account that is not active."
            }
        ],
        "title": "Invalid Request",
        "detail": "One or more parameters to your request was invalid.",
        "type": "https://api.twitter.com/2/problems/invalid-request"
    },
    "rateLimit": {
        "limit": 50,
        "remaining": 49,
        "reset": 1656663411
    },
    "headers": {
        "date": "Fri, 01 Jul 2022 08:01:51 UTC",
        "server": "tsa_b",
        "set-cookie": [
            "guest_id=v1%3A165666251107316377; Max-Age=34214400; Expires=Tue, 01 Aug 2023 08:01:51 GMT; Path=/; Domain=.twitter.com; Secure; SameSite=None"
        ],
        "api-version": "2.45",
        "content-type": "application/json; charset=utf-8",
        "cache-control": "no-cache, no-store, max-age=0",
        "content-length": "222",
        "x-access-level": "read-write",
        "x-frame-options": "SAMEORIGIN",
        "content-encoding": "gzip",
        "x-xss-protection": "0",
        "x-rate-limit-limit": "50",
        "x-rate-limit-reset": "1656663411",
        "content-disposition": "attachment; filename=json.json",
        "x-content-type-options": "nosniff",
        "x-rate-limit-remaining": "49",
        "strict-transport-security": "max-age=631138519",
        "x-response-time": "52",
        "x-connection-hash": "577602ad18f6f2a8aa228d20db63239169919072b6983b1c7abfe08446cc58bf",
        "connection": "close"
    }
}
```
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="cURL" %}
```shell
curl --location --request DELETE 'https://us-central1-appgregator.cloudfunctions.net/twitter/users/unfollow-user?name=qantor.co.id&connection_name=twitter-1&consumer_key=A2e5O2qsM....&consumer_secret=rfIzsxYoLbzbYEj....&access_token=245297600-2EScP0Zudc....&token_secret=d2dmLjbuK4AYY9....&my_id=245297600&target_user_id=692311870' \
--header 'x-api-key: 43c464439b5507293ba7b315c9875907'
```
{% endtab %}

{% tab title="NodeJS - Axios" %}
```javascript
var axios = require('axios');

var config = {
  method: 'delete',
  url: 'https://us-central1-appgregator.cloudfunctions.net/twitter/users/unfollow-user?name=qantor.co.id&connection_name=twitter-1&consumer_key=A2e5O2qsM....&consumer_secret=rfIzsxYoLbzbYEj....&access_token=245297600-2EScP0Zudc....&token_secret=d2dmLjbuK4AYY9....&my_id=245297600&target_user_id=692311870',
  headers: { 
    'x-api-key': '43c464439b5507293ba7b315c9875907'
  }
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

```
{% endtab %}

{% tab title="PHP - cURL" %}
```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/twitter/users/unfollow-user?name=qantor.co.id&connection_name=twitter-1&consumer_key=A2e5O2qsM....&consumer_secret=rfIzsxYoLbzbYEj....&access_token=245297600-2EScP0Zudc....&token_secret=d2dmLjbuK4AYY9....&my_id=245297600&target_user_id=692311870',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'DELETE',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: 43c464439b5507293ba7b315c9875907'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```
{% endtab %}
{% endtabs %}
