> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://uploadcare.com/docs/llms.txt.

# Delete metadata key

DELETE https://api.uploadcare.com/files/{uuid}/metadata/{key}/

Delete a file's metadata key.

Reference: https://uploadcare.com/docs/api/rest/file-metadata/delete-file-metadata-key

## Authentication

- `Authorization` header (required) — Every request made to `https://api.uploadcare.com/` MUST be signed. HTTPS SHOULD be used with any authorization scheme. Requests MUST contain the `Authorization` header defining `auth-scheme` and `auth-param`: `Authorization: auth-scheme auth-param`. Every request MUST contain the `Accept` header identifying the REST API version: `Accept: application/vnd.uploadcare-v0.7+json`. There are two available authorization schemes: * For production: `Uploadcare`, a scheme where a `signature`, not your Secret API Key MUST be specified. Signatures SHOULD be generated on backend. * For quick tests: `Uploadcare.Simple`, a simple scheme where your [Secret API Key](https://app.uploadcare.com/projects/-/api-keys/) MUST be specified in every request's `auth-param`.

## Request

### Path parameters

- `uuid` (string, required) — File UUID.
- `key` (string, required) — Key of file metadata. List of allowed characters for the key: - Latin letters in lower or upper case (a-z,A-Z) - digits (0-9) - underscore `_` - a hyphen `-` - dot `.` - colon `:`

### Headers

- `Accept` (string, required) — Version header.

## Response

### 204

Key of a file metadata successfully deleted.

## Errors

### 400 Bad Request Error

Simple authentication over HTTP is forbidden. Please, use HTTPS or signed requests instead.

- `detail` (string, optional, default: Simple authentication over HTTP is forbidden. Please, use HTTPS or signed requests instead.)

### 401 Unauthorized Error

Authorization errors.

- `detail` (enum, optional)
  - Allowed values: `Incorrect authentication credentials.`, `Public key {public_key} not found.`, `Secret key not found.`, `Invalid signature. Please check your Secret key.`

### 406 Not Acceptable Error

Invalid version header `Accept` for this endpoint.

- `detail` (string, optional, default: Incorrect Accept header provided. Make sure to specify API version. Refer to REST API docs for details.)

## Examples

**SDK Code**

```javascript JS
import {
  deleteMetadata,
  UploadcareSimpleAuthSchema,
} from '@uploadcare/rest-client';

const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
  publicKey: 'YOUR_PUBLIC_KEY',
  secretKey: 'YOUR_SECRET_KEY',
});

const result = await deleteMetadata(
  {
    uuid: '1bac376c-aa7e-4356-861b-dd2657b5bfd2',
    key: 'delete_key',
  },
  { authSchema: uploadcareSimpleAuthSchema }
)

```

```php PHP
<?php
$configuration = Uploadcare\Configuration::create((string) $_ENV['UPLOADCARE_PUBLIC_KEY'], (string) $_ENV['UPLOADCARE_SECRET_KEY']);

$metadataApi = (new Uploadcare\Api($configuration))->metadata();
try {
    $metadataApi->removeKey('1bac376c-aa7e-4356-861b-dd2657b5bfd2', 'pet');
} catch (\Throwable $e) {
    echo \sprintf('Error while key removing: %s', $e->getMessage());
}
echo 'Key was successfully removed';

```

```python Python
from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='YOUR_PUBLIC_KEY', secret_key='YOUR_SECRET_KEY')

file_uuid = '1bac376c-aa7e-4356-861b-dd2657b5bfd2'
uploadcare.metadata_api.delete_key(file_uuid, mkey='pet')

```

```ruby Ruby
require 'uploadcare'
Uploadcare.config.public_key = 'YOUR_PUBLIC_KEY'
Uploadcare.config.secret_key = 'YOUR_SECRET_KEY'

puts Uploadcare::FileMetadata.delete('1bac376c-aa7e-4356-861b-dd2657b5bfd2', 'pet')

```

```swift Swift
import Uploadcare

let uploadcare = Uploadcare(withPublicKey: "YOUR_PUBLIC_KEY", secretKey: "YOUR_SECRET_KEY")

try await uploadcare.deleteFileMetadata(forKey: "pet",  withUUID: "1bac376c-aa7e-4356-861b-dd2657b5bfd2")

```

```kotlin Kotlin
import com.uploadcare.android.library.api.UploadcareClient

val uploadcare = UploadcareClient(publicKey = "YOUR_PUBLIC_KEY", secretKey = "YOUR_SECRET_KEY")

uploadcare.deleteFileMetadataKey(fileId = "1bac376c-aa7e-4356-861b-dd2657b5bfd2", key = "pet")

```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.uploadcare.com/files/21975c81-7f57-4c7a-aef9-acfe28779f78/metadata/subsystem/"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("Accept", "application/vnd.uploadcare-v0.7+json")
	req.Header.Add("Authorization", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://api.uploadcare.com/files/21975c81-7f57-4c7a-aef9-acfe28779f78/metadata/subsystem/")
  .header("Accept", "application/vnd.uploadcare-v0.7+json")
  .header("Authorization", "<apiKey>")
  .asString();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.uploadcare.com/files/21975c81-7f57-4c7a-aef9-acfe28779f78/metadata/subsystem/");
var request = new RestRequest(Method.DELETE);
request.AddHeader("Accept", "application/vnd.uploadcare-v0.7+json");
request.AddHeader("Authorization", "<apiKey>");
IRestResponse response = client.Execute(request);
```