curl -X DELETE "https://api.tktchurch.com/v1/livestreams/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
const deleteLivestream = async (accessToken, id) => {
const response = await fetch(
`https://api.tktchurch.com/v1/livestreams/${id}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${accessToken}`
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.reason || 'Failed to delete livestream');
}
return response.status === 204;
};
// Usage
try {
await deleteLivestream(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Livestream deleted successfully');
} catch (error) {
console.error('Error:', error.message);
}
func deleteLivestream(accessToken: String, id: UUID) async throws {
var urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/livestreams/\(id)")!)
urlRequest.httpMethod = "DELETE"
urlRequest.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
let (_, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode == 404 {
throw URLError(.resourceNotFound)
}
if httpResponse.statusCode != 204 {
throw URLError(.badServerResponse)
}
}
// Usage
do {
try await deleteLivestream(
accessToken: "eyJhbGciOiJIUzI1NiIs...",
id: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("Livestream deleted successfully")
} catch {
print("Error:", error)
}
suspend fun deleteLivestream(accessToken: String, id: UUID) {
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/livestreams/$id")
.delete()
.header("Authorization", "Bearer $accessToken")
.build()
withContext(Dispatchers.IO) {
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
throw when (response.code) {
404 -> NoSuchElementException("Livestream not found")
else -> IOException("Unexpected response ${response.code}")
}
}
}
}
}
// Usage
try {
deleteLivestream(
"eyJhbGciOiJIUzI1NiIs...",
UUID.fromString("123e4567-e89b-12d3-a456-426614174000")
)
println("Livestream deleted successfully")
} catch (e: Exception) {
println("Error: ${e.message}")
}
const deleteLivestream = async (accessToken: string, id: string): Promise<void> => {
try {
await axios.delete(
`https://api.tktchurch.com/v1/livestreams/${id}`,
{
headers: {
'Authorization': `Bearer ${accessToken}`
},
}
);
} catch (error) {
if (axios.isAxiosError(error)) {
if (error.response?.status === 404) {
throw new Error('Livestream not found');
}
throw new Error(error.response?.data?.reason || 'Failed to delete livestream');
}
throw error;
}
};
// Usage
try {
await deleteLivestream(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Livestream deleted successfully');
} catch (error) {
console.error('Error:', error.message);
}
{
"error": {
"status": 401,
"reason": "Invalid or expired access token"
}
}
{
"error": {
"status": 403,
"reason": "Missing required permission: deleteLivestream"
}
}
{
"error": {
"status": 404,
"reason": "Livestream not found"
}
}
Livestreams
Delete Livestream
Delete a livestream
DELETE
/
livestreams
/
{id}
curl -X DELETE "https://api.tktchurch.com/v1/livestreams/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
const deleteLivestream = async (accessToken, id) => {
const response = await fetch(
`https://api.tktchurch.com/v1/livestreams/${id}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${accessToken}`
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.reason || 'Failed to delete livestream');
}
return response.status === 204;
};
// Usage
try {
await deleteLivestream(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Livestream deleted successfully');
} catch (error) {
console.error('Error:', error.message);
}
func deleteLivestream(accessToken: String, id: UUID) async throws {
var urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/livestreams/\(id)")!)
urlRequest.httpMethod = "DELETE"
urlRequest.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
let (_, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode == 404 {
throw URLError(.resourceNotFound)
}
if httpResponse.statusCode != 204 {
throw URLError(.badServerResponse)
}
}
// Usage
do {
try await deleteLivestream(
accessToken: "eyJhbGciOiJIUzI1NiIs...",
id: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("Livestream deleted successfully")
} catch {
print("Error:", error)
}
suspend fun deleteLivestream(accessToken: String, id: UUID) {
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/livestreams/$id")
.delete()
.header("Authorization", "Bearer $accessToken")
.build()
withContext(Dispatchers.IO) {
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
throw when (response.code) {
404 -> NoSuchElementException("Livestream not found")
else -> IOException("Unexpected response ${response.code}")
}
}
}
}
}
// Usage
try {
deleteLivestream(
"eyJhbGciOiJIUzI1NiIs...",
UUID.fromString("123e4567-e89b-12d3-a456-426614174000")
)
println("Livestream deleted successfully")
} catch (e: Exception) {
println("Error: ${e.message}")
}
const deleteLivestream = async (accessToken: string, id: string): Promise<void> => {
try {
await axios.delete(
`https://api.tktchurch.com/v1/livestreams/${id}`,
{
headers: {
'Authorization': `Bearer ${accessToken}`
},
}
);
} catch (error) {
if (axios.isAxiosError(error)) {
if (error.response?.status === 404) {
throw new Error('Livestream not found');
}
throw new Error(error.response?.data?.reason || 'Failed to delete livestream');
}
throw error;
}
};
// Usage
try {
await deleteLivestream(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Livestream deleted successfully');
} catch (error) {
console.error('Error:', error.message);
}
{
"error": {
"status": 401,
"reason": "Invalid or expired access token"
}
}
{
"error": {
"status": 403,
"reason": "Missing required permission: deleteLivestream"
}
}
{
"error": {
"status": 404,
"reason": "Livestream not found"
}
}
This endpoint requires authentication and the
deleteLivestream permission.Path Parameters
string
required
The UUID of the livestream to delete
Response
Returns HTTP 204 (No Content) on successful deletion.Error Responses
object
Common error cases:
- 401 Unauthorized: Missing or invalid access token
- 403 Forbidden: Missing required permission
- 404 Not Found: Livestream not found
curl -X DELETE "https://api.tktchurch.com/v1/livestreams/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
const deleteLivestream = async (accessToken, id) => {
const response = await fetch(
`https://api.tktchurch.com/v1/livestreams/${id}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${accessToken}`
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.reason || 'Failed to delete livestream');
}
return response.status === 204;
};
// Usage
try {
await deleteLivestream(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Livestream deleted successfully');
} catch (error) {
console.error('Error:', error.message);
}
func deleteLivestream(accessToken: String, id: UUID) async throws {
var urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/livestreams/\(id)")!)
urlRequest.httpMethod = "DELETE"
urlRequest.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization")
let (_, response) = try await URLSession.shared.data(for: urlRequest)
guard let httpResponse = response as? HTTPURLResponse else {
throw URLError(.badServerResponse)
}
if httpResponse.statusCode == 404 {
throw URLError(.resourceNotFound)
}
if httpResponse.statusCode != 204 {
throw URLError(.badServerResponse)
}
}
// Usage
do {
try await deleteLivestream(
accessToken: "eyJhbGciOiJIUzI1NiIs...",
id: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("Livestream deleted successfully")
} catch {
print("Error:", error)
}
suspend fun deleteLivestream(accessToken: String, id: UUID) {
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/livestreams/$id")
.delete()
.header("Authorization", "Bearer $accessToken")
.build()
withContext(Dispatchers.IO) {
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
throw when (response.code) {
404 -> NoSuchElementException("Livestream not found")
else -> IOException("Unexpected response ${response.code}")
}
}
}
}
}
// Usage
try {
deleteLivestream(
"eyJhbGciOiJIUzI1NiIs...",
UUID.fromString("123e4567-e89b-12d3-a456-426614174000")
)
println("Livestream deleted successfully")
} catch (e: Exception) {
println("Error: ${e.message}")
}
const deleteLivestream = async (accessToken: string, id: string): Promise<void> => {
try {
await axios.delete(
`https://api.tktchurch.com/v1/livestreams/${id}`,
{
headers: {
'Authorization': `Bearer ${accessToken}`
},
}
);
} catch (error) {
if (axios.isAxiosError(error)) {
if (error.response?.status === 404) {
throw new Error('Livestream not found');
}
throw new Error(error.response?.data?.reason || 'Failed to delete livestream');
}
throw error;
}
};
// Usage
try {
await deleteLivestream(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Livestream deleted successfully');
} catch (error) {
console.error('Error:', error.message);
}
{
"error": {
"status": 401,
"reason": "Invalid or expired access token"
}
}
{
"error": {
"status": 403,
"reason": "Missing required permission: deleteLivestream"
}
}
{
"error": {
"status": 404,
"reason": "Livestream not found"
}
}
