POST
/
public
/
v1
/
files
curl --request POST \
  --url https://api.silnahealth.com/public/v1/files/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/octet-stream' \
  --header 'provider-id: <provider-id>'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

We support uploads up to 50 MB. If you have files larger than this, please reach out to request a limit increase. The generated code examples are slightly incorrect in how they handle file uploads. Please use the below cURL and python examples.

cURL Example

curl -X POST "https://api.silnahealth.com/public/v1/files/" \
    -H "Authorization: Bearer {TOKEN}" \
    -H "Content-Type: application/octet-stream" \
    -H "provider-id: 0194a907-5bdc-7f94-b890-b9afc5b5d5e3" \
    -H "original-filename: test_two.pdf" \
    --data-binary @test_two.pdf

Python Example

import requests

url = "https://api.silnahealth.com/public/v1/files/"
headers = {
    "Authorization": "Bearer {TOKEN}",
    "Content-Type": "application/octet-stream",
    "provider-id": "0194a907-5bdc-7f94-b890-b9afc5b5d5e3",
    "original-filename": "test_two.pdf"
}

with open("test_two.pdf", "rb") as file:
    response = requests.post(url, headers=headers, data=file)

print(response.status_code)

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

provider-id
string
required
original-filename
string

The name of the file you are uploading

Body

application/octet-stream · file
Binary file content to upload

The body is of type file.

Response

201
application/json
id
string
required