Skip to main content
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"
}
'
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000",
    "message": "Stream stopped successfully"
  }
}
Access Required: To use this API endpoint, please contact us at contact@memories.ai to enable stream processing features for your account.
This endpoint stops an active video stream processing task. Once stopped, no further callbacks will be sent, and resources will be released.

Code Example

import requests

BASE_URL = "https://mavi-backend.memories.ai/serve/api/v2"
API_KEY = "sk-mai-this_a_test_string_please_use_your_generated_key_during_testing"
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)

Response

Returns the confirmation of the stopped stream.
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "550e8400-e29b-41d4-a716-446655440000",
    "message": "Stream stopped successfully"
  }
}

Request Parameters

ParameterTypeRequiredDescription
task_idstringYesThe task ID returned when starting the stream

Response Parameters

ParameterTypeDescription
codestringResponse code (200 indicates success)
messagestringResponse message describing the operation result
dataobjectResponse data object
data.task_idstringThe task ID of the stopped stream
data.messagestringConfirmation message

Callback Response Parameters

A final callback is sent to your webhook URL after the stream is stopped.
ParameterTypeDescription
codestringResponse code (200)
messagestringResponse message (“SUCCESS”)
task_idstringThe task ID of the stopped stream
dataobjectWrapper object
data.statusintegerStatus code (14 indicates user stopped)
data.messagestring”Stream stopped by user”
data.datanullNo data for stop callbacks
data.tokennullNo 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 CodeDescription
400Invalid task_id or task not found
401Unauthorized - invalid API key
500Internal server error

Authorizations

Authorization
string
header
required

Body

application/json
task_id
string
required

The task ID returned when starting the stream

Example:

"550e8400-e29b-41d4-a716-446655440000"

Response

200 - application/json

Stream stopped successfully

code
string
Example:

200

message
string
Example:

"success"

data
object