Upload File
curl --request POST \
--url https://api.launchmystore.io/api/v1/files.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alt": "<string>",
"folder": "<string>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/files.json"
payload = {
"alt": "<string>",
"folder": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({alt: '<string>', folder: '<string>'})
};
fetch('https://api.launchmystore.io/api/v1/files.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/files.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'alt' => '<string>',
'folder' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/files.json"
payload := strings.NewReader("{\n \"alt\": \"<string>\",\n \"folder\": \"<string>\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.launchmystore.io/api/v1/files.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alt\": \"<string>\",\n \"folder\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/files.json")
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 \"alt\": \"<string>\",\n \"folder\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"state": "success",
"message": null,
"data": {
"file": {
"id": "file_new789",
"filename": "banner-summer-sale.png",
"url": "https://cdn.launchmystore.io/files/banner-summer-sale.png",
"alt": "Summer sale banner",
"content_type": "image/png",
"size": 156234,
"width": 1200,
"height": 400,
"created_at": "2024-01-20T14:30:00Z"
}
}
}
Files
Upload File
Upload a file to the media library
POST
/
api
/
v1
/
files.json
Upload File
curl --request POST \
--url https://api.launchmystore.io/api/v1/files.json \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alt": "<string>",
"folder": "<string>"
}
'import requests
url = "https://api.launchmystore.io/api/v1/files.json"
payload = {
"alt": "<string>",
"folder": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({alt: '<string>', folder: '<string>'})
};
fetch('https://api.launchmystore.io/api/v1/files.json', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.launchmystore.io/api/v1/files.json",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'alt' => '<string>',
'folder' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.launchmystore.io/api/v1/files.json"
payload := strings.NewReader("{\n \"alt\": \"<string>\",\n \"folder\": \"<string>\"\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(string(body))
}HttpResponse<String> response = Unirest.post("https://api.launchmystore.io/api/v1/files.json")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alt\": \"<string>\",\n \"folder\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.launchmystore.io/api/v1/files.json")
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 \"alt\": \"<string>\",\n \"folder\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"status": 201,
"state": "success",
"message": null,
"data": {
"file": {
"id": "file_new789",
"filename": "banner-summer-sale.png",
"url": "https://cdn.launchmystore.io/files/banner-summer-sale.png",
"alt": "Summer sale banner",
"content_type": "image/png",
"size": 156234,
"width": 1200,
"height": 400,
"created_at": "2024-01-20T14:30:00Z"
}
}
}
Not available yet. The app-scoped Files API (
/api/v1/files*) is not
implemented — calls will 404. read_files / write_files are reserved scopes
(requestable for forward-compat) with no endpoints bound yet. The shape below
is the planned contract and may change.Body Parameters
The file to upload (multipart/form-data)
Alt text for the image (for accessibility)
Optional folder path for organization
Supported File Types
| Type | Extensions | Max Size |
|---|---|---|
| Images | jpg, jpeg, png, gif, webp, svg | 20MB |
| Videos | mp4, webm, mov | 100MB |
| Documents | pdf, doc, docx | 10MB |
Response
The planned contract returns the standard response envelope with the uploaded file underdata.file.
{
"status": 201,
"state": "success",
"message": null,
"data": {
"file": {
"id": "file_new789",
"filename": "banner-summer-sale.png",
"url": "https://cdn.launchmystore.io/files/banner-summer-sale.png",
"alt": "Summer sale banner",
"content_type": "image/png",
"size": 156234,
"width": 1200,
"height": 400,
"created_at": "2024-01-20T14:30:00Z"
}
}
}
Example Request
curl -X POST "https://api.launchmystore.io/api/v1/files.json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "file=@/path/to/image.jpg" \
-F "alt=Product image"
⌘I