Media
Complete a media upload
Verifies the uploaded object exists in storage, marks the media object ready, and returns it with a download URL.
POST
Verifies the uploaded object exists in storage, marks the media object ready, and returns it with a download URL. Requires the permission that creating the media object did.
apiKeyheader
x-api-key<token>id*stringMatch
^media_[0-9a-hjkmnp-tv-z]{16,24}$CompletedMedia
application/json- response
media*downloadUrl*stringimport { createClient } from "samva";const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });const result = await samva.media.complete({ "id": "example"});Example Response
{ "media": { "id": "string", "organizationId": "string", "status": "pending", "filename": "string", "contentType": "string", "sizeBytes": 0, "width": 1, "height": 1, "durationMs": 0, "purpose": "attachment", "checksumSha256": "string", "expiresAt": "string", "createdAt": "string", "confirmedAt": "string" }, "downloadUrl": "string"}Related documentation
Delete an attachment
Deletes an attachment and returns the deleted attachment's ID. Use this endpoint to delete an attachment through the Samva email API.
Create a media object
Creates the media object in the pending state and returns it with the upload instruction; URL, method, and headers; for putting its bytes into storage.