Stop Video Stream Moderation
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/stream/stop \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/stream/stop"
payload = { "task_id": "550e8400-e29b-41d4-a716-446655440000" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({task_id: '550e8400-e29b-41d4-a716-446655440000'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/stream/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mavi-backend.memories.ai/serve/api/v2/stream/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'task_id' => '550e8400-e29b-41d4-a716-446655440000'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/stream/stop"
payload := strings.NewReader("{\n \"task_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/stream/stop")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"task_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/stream/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"message": "Stream stopped successfully"
}
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"status": 14,
"message": "Stream stopped by user",
"data": null,
"token": null
},
"task_id": "f9c9b4caf3184ac4bcc46727d802e3d4"
}
Live Video Content Moderation
Stop Video Stream Moderation
Stop an active video stream processing task.
POST
/
stream
/
stop
Stop Video Stream Moderation
curl --request POST \
--url https://mavi-backend.memories.ai/serve/api/v2/stream/stop \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}
'import requests
url = "https://mavi-backend.memories.ai/serve/api/v2/stream/stop"
payload = { "task_id": "550e8400-e29b-41d4-a716-446655440000" }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({task_id: '550e8400-e29b-41d4-a716-446655440000'})
};
fetch('https://mavi-backend.memories.ai/serve/api/v2/stream/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://mavi-backend.memories.ai/serve/api/v2/stream/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'task_id' => '550e8400-e29b-41d4-a716-446655440000'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://mavi-backend.memories.ai/serve/api/v2/stream/stop"
payload := strings.NewReader("{\n \"task_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://mavi-backend.memories.ai/serve/api/v2/stream/stop")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"task_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mavi-backend.memories.ai/serve/api/v2/stream/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"task_id\": \"550e8400-e29b-41d4-a716-446655440000\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"message": "success",
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"message": "Stream stopped successfully"
}
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"status": 14,
"message": "Stream stopped by user",
"data": null,
"token": null
},
"task_id": "f9c9b4caf3184ac4bcc46727d802e3d4"
}
Product: Visual Intelligence — Live Video Content Moderation
Use case: Real-time NSFW / violence / logo detection on a live video stream (RTMP/RTSP), results pushed to your callback every 5s
Mode: Server-Pull (you give us a stream URL → we pull → results to your callback)
Host:
https://mavi-backend.memories.ai/serve/api/v2
Auth: Authorization: sk-mavi-... (no Bearer prefix)Access Required: To use this API endpoint, please contact us at contact@memories.ai to enable stream processing features for your account.
Code Example
import requests
BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-mavi-..."
HEADERS = {
"Authorization": f"{API_KEY}",
"Content-Type": "application/json"
}
def stop_video_stream(task_id: str):
url = f"{BASE_URL}/stream/stop"
data = {"task_id": task_id}
resp = requests.post(url, json=data, headers=HEADERS)
return resp.json()
# Usage example
result = stop_video_stream("550e8400-e29b-41d4-a716-446655440000")
print(result)
const axios = require('axios');
const BASE_URL = 'https://mavi-backend.memories.ai/serve/api/v2';
const API_KEY = 'sk-mavi-...';
const headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
};
async function stopVideoStream(taskId) {
const response = await axios.post(
`${BASE_URL}/stream/stop`,
{ task_id: taskId },
{ headers }
);
return response.data;
}
// Usage example
stopVideoStream('550e8400-e29b-41d4-a716-446655440000')
.then(result => console.log(result));
curl -X POST "https://mavi-backend.memories.ai/serve/api/v2/stream/stop" \
-H "Authorization: sk-mavi-..." \
-H "Content-Type: application/json" \
-d '{
"task_id": "550e8400-e29b-41d4-a716-446655440000"
}'
Response
Returns the confirmation of the stopped stream.{
"code": 200,
"message": "success",
"data": {
"task_id": "550e8400-e29b-41d4-a716-446655440000",
"message": "Stream stopped successfully"
}
}
{
"code": 200,
"message": "SUCCESS",
"data": {
"status": 14,
"message": "Stream stopped by user",
"data": null,
"token": null
},
"task_id": "f9c9b4caf3184ac4bcc46727d802e3d4"
}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| task_id | string | Yes | The task ID returned when starting the stream |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | string | Response code (200 indicates success) |
| message | string | Response message describing the operation result |
| data | object | Response data object |
| data.task_id | string | The task ID of the stopped stream |
| data.message | string | Confirmation message |
Callback Response Parameters
A final callback is sent to your webhook URL after the stream is stopped.| Parameter | Type | Description |
|---|---|---|
| code | string | Response code (200) |
| message | string | Response message (“SUCCESS”) |
| task_id | string | The task ID of the stopped stream |
| data | object | Wrapper object |
| data.status | integer | Status code (14 indicates user stopped) |
| data.message | string | ”Stream stopped by user” |
| data.data | null | No data for stop callbacks |
| data.token | null | No token info for stop callbacks |
Important Notes
- Immediate stop: The stream stops immediately after this call
- Final callback: A callback with status 14 is sent after stopping
- Resource cleanup: All resources are automatically released
- No further charges: No charges occur after the stream is stopped
- Safe to call: Safe to call even if the stream has already ended
Error Responses
| HTTP Code | Description |
|---|---|
| 400 | Invalid task_id or task not found |
| 401 | Unauthorized - invalid API key |
| 500 | Internal server error |
Authorizations
Body
application/json
The task ID returned when starting the stream
Example:
"550e8400-e29b-41d4-a716-446655440000"
