> For the complete documentation index, see [llms.txt](https://developer.ecall-messaging.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.ecall-messaging.com/api-references/rest-api/media.md). Agents can also search and read this documentation through its [MCP server](https://developer.ecall-messaging.com/~gitbook/mcp).

# Media

## POST /api/media

>

```json
{"openapi":"3.0.1","info":{"title":"RestApi","version":"v2"},"tags":[{"name":"Media"}],"security":[{"Basic":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"Basic"}},"schemas":{"MediaUploadResult":{"type":"object","properties":{"mediaId":{"type":"string","nullable":true}},"additionalProperties":false},"Error":{"type":"object","properties":{"errorCode":{"$ref":"#/components/schemas/ErrorCode"},"errorMessage":{"type":"string","nullable":true},"errorDetails":{"oneOf":[{"$ref":"#/components/schemas/ParameterErrorDetails"}],"nullable":true}},"additionalProperties":false},"ErrorCode":{"enum":["Error1","Error2","RequestMissing","CannotConvertMediaBody","UnknownContentType","InvalidSenderAccount","InvalidContent","InsufficientPoints","PointSubstractionError","TooManyMessagesSameReceiver","TooManyMessagesSameReceiverAndContent","AdrCountryNotWhitelisted","AdrCountryWhitelistLimitExceeded","AdrCountryWhitelistLimitReachedButNotBlockedCountries"],"type":"string"},"ParameterErrorDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}],"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ParameterErrorDetailsEntry"},"nullable":true}},"additionalProperties":false},"ErrorDetails":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ErrorDetailsType"}},"additionalProperties":false},"ErrorDetailsType":{"enum":["Parameter"],"type":"string"},"ParameterErrorDetailsEntry":{"type":"object","properties":{"parameter":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}},"paths":{"/api/media":{"post":{"tags":["Media"],"parameters":[{"name":"X-API-Version","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadResult"}},"text/json":{"schema":{"$ref":"#/components/schemas/MediaUploadResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}}}}}}
```

## POST /api/v2/media

>

```json
{"openapi":"3.0.1","info":{"title":"RestApi","version":"v2"},"tags":[{"name":"Media"}],"security":[{"Basic":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"Basic"}},"schemas":{"MediaUploadResult":{"type":"object","properties":{"mediaId":{"type":"string","nullable":true}},"additionalProperties":false},"Error":{"type":"object","properties":{"errorCode":{"$ref":"#/components/schemas/ErrorCode"},"errorMessage":{"type":"string","nullable":true},"errorDetails":{"oneOf":[{"$ref":"#/components/schemas/ParameterErrorDetails"}],"nullable":true}},"additionalProperties":false},"ErrorCode":{"enum":["Error1","Error2","RequestMissing","CannotConvertMediaBody","UnknownContentType","InvalidSenderAccount","InvalidContent","InsufficientPoints","PointSubstractionError","TooManyMessagesSameReceiver","TooManyMessagesSameReceiverAndContent","AdrCountryNotWhitelisted","AdrCountryWhitelistLimitExceeded","AdrCountryWhitelistLimitReachedButNotBlockedCountries"],"type":"string"},"ParameterErrorDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}],"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ParameterErrorDetailsEntry"},"nullable":true}},"additionalProperties":false},"ErrorDetails":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ErrorDetailsType"}},"additionalProperties":false},"ErrorDetailsType":{"enum":["Parameter"],"type":"string"},"ParameterErrorDetailsEntry":{"type":"object","properties":{"parameter":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}},"paths":{"/api/v2/media":{"post":{"tags":["Media"],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}},"encoding":{"file":{"style":"form"}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaUploadResult"}},"text/json":{"schema":{"$ref":"#/components/schemas/MediaUploadResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized"},"500":{"description":"Internal Server Error"}}}}}}
```

## GET /api/media/{mediaId}

>

```json
{"openapi":"3.0.1","info":{"title":"RestApi","version":"v2"},"tags":[{"name":"Media"}],"security":[{"Basic":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"Basic"}},"schemas":{"Error":{"type":"object","properties":{"errorCode":{"$ref":"#/components/schemas/ErrorCode"},"errorMessage":{"type":"string","nullable":true},"errorDetails":{"oneOf":[{"$ref":"#/components/schemas/ParameterErrorDetails"}],"nullable":true}},"additionalProperties":false},"ErrorCode":{"enum":["Error1","Error2","RequestMissing","CannotConvertMediaBody","UnknownContentType","InvalidSenderAccount","InvalidContent","InsufficientPoints","PointSubstractionError","TooManyMessagesSameReceiver","TooManyMessagesSameReceiverAndContent","AdrCountryNotWhitelisted","AdrCountryWhitelistLimitExceeded","AdrCountryWhitelistLimitReachedButNotBlockedCountries"],"type":"string"},"ParameterErrorDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}],"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ParameterErrorDetailsEntry"},"nullable":true}},"additionalProperties":false},"ErrorDetails":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ErrorDetailsType"}},"additionalProperties":false},"ErrorDetailsType":{"enum":["Parameter"],"type":"string"},"ParameterErrorDetailsEntry":{"type":"object","properties":{"parameter":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}},"paths":{"/api/media/{mediaId}":{"get":{"tags":["Media"],"operationId":"GetByMediaId","parameters":[{"name":"mediaId","in":"path","required":true,"schema":{"type":"string"}},{"name":"X-API-Version","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string","format":"binary"}},"text/json":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error"}}}}}}
```

## GET /api/v2/media/{mediaId}

>

```json
{"openapi":"3.0.1","info":{"title":"RestApi","version":"v2"},"tags":[{"name":"Media"}],"security":[{"Basic":[]}],"components":{"securitySchemes":{"Basic":{"type":"http","scheme":"Basic"}},"schemas":{"Error":{"type":"object","properties":{"errorCode":{"$ref":"#/components/schemas/ErrorCode"},"errorMessage":{"type":"string","nullable":true},"errorDetails":{"oneOf":[{"$ref":"#/components/schemas/ParameterErrorDetails"}],"nullable":true}},"additionalProperties":false},"ErrorCode":{"enum":["Error1","Error2","RequestMissing","CannotConvertMediaBody","UnknownContentType","InvalidSenderAccount","InvalidContent","InsufficientPoints","PointSubstractionError","TooManyMessagesSameReceiver","TooManyMessagesSameReceiverAndContent","AdrCountryNotWhitelisted","AdrCountryWhitelistLimitExceeded","AdrCountryWhitelistLimitReachedButNotBlockedCountries"],"type":"string"},"ParameterErrorDetails":{"type":"object","allOf":[{"$ref":"#/components/schemas/ErrorDetails"}],"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ParameterErrorDetailsEntry"},"nullable":true}},"additionalProperties":false},"ErrorDetails":{"type":"object","properties":{"type":{"$ref":"#/components/schemas/ErrorDetailsType"}},"additionalProperties":false},"ErrorDetailsType":{"enum":["Parameter"],"type":"string"},"ParameterErrorDetailsEntry":{"type":"object","properties":{"parameter":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"string"},"nullable":true}},"additionalProperties":false}}},"paths":{"/api/v2/media/{mediaId}":{"get":{"tags":["Media"],"operationId":"GetByMediaIdVersioned","parameters":[{"name":"mediaId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"string","format":"binary"}},"text/json":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized"},"404":{"description":"Not Found"},"500":{"description":"Internal Server Error"}}}}}}
```
