# delete\_\_repo\_{repoId}\_apikey\_{apikeyId}

`DELETE /repo/{repoId}/apikey/{apikeyId}`

*Delete Repository API Key*

Delete an API key

#### TypeScript Client Library

```typescript
public deleteRepoKey = async (repoId: string, keyId: string): Promise<ActionResponse> => {
  return this.makeRequest<ActionResponse>(`repo/${repoId}/apikey/${keyId}`, 'DELETE', null);
};
```

#### Code Samples

{% tabs %}
{% tab title="Shell" %}

```shell
# You can also use wget
curl -X DELETE https://backend.flashback.tech/repo/{repoId}/apikey/{apikeyId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'
```

{% endtab %}

{% tab title="HTTP" %}

```http
DELETE https://backend.flashback.tech/repo/{repoId}/apikey/{apikeyId} HTTP/1.1
Host: localhost:3000
Accept: application/json
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const headers = {
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://backend.flashback.tech/repo/{repoId}/apikey/{apikeyId}',
{
  method: 'DELETE',
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.delete 'https://backend.flashback.tech/repo/{repoId}/apikey/{apikeyId}',
  params: {
  }, headers: headers

p JSON.parse(result)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.delete('https://backend.flashback.tech/repo/{repoId}/apikey/{apikeyId}', headers = headers)

print(r.json())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

require 'vendor/autoload.php';

$headers = array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('DELETE','https://backend.flashback.tech/repo/{repoId}/apikey/{apikeyId}', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
```

{% endtab %}

{% tab title="Java" %}

```java
URL obj = new URL("https://backend.flashback.tech/repo/{repoId}/apikey/{apikeyId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://backend.flashback.tech/repo/{repoId}/apikey/{apikeyId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
```

{% endtab %}
{% endtabs %}

#### Parameters <a href="#delete__repo_-repoid-_apikey_-apikeyid-parameters" id="delete__repo_-repoid-_apikey_-apikeyid-parameters"></a>

| Name     | In   | Type   | Required | Description |
| -------- | ---- | ------ | -------- | ----------- |
| repoId   | path | string | true     | none        |
| apikeyId | path | string | true     | none        |

> Example responses

> 200 Response

```json
{
  "success": true,
  "message": "string"
}
```

#### Responses <a href="#delete__repo_-repoid-_apikey_-apikeyid-responses" id="delete__repo_-repoid-_apikey_-apikeyid-responses"></a>

| Status | Meaning                                                 | Description                  | Schema |
| ------ | ------------------------------------------------------- | ---------------------------- | ------ |
| 200    | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | API key deleted successfully | Inline |

#### Response Schema <a href="#delete__repo_-repoid-_apikey_-apikeyid-responseschema" id="delete__repo_-repoid-_apikey_-apikeyid-responseschema"></a>

Status Code **200**

| Name      | Type    | Required | Restrictions | Description |
| --------- | ------- | -------- | ------------ | ----------- |
| » success | boolean | false    | none         | none        |
| » message | string  | false    | none         | none        |

To perform this operation, you must be authenticated by means of one of the following methods: BearerAuth
