# Media

## Performs the Get operation.

> Use this endpoint to execute the get workflow in MediaController.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Media"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Media/Get/{mediaId}":{"get":{"tags":["Media"],"summary":"Performs the Get operation.","description":"Use this endpoint to execute the get workflow in MediaController.","parameters":[{"name":"mediaId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Uploads a file in chunks and finalizes media creation on the last chunk.

> Appends each chunk to a temporary local file and, after the final chunk, uploads the assembled file to storage and persists a media record.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Media"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Media/UploadChunk":{"post":{"tags":["Media"],"summary":"Uploads a file in chunks and finalizes media creation on the last chunk.","description":"Appends each chunk to a temporary local file and, after the final chunk, uploads the assembled file to storage and persists a media record.","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","allOf":[{"type":"object","properties":{"ContentType":{"type":"string"},"ContentDisposition":{"type":"string"},"Headers":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"Length":{"type":"integer","format":"int64"},"Name":{"type":"string"},"FileName":{"type":"string"}}},{"type":"object","properties":{"fileName":{"type":"string"}}},{"type":"object","properties":{"chunkNumber":{"type":"integer","format":"int32"}}},{"type":"object","properties":{"totalChunks":{"type":"integer","format":"int32"}}}]}}},"required":true},"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Deletes a media file and its storage artifact.

> Validates company-level access before removing the media record and deleting the backing file from storage.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Media"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Media/DeleteFile/{mediaId}":{"delete":{"tags":["Media"],"summary":"Deletes a media file and its storage artifact.","description":"Validates company-level access before removing the media record and deleting the backing file from storage.","parameters":[{"name":"mediaId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```

## Downloads a media file from blob storage.

> Checks company-level access and streams the stored file content with the original MIME type and filename.

```json
{"openapi":"3.0.1","info":{"title":"WebApi | v1","version":"1.0.0"},"tags":[{"name":"Media"}],"servers":[{"url":"https://api.safegpt.nl/"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"JWT bearer token. Example: 'Bearer {token}'.","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/Media/DownloadFile/{mediaId}":{"get":{"tags":["Media"],"summary":"Downloads a media file from blob storage.","description":"Checks company-level access and streams the stored file content with the original MIME type and filename.","parameters":[{"name":"mediaId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"401":{"description":"Authentication is required."},"403":{"description":"The user is not authorized to access this endpoint."}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.safegpt.nl/api-en/endpoints/media.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
