- delete - Delete a stream
- enable - Enable a stream
- disable - Disable a stream
- complete - Complete a stream
Permanently deletes a specified live stream from the workspace. If the stream is active, the encoder is disconnected and ingestion stops immediately. This action is irreversible, and any future playback attempts fail as a result.
Provide the streamId in the request to terminate active connections and remove the stream from the workspace. You can further look for video.live_stream.deleted webhook to notify your system about the status.
For an online concert platform, a trial stream was mistakenly made public. The event manager deletes the stream before the concert begins to avoid confusion among viewers.
Related guide: Manage streams
Note: In the examples below,
package hello.world;is used for demonstration purposes. When creating your own Java files, ensure the package name matches your directory structure (e.g., if your file is atsrc/main/java/com/example/MyApp.java, usepackage com.example;).
// Package declaration - adjust to match your project's directory structure
package hello.world;
// Import required classes from the FastPix SDK
import java.lang.Exception;
import com.fasterxml.jackson.databind.SerializationFeature;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.DeleteLiveStreamResponse;
import io.fastpix.sdk.utils.JSON;
public class Application {
public static void main(String[] args) throws Exception {
FastPixSDK sdk = FastPixSDK.builder()
.security(Security.builder()
.username("your-access-token")
.password("your-secret-key")
.build())
.build();
DeleteLiveStreamResponse res = sdk.liveStream().delete()
.streamId("your-stream-id")
.call();
if (res.liveStreamDeleteResponse().isPresent()) {
var mapper = JSON.getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
System.out.println(mapper.writeValueAsString(res.liveStreamDeleteResponse().get()));
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
streamId |
String | ✔️ | Upon creating a new live stream, FastPix assigns a unique identifier to the stream. | your-stream-id |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
This endpoint allows you to enable a livestream by transitioning its status from disabled to idle. After it is enabled, the stream becomes available and ready to accept an incoming broadcast from a streaming tool.
Streams on the trial plan cannot be re-enabled if they are in the disabled state.
The livestreamId must be provided in the path, and the stream must not already be in an enabled state (idle, preparing, or active).
A creator disables a livestream to pause it temporarily. Later, they decide to continue the session. By calling this endpoint with the stream's ID, they can re-enable and restart the same livestream.
Related guide Manage streams
// Package declaration - adjust to match your project's directory structure
package hello.world;
// Import required classes from the FastPix SDK
import java.lang.Exception;
import com.fasterxml.jackson.databind.SerializationFeature;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.EnableLiveStreamResponse;
import io.fastpix.sdk.utils.JSON;
public class Application {
public static void main(String[] args) throws Exception {
FastPixSDK sdk = FastPixSDK.builder()
.security(Security.builder()
.username("your-access-token")
.password("your-secret-key")
.build())
.build();
EnableLiveStreamResponse res = sdk.liveStream().enable()
.streamId("your-stream-id")
.call();
if (res.liveStreamDeleteResponse().isPresent()) {
var mapper = JSON.getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
System.out.println(mapper.writeValueAsString(res.liveStreamDeleteResponse().get()));
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
streamId |
String | ✔️ | Upon creating a new live stream, FastPix assigns a unique identifier to the stream. | your-stream-id |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
This endpoint disables a livestream by setting its status to disabled. Use this to stop a livestream when it's no longer needed or must be taken offline intentionally.
A disabled stream can later be re-enabled using the enable endpoint — however, if you're on a trial plan, re-enabling is not allowed once the stream is disabled.
A speaker finishes their live session and wants to prevent the stream from being mistakenly started again. By calling this endpoint, the stream is transitioned to a disabled state, ensuring it's permanently stopped (unless re-enabled on a paid plan).
Related guide Manage streams
// Package declaration - adjust to match your project's directory structure
package hello.world;
// Import required classes from the FastPix SDK
import java.lang.Exception;
import com.fasterxml.jackson.databind.SerializationFeature;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.DisableLiveStreamResponse;
import io.fastpix.sdk.utils.JSON;
public class Application {
public static void main(String[] args) throws Exception {
FastPixSDK sdk = FastPixSDK.builder()
.security(Security.builder()
.username("your-access-token")
.password("your-secret-key")
.build())
.build();
DisableLiveStreamResponse res = sdk.liveStream().disable()
.streamId("your-stream-id")
.call();
if (res.liveStreamDeleteResponse().isPresent()) {
var mapper = JSON.getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
System.out.println(mapper.writeValueAsString(res.liveStreamDeleteResponse().get()));
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
streamId |
String | ✔️ | After creating a new live stream, FastPix assigns a unique identifier to the stream. | your-stream-id |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |
This endpoint marks a livestream as completed by stopping the active stream and transitioning its status to idle. It is typically used after a livestream session has ended.
This operation only works when the stream is in the active state.
Completing a stream can help finalize the session and trigger post-processing events like VOD generation.
A virtual event ends, and the system or host needs to close the livestream to prevent further streaming. This endpoint ensures the livestream status is changed from active to idle, indicating it's officially completed.
Related guide Manage streams
// Package declaration - adjust to match your project's directory structure
package hello.world;
// Import required classes from the FastPix SDK
import java.lang.Exception;
import com.fasterxml.jackson.databind.SerializationFeature;
import io.fastpix.sdk.FastPixSDK;
import io.fastpix.sdk.models.components.Security;
import io.fastpix.sdk.models.operations.CompleteLiveStreamResponse;
import io.fastpix.sdk.utils.JSON;
public class Application {
public static void main(String[] args) throws Exception {
FastPixSDK sdk = FastPixSDK.builder()
.security(Security.builder()
.username("your-access-token")
.password("your-secret-key")
.build())
.build();
CompleteLiveStreamResponse res = sdk.liveStream().complete()
.streamId("your-stream-id")
.call();
if (res.liveStreamDeleteResponse().isPresent()) {
var mapper = JSON.getMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
System.out.println(mapper.writeValueAsString(res.liveStreamDeleteResponse().get()));
}
}
}| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
streamId |
String | ✔️ | Upon creating a new live stream, FastPix assigns a unique identifier to the stream. | your-stream-id |
| Error Type | Status Code | Content Type |
|---|---|---|
| models/errors/APIException | 4XX, 5XX | */* |