Samva
Samva
DashboardAPISamva DocumentationQuickstart GuideAuthentication

Api referenceMedia

Initialize File Upload

POST
/media/upload

Authorization

apiKey
X-API-Key<token>

API key for authentication

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://samva.app/api/v1/media/upload" \  -H "Content-Type: application/json" \  -d '{    "filename": "string",    "contentType": "string",    "sizeBytes": 1,    "purpose": "attachment"  }'
{
  "mediaId": "5a8ffac5-2288-485d-b463-90c3cd9941ad",
  "uploadUrl": "http://example.com",
  "expiresAt": "2019-08-24T14:15:22Z"
}
filename*string
Length1 <= length <= 255
contentType*string
Length1 <= length <= 127
sizeBytes*integer
Range1 <= value <= 26214400
purpose*unknown
Value in"attachment" | "avatar" | "whatsapp_media"
checksumSha256?string
Length64 <= length <= 64