# List the file types an upload may have

> Every type the service accepts at the door, so a client does not hardcode them.

Source: https://tools.vukem.dev/docs/api/uploads.types/

## Authentication

No key is needed. This route is public.

## Responses

### 200 OK

Content type `application/json`. Schema: [`TypeList`](/docs/api/schemas#typelist).

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | array of `string` | - | Every MIME type an upload may have |

### Any other status

Content type `application/problem+json`. Error (RFC 9457 problem details). Schema: [`Problem`](/docs/api/schemas#problem).

The error follows RFC 9457. See [Errors](/docs/api/overview#errors).

```bash
curl -X GET "http://localhost:3000/api/v1/upload-types"
```

```python
import requests

response = requests.get(
    "http://localhost:3000/api/v1/upload-types",
    timeout=30,
)
response.raise_for_status()
print(response.json())
```

```javascript
const response = await fetch("http://localhost:3000/api/v1/upload-types", {
  method: "GET",
});
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`);
console.log(await response.json());
```

```go
package main

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

func main() {
	req, err := http.NewRequest("GET", "http://localhost:3000/api/v1/upload-types", nil)
	if err != nil {
		panic(err)
	}

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, err := io.ReadAll(res.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(res.Status, string(out))
}
```

```php
<?php

$ch = curl_init("http://localhost:3000/api/v1/upload-types");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_RETURNTRANSFER => true,
]);

$response = curl_exec($ch);
if ($response === false) {
    throw new RuntimeException(curl_error($ch));
}
echo curl_getinfo($ch, CURLINFO_HTTP_CODE), " ", $response, PHP_EOL;
```

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("http://localhost:3000/api/v1/upload-types"))
            .GET()
            .build();

        HttpResponse<String> response = HttpClient.newHttpClient()
            .send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode() + " " + response.body());
    }
}
```

```csharp
using System;
using System.Net.Http;

using var client = new HttpClient();
using var request = new HttpRequestMessage(
    HttpMethod.Get, "http://localhost:3000/api/v1/upload-types");

using var response = await client.SendAsync(request);
Console.WriteLine($"{(int)response.StatusCode} {await response.Content.ReadAsStringAsync()}");
```

```ruby
require "net/http"
require "uri"

uri = URI("http://localhost:3000/api/v1/upload-types")
request = Net::HTTP::Get.new(uri)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
puts "#{response.code} #{response.body}"
```

**Response examples**

```json
{
  "data": [
    "application/gzip",
    "application/msword",
    "application/pdf",
    "application/vnd.ms-excel",
    "application/vnd.ms-powerpoint",
    "application/vnd.oasis.opendocument.presentation",
    "application/vnd.oasis.opendocument.spreadsheet",
    "application/vnd.oasis.opendocument.text",
    "application/vnd.openxmlformats-officedocument.presentationml.presentation",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
    "application/x-pkcs12",
    "application/x-tar",
    "application/zip",
    "audio/aac",
    "audio/flac",
    "audio/mpeg",
    "audio/ogg",
    "audio/wav",
    "image/avif",
    "image/bmp",
    "image/gif",
    "image/jpeg",
    "image/jxl",
    "image/png",
    "image/svg+xml",
    "image/tiff",
    "image/webp",
    "image/x-icon",
    "video/mp4",
    "video/quicktime",
    "video/webm",
    "video/x-matroska",
    "video/x-msvideo"
  ]
}
```

The examples are built from the schemas, so every value is a placeholder of its type. The tables above hold the fields that carry the real values.
