Docs menu

Upload a file to send

POST/v1/profiles/{profile_id}/uploads

  • Scope messages:send

For files that aren't at a public URL: this answers an upload_url; PUT the bytes there within 15 minutes, then send with attachments: [{ upload_id }]. Uploads can be sent for 7 days.

Parameters

Path

  • profile_idstringrequired

    The line (prf_…).

Request body

  • file_namestringrequired

    The file's name.

  • mime_typestring

    Its type, such as image/jpeg.

  • size_bytesintegerrequired

    Its exact size in bytes.

Response

201 CreatedWhere to upload.

  • idstringrequired

    upl_…

  • object"upload"required

  • profile_idstringrequired

    prf_…

  • file_namestringrequired

  • size_bytesintegerrequired

  • method"PUT"required

  • upload_urlstringrequired

    PUT the file's bytes here, exactly size_bytes long, within 15 minutes.

  • upload_expires_attimestamprequired

  • expires_attimestamprequired

    Until when sends may name this upload (7 days).

Errors

StatusCodeMeans
503storage_disabledFile storage is off on this server.
400validation_failedA field is missing or invalid.
401unauthorizedThe API key is missing, unknown or revoked.
403insufficient_scopeThe API key lacks the scope this needs.
404not_foundNo such object, or the key can't see it.

Every error is { "error": { "code", "message" } }. All error codes.

Keys come with your first line.

Request an invite and we'll set up a line for your team. API access is part of every plan.

Request an invite