Initialize file upload
import requests
url = "https://api.memic.ai/api/v1/files/init"
payload = {
"filename": "<string>",
"size": 123,
"mime_type": "<string>",
"metadata": {},
"reference_id": "<string>",
"environment_slug": "production",
"folder_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.memic.ai/api/v1/files/init \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"filename": "<string>",
"size": 123,
"mime_type": "<string>",
"metadata": {},
"reference_id": "<string>",
"environment_slug": "production",
"folder_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: '<string>',
size: 123,
mime_type: '<string>',
metadata: {},
reference_id: '<string>',
environment_slug: 'production',
folder_id: '<string>'
})
};
fetch('https://api.memic.ai/api/v1/files/init', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"file_id": "<string>",
"upload_url": "<string>",
"expires_in": 3600
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Endpoints
Initialize file upload
Start a file upload by requesting a presigned URL. PUT the file contents directly to the returned URL, then call POST /files/{file_id}/confirm to trigger processing.
POST
/
api
/
v1
/
files
/
init
Initialize file upload
import requests
url = "https://api.memic.ai/api/v1/files/init"
payload = {
"filename": "<string>",
"size": 123,
"mime_type": "<string>",
"metadata": {},
"reference_id": "<string>",
"environment_slug": "production",
"folder_id": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)curl --request POST \
--url https://api.memic.ai/api/v1/files/init \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"filename": "<string>",
"size": 123,
"mime_type": "<string>",
"metadata": {},
"reference_id": "<string>",
"environment_slug": "production",
"folder_id": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filename: '<string>',
size: 123,
mime_type: '<string>',
metadata: {},
reference_id: '<string>',
environment_slug: 'production',
folder_id: '<string>'
})
};
fetch('https://api.memic.ai/api/v1/files/init', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"file_id": "<string>",
"upload_url": "<string>",
"expires_in": 3600
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Memic API key. Every key is bound to exactly one environment — get one from the Memic dashboard under API Keys.
Body
application/json
Request DTO for initializing file upload (presigned URL approach).
Original filename
Required string length:
1 - 500File size in bytes
MIME type of the file
Optional metadata
Client-provided reference ID for linking with external systems (e.g., 'TG_G1_Math'). Stored in both database and Pinecone for lookup-based search filtering.
Maximum string length:
255Target environment slug ('staging' or 'production'). Defaults to 'production'.
Target folder ID within the environment. If not provided, uses the default folder.