Example Try it
Code language cURL Node.js Python C# Java PHP
Request
curl -X POST "https://api.parasend.com/v1/files" \
-H "Authorization: Bearer $PARASEND_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-F "file=@test-notice.pdf" import { readFile } from 'node:fs/promises' ;
const form = new FormData();
form.append('file' , new Blob([await readFile('test-notice.pdf' )], { type: 'application/pdf' }), 'test-notice.pdf' );
const res = await fetch('https://api.parasend.com/v1/files' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${process.env.PARASEND_KEY}` ,
'Idempotency-Key' : crypto.randomUUID(),
},
body: form,
});
const data = await res.json();import os, requests, uuid
res = requests.post(
"https://api.parasend.com/v1/files" ,
headers={
"Authorization" : f"Bearer {os.environ['PARASEND_KEY']}" ,
"Idempotency-Key" : str(uuid.uuid4()),
},
files={"file" : open("test-notice.pdf" , "rb" )},
)
data = res.json()using var http = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.parasend.com/v1/files" );
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer" , Environment.GetEnvironmentVariable("PARASEND_KEY" ));
request.Headers.Add("Idempotency-Key" , Guid.NewGuid().ToString());
request.Content = new MultipartFormDataContent { { new ByteArrayContent(File.ReadAllBytes("test-notice.pdf" )), "file" , "test-notice.pdf" } };
var response = await http.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();var boundary = "parasend-" + UUID.randomUUID();
var file = Files.readAllBytes(Path.of("test-notice.pdf" ));
var head = ("--" + boundary + "\r\nContent-Disposition: form-data; name=\"file\"; filename=\"test-notice.pdf\"\r\nContent-Type: application/pdf\r\n\r\n" ).getBytes();
var tail = ("\r\n--" + boundary + "--\r\n" ).getBytes();
var request = HttpRequest.newBuilder(URI.create("https://api.parasend.com/v1/files" ))
.header("Authorization" , "Bearer " + System.getenv("PARASEND_KEY" ))
.header("Idempotency-Key" , UUID.randomUUID().toString())
.header("Content-Type" , "multipart/form-data; boundary=" + boundary)
.method("POST" , HttpRequest.BodyPublishers.ofByteArrays(List.of(head, file, tail)))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());$client = new GuzzleHttp\Client();
$response = $client->request('POST' , 'https://api.parasend.com/v1/files' , [
'headers' => [
'Authorization' => 'Bearer ' . getenv('PARASEND_KEY' ),
'Idempotency-Key' => bin2hex(random_bytes(16 )),
],
'multipart' => [
['name' => 'file' , 'contents' => fopen('test-notice.pdf' , 'r' )],
],
]);
$data = json_decode($response->getBody(), true );
Response · 201
{
"id" : "fil_01M6R27SZK99V6N6WG4GK15T6R" ,
"object" : "file" ,
"name" : "test-notice.pdf" ,
"bytes" : 691 ,
"sha256" : "1b0cff41d97c8dcf92b7de986d66d12fb94e68f6db19821aa4b263dcfb0b6225" ,
"created" : "2026-11-06T09:15:05.587Z"
}