> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://api.labelstud.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://api.labelstud.io/_mcp/server.

# Validate import storage

POST http://localhost:8000/api/storages/s3/validate
Content-Type: application/json

Validate a specific S3 import storage connection.

Reference: https://api.labelstud.io/api-reference/api-reference/import-storage/s-3/validate

## Authentication

- `Authorization` header (required) (prefixed with ` Token   `) — The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: curl [https://label-studio-host/api/projects](https://label-studio-host/api/projects) -H "Authorization: Token \[your-token]"

## Request

### Body (application/json)

This endpoint expects a S3ImportStorageValidateRequest.

- `project` (integer, required) — A unique integer value identifying this project.
- `aws_access_key_id` (string, optional, nullable) — AWS_ACCESS_KEY_ID
- `aws_secret_access_key` (string, optional, nullable) — AWS_SECRET_ACCESS_KEY
- `aws_session_token` (string, optional, nullable) — AWS_SESSION_TOKEN
- `aws_sse_kms_key_id` (string, optional, nullable) — AWS SSE KMS Key ID
- `bucket` (string, optional, nullable) — S3 bucket name
- `description` (string, optional, nullable) — Cloud storage description
- `id` (integer, optional) — Storage ID. If set, storage with specified ID will be updated
- `prefix` (string, optional, nullable) — S3 bucket prefix
- `presign` (boolean, optional, default: true)
- `presign_ttl` (integer, optional) — Presigned URLs TTL (in minutes)
- `recursive_scan` (boolean, optional) — Perform recursive scan over the bucket content
- `regex_filter` (string, optional, nullable) — Cloud storage regex for filtering objects
- `region_name` (string, optional, nullable) — AWS Region
- `s3_endpoint` (string, optional, nullable) — S3 Endpoint
- `synchronizable` (boolean, optional, default: true)
- `title` (string, optional, nullable) — Cloud storage title
- `use_blob_urls` (boolean, optional) — Interpret objects as BLOBs and generate URLs

## Response

### 200

Validation successful

## Examples

**Request**

```json
{
  "project": 1
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "http://localhost:8000/api/storages/s3/validate"

payload = { "project": 1 }
headers = {
    "Authorization": "Token  <api_key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'http://localhost:8000/api/storages/s3/validate';
const options = {
  method: 'POST',
  headers: {Authorization: 'Token  <api_key>', 'Content-Type': 'application/json'},
  body: '{"project":1}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

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

func main() {

	url := "http://localhost:8000/api/storages/s3/validate"

	payload := strings.NewReader("{\n  \"project\": 1\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Token  <api_key>")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://localhost:8000/api/storages/s3/validate")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Token  <api_key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"project\": 1\n}"

response = http.request(request)
puts response.read_body
```

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

HttpResponse<String> response = Unirest.post("http://localhost:8000/api/storages/s3/validate")
  .header("Authorization", "Token  <api_key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"project\": 1\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://localhost:8000/api/storages/s3/validate', [
  'body' => '{
  "project": 1
}',
  'headers' => [
    'Authorization' => 'Token  <api_key>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://localhost:8000/api/storages/s3/validate");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Token  <api_key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"project\": 1\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Token  <api_key>",
  "Content-Type": "application/json"
]
let parameters = ["project": 1] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:8000/api/storages/s3/validate")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```