> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.konfidant.app/llms.txt.
> For full documentation content, see https://docs.konfidant.app/llms-full.txt.

# Obtain a signed URL to share a big file (>= 10mb)

POST https://api/v1/files
Content-Type: application/json

Reference: https://docs.konfidant.app/konfidant-api/obtain-a-signed-url-to-share-a-big-file-10-mb

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/v1/files:
    post:
      operationId: obtain-a-signed-url-to-share-a-big-file-10-mb
      summary: Obtain a signed URL to share a big file (>= 10mb)
      tags:
        - ''
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Accepted
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Obtain a signed URL to share a big file
                  (>= 10mb)_Response_202
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostApiV1Files2RequestBadRequestError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostApiV1Files2RequestUnauthorizedError'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                file_size:
                  type: integer
                ttl_hours:
                  type: integer
              required:
                - filename
                - file_size
                - ttl_hours
servers:
  - url: https:/
  - url: https://foo.bar.com
components:
  schemas:
    ApiV1FilesPostResponsesContentApplicationJsonSchemaMetadataHeaders:
      type: object
      properties:
        x-amz-meta-user-id:
          type: string
        x-amz-meta-ttl-hours:
          type: string
        x-amz-meta-organization-id:
          type: string
      required:
        - x-amz-meta-user-id
        - x-amz-meta-ttl-hours
        - x-amz-meta-organization-id
      title: ApiV1FilesPostResponsesContentApplicationJsonSchemaMetadataHeaders
    Obtain a signed URL to share a big file (>= 10mb)_Response_202:
      type: object
      properties:
        file_key:
          type: string
        poll_url:
          type: string
        upload_url:
          type: string
          format: uri
        metadata_headers:
          $ref: >-
            #/components/schemas/ApiV1FilesPostResponsesContentApplicationJsonSchemaMetadataHeaders
      required:
        - file_key
        - poll_url
        - upload_url
        - metadata_headers
      title: Obtain a signed URL to share a big file (>= 10mb)_Response_202
    PostApiV1Files2RequestBadRequestError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      title: PostApiV1Files2RequestBadRequestError
    PostApiV1Files2RequestUnauthorizedError:
      type: object
      properties:
        error:
          type: string
      required:
        - error
      title: PostApiV1Files2RequestUnauthorizedError
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python Obtain a signed URL to share a big file (>= 10mb)_example
import requests

url = "https://https/api/v1/files"

payload = {
    "filename": "large.zip",
    "file_size": 10485760,
    "ttl_hours": 48
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Obtain a signed URL to share a big file (>= 10mb)_example
const url = 'https://https/api/v1/files';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"filename":"large.zip","file_size":10485760,"ttl_hours":48}'
};

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

```go Obtain a signed URL to share a big file (>= 10mb)_example
package main

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

func main() {

	url := "https://https/api/v1/files"

	payload := strings.NewReader("{\n  \"filename\": \"large.zip\",\n  \"file_size\": 10485760,\n  \"ttl_hours\": 48\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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 Obtain a signed URL to share a big file (>= 10mb)_example
require 'uri'
require 'net/http'

url = URI("https://https/api/v1/files")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"filename\": \"large.zip\",\n  \"file_size\": 10485760,\n  \"ttl_hours\": 48\n}"

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

```java Obtain a signed URL to share a big file (>= 10mb)_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/api/v1/files")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"filename\": \"large.zip\",\n  \"file_size\": 10485760,\n  \"ttl_hours\": 48\n}")
  .asString();
```

```php Obtain a signed URL to share a big file (>= 10mb)_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/api/v1/files', [
  'body' => '{
  "filename": "large.zip",
  "file_size": 10485760,
  "ttl_hours": 48
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Obtain a signed URL to share a big file (>= 10mb)_example
using RestSharp;

var client = new RestClient("https://https/api/v1/files");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"filename\": \"large.zip\",\n  \"file_size\": 10485760,\n  \"ttl_hours\": 48\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Obtain a signed URL to share a big file (>= 10mb)_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "filename": "large.zip",
  "file_size": 10485760,
  "ttl_hours": 48
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/api/v1/files")! 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()
```