curl -X DELETE "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer {access_token}"
const deleteEvent = async (accessToken, eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${accessToken}`
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error.reason);
}
};
// Usage
try {
await deleteEvent(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Event deleted successfully');
} catch (error) {
console.error('Error:', error);
}
func deleteEvent(accessToken: String, eventId: UUID) async throws {
var urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(eventId)")!)
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 != 204 {
throw URLError(.badServerResponse)
}
}
// Usage
do {
try await deleteEvent(
accessToken: "eyJhbGciOiJIUzI1NiIs...",
eventId: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("Event deleted successfully")
} catch {
print("Error:", error)
}
suspend fun deleteEvent(accessToken: String, eventId: String) {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId")
.delete()
.header("Authorization", "Bearer $accessToken")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
val error = response.body?.string()?.fromJson<ErrorResponse>()
throw Exception(error?.reason ?: "Failed to delete event")
}
}
}
// Usage
try {
deleteEvent(
"eyJhbGciOiJIUzI1NiIs...",
"123e4567-e89b-12d3-a456-426614174000"
)
println("Event deleted successfully")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const deleteEvent = async (accessToken: string, eventId: string): Promise<void> => {
try {
await axios.delete(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
headers: {
'Authorization': `Bearer ${accessToken}`
},
}
);
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.error?.reason || 'Failed to delete event');
}
throw error;
}
};
// Usage
try {
await deleteEvent(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Event deleted successfully');
} catch (error) {
console.error('Error:', error);
}
{
"error": {
"status": 401,
"reason": "Invalid or expired access token"
}
}
{
"error": {
"status": 403,
"reason": "Missing required permission: deleteEvent"
}
}
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
Events
Delete Event
Delete an existing event
DELETE
/
events
/
{id}
curl -X DELETE "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer {access_token}"
const deleteEvent = async (accessToken, eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${accessToken}`
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error.reason);
}
};
// Usage
try {
await deleteEvent(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Event deleted successfully');
} catch (error) {
console.error('Error:', error);
}
func deleteEvent(accessToken: String, eventId: UUID) async throws {
var urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(eventId)")!)
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 != 204 {
throw URLError(.badServerResponse)
}
}
// Usage
do {
try await deleteEvent(
accessToken: "eyJhbGciOiJIUzI1NiIs...",
eventId: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("Event deleted successfully")
} catch {
print("Error:", error)
}
suspend fun deleteEvent(accessToken: String, eventId: String) {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId")
.delete()
.header("Authorization", "Bearer $accessToken")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
val error = response.body?.string()?.fromJson<ErrorResponse>()
throw Exception(error?.reason ?: "Failed to delete event")
}
}
}
// Usage
try {
deleteEvent(
"eyJhbGciOiJIUzI1NiIs...",
"123e4567-e89b-12d3-a456-426614174000"
)
println("Event deleted successfully")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const deleteEvent = async (accessToken: string, eventId: string): Promise<void> => {
try {
await axios.delete(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
headers: {
'Authorization': `Bearer ${accessToken}`
},
}
);
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.error?.reason || 'Failed to delete event');
}
throw error;
}
};
// Usage
try {
await deleteEvent(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Event deleted successfully');
} catch (error) {
console.error('Error:', error);
}
{
"error": {
"status": 401,
"reason": "Invalid or expired access token"
}
}
{
"error": {
"status": 403,
"reason": "Missing required permission: deleteEvent"
}
}
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
This endpoint requires authentication and the
deleteEvent permission.Path Parameters
string
required
The unique identifier (UUID) of the event to delete
Response
A successful request returns HTTP 204 No Content status.Error Responses
object
Common error cases:
- 401 Unauthorized: Missing or invalid access token
- 403 Forbidden: Insufficient permissions
- 404 Not Found: Event not found
curl -X DELETE "https://api.tktchurch.com/v1/events/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer {access_token}"
const deleteEvent = async (accessToken, eventId) => {
const response = await fetch(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
method: 'DELETE',
headers: {
'Authorization': `Bearer ${accessToken}`
}
}
);
if (!response.ok) {
const error = await response.json();
throw new Error(error.error.reason);
}
};
// Usage
try {
await deleteEvent(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Event deleted successfully');
} catch (error) {
console.error('Error:', error);
}
func deleteEvent(accessToken: String, eventId: UUID) async throws {
var urlRequest = URLRequest(url: URL(string: "https://api.tktchurch.com/v1/events/\(eventId)")!)
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 != 204 {
throw URLError(.badServerResponse)
}
}
// Usage
do {
try await deleteEvent(
accessToken: "eyJhbGciOiJIUzI1NiIs...",
eventId: UUID(uuidString: "123e4567-e89b-12d3-a456-426614174000")!
)
print("Event deleted successfully")
} catch {
print("Error:", error)
}
suspend fun deleteEvent(accessToken: String, eventId: String) {
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api.tktchurch.com/v1/events/$eventId")
.delete()
.header("Authorization", "Bearer $accessToken")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
val error = response.body?.string()?.fromJson<ErrorResponse>()
throw Exception(error?.reason ?: "Failed to delete event")
}
}
}
// Usage
try {
deleteEvent(
"eyJhbGciOiJIUzI1NiIs...",
"123e4567-e89b-12d3-a456-426614174000"
)
println("Event deleted successfully")
} catch (e: Exception) {
println("Error: ${e.message}")
}
import axios from 'axios';
const deleteEvent = async (accessToken: string, eventId: string): Promise<void> => {
try {
await axios.delete(
`https://api.tktchurch.com/v1/events/${eventId}`,
{
headers: {
'Authorization': `Bearer ${accessToken}`
},
}
);
} catch (error) {
if (axios.isAxiosError(error)) {
throw new Error(error.response?.data?.error?.reason || 'Failed to delete event');
}
throw error;
}
};
// Usage
try {
await deleteEvent(
'eyJhbGciOiJIUzI1NiIs...',
'123e4567-e89b-12d3-a456-426614174000'
);
console.log('Event deleted successfully');
} catch (error) {
console.error('Error:', error);
}
{
"error": {
"status": 401,
"reason": "Invalid or expired access token"
}
}
{
"error": {
"status": 403,
"reason": "Missing required permission: deleteEvent"
}
}
{
"error": {
"status": 404,
"reason": "Event not found"
}
}
