Update Event
curl --request PUT \
--url https://app.cometly.com/public-api/v1/events/{event_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"amount": {}
}'import requests
url = "https://app.cometly.com/public-api/v1/events/{event_id}"
payload = { "amount": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: {}})
};
fetch('https://app.cometly.com/public-api/v1/events/{event_id}', 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://app.cometly.com/public-api/v1/events/{event_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'amount' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.cometly.com/public-api/v1/events/{event_id}"
payload := strings.NewReader("{\n \"amount\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://app.cometly.com/public-api/v1/events/{event_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cometly.com/public-api/v1/events/{event_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}Events
Update Event
Update fields on an existing event
PUT
/
public-api
/
v1
/
events
/
{event_id}
Update Event
curl --request PUT \
--url https://app.cometly.com/public-api/v1/events/{event_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"amount": {}
}'import requests
url = "https://app.cometly.com/public-api/v1/events/{event_id}"
payload = { "amount": {} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: {}})
};
fetch('https://app.cometly.com/public-api/v1/events/{event_id}', 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://app.cometly.com/public-api/v1/events/{event_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'amount' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://app.cometly.com/public-api/v1/events/{event_id}"
payload := strings.NewReader("{\n \"amount\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.put("https://app.cometly.com/public-api/v1/events/{event_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.cometly.com/public-api/v1/events/{event_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}Overview
This endpoint updates fields on an event that Cometly has already ingested. It uses sparse PUT semantics: fields you include are replaced, fields you omit are left as they are. At least one updatable field must be provided. Currentlyamount is the updatable field.
Path Parameters
integer
required
The unique identifier of the event to update — the same
id returned by List Events or Get Event.Request Body
number | null
The new transaction amount. Must be
0 or greater. Numeric strings such as "120.25" are accepted. Sending null clears the amount.Response
Success Response
string
Confirmation message, e.g.
"Event updated successfully"Error Response
string
Error description explaining what went wrong
Example Requests
curl -X PUT https://app.cometly.com/public-api/v1/events/123456 \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"amount": 49.50
}'
const eventId = '123456';
const response = await fetch(`https://app.cometly.com/public-api/v1/events/${eventId}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
amount: 49.50
})
});
const data = await response.json();
console.log(data.message); // "Event updated successfully"
<?php
$eventId = '123456';
$url = 'https://app.cometly.com/public-api/v1/events/' . $eventId;
$headers = [
'Authorization: Bearer YOUR_API_KEY',
'Accept: application/json',
'Content-Type: application/json'
];
$data = [
'amount' => 49.50,
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response, true);
curl_close($ch);
?>
import requests
event_id = '123456'
url = f'https://app.cometly.com/public-api/v1/events/{event_id}'
headers = {
'Authorization': 'Bearer YOUR_API_KEY',
'Accept': 'application/json',
'Content-Type': 'application/json'
}
data = {
'amount': 49.50,
}
response = requests.put(url, headers=headers, json=data)
result = response.json()
Status Codes
| Status Code | Description |
|---|---|
| 200 | Event successfully updated |
| 401 | Missing or invalid API key |
| 403 | API key doesn’t have permission or subscription is inactive |
| 404 | Event not found in this Space |
| 422 | Invalid parameters provided (check error message for details) |
| 429 | Too many requests - rate limit exceeded. See Rate Limiting |
Notes
- Rate Limit: This endpoint has a limit of 60 requests per minute per Space. See Rate Limiting for details.
- Unknown fields in the request body are ignored.