Create a webhook endpoint
curl --request POST \
--url https://api.textsetu.com/api/v1/projects/{projectId}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"eventTypes": [],
"description": "<string>",
"includeAiGenerated": false
}
'import requests
url = "https://api.textsetu.com/api/v1/projects/{projectId}/webhooks"
payload = {
"url": "<string>",
"eventTypes": [],
"description": "<string>",
"includeAiGenerated": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
eventTypes: [],
description: '<string>',
includeAiGenerated: false
})
};
fetch('https://api.textsetu.com/api/v1/projects/{projectId}/webhooks', 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://api.textsetu.com/api/v1/projects/{projectId}/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'eventTypes' => [
],
'description' => '<string>',
'includeAiGenerated' => false
]),
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://api.textsetu.com/api/v1/projects/{projectId}/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"eventTypes\": [],\n \"description\": \"<string>\",\n \"includeAiGenerated\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.textsetu.com/api/v1/projects/{projectId}/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"eventTypes\": [],\n \"description\": \"<string>\",\n \"includeAiGenerated\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.textsetu.com/api/v1/projects/{projectId}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"eventTypes\": [],\n \"description\": \"<string>\",\n \"includeAiGenerated\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"endpoint": {
"id": "9f2c…",
"url": "https://example.com/webhooks/textsetu",
"description": "<string>",
"eventTypes": [
"translation_key.created",
"branch.merged"
],
"status": "enabled",
"secretPrefix": "whsec_a1b2c3",
"includeAiGenerated": true,
"consecutiveFailures": 123,
"lastSuccessAt": "<string>",
"lastFailureAt": "<string>",
"lastError": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"secret": "whsec_MfKQ9r8G…"
}
}Webhooks
Create a webhook endpoint
Register an HTTPS URL to receive the events you subscribe it to. TextSetu generates a signing secret and returns it once.
Constraints:
- The
secretis returned ONCE and cannot be retrieved later — store it before discarding the response. - The URL must be publicly reachable — private, loopback and link-local addresses are rejected, and redirects are never followed.
eventTypesmust contain at least one type fromGET /webhook-event-types.
POST
/
projects
/
{projectId}
/
webhooks
Create a webhook endpoint
curl --request POST \
--url https://api.textsetu.com/api/v1/projects/{projectId}/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"eventTypes": [],
"description": "<string>",
"includeAiGenerated": false
}
'import requests
url = "https://api.textsetu.com/api/v1/projects/{projectId}/webhooks"
payload = {
"url": "<string>",
"eventTypes": [],
"description": "<string>",
"includeAiGenerated": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
eventTypes: [],
description: '<string>',
includeAiGenerated: false
})
};
fetch('https://api.textsetu.com/api/v1/projects/{projectId}/webhooks', 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://api.textsetu.com/api/v1/projects/{projectId}/webhooks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => '<string>',
'eventTypes' => [
],
'description' => '<string>',
'includeAiGenerated' => false
]),
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://api.textsetu.com/api/v1/projects/{projectId}/webhooks"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"eventTypes\": [],\n \"description\": \"<string>\",\n \"includeAiGenerated\": false\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.textsetu.com/api/v1/projects/{projectId}/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"eventTypes\": [],\n \"description\": \"<string>\",\n \"includeAiGenerated\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.textsetu.com/api/v1/projects/{projectId}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"<string>\",\n \"eventTypes\": [],\n \"description\": \"<string>\",\n \"includeAiGenerated\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"endpoint": {
"id": "9f2c…",
"url": "https://example.com/webhooks/textsetu",
"description": "<string>",
"eventTypes": [
"translation_key.created",
"branch.merged"
],
"status": "enabled",
"secretPrefix": "whsec_a1b2c3",
"includeAiGenerated": true,
"consecutiveFailures": 123,
"lastSuccessAt": "<string>",
"lastFailureAt": "<string>",
"lastError": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
},
"secret": "whsec_MfKQ9r8G…"
}
}Authorizations
API token: tsu_pat_… (PAT) or tsu_proj_… (project token). The token's granted RBAC permissions determine access; see each operation's x-permission.
Path Parameters
Project id (UUID) or id-embedded path slug.
Body
application/json
Required string length:
1 - 2048Required array length:
1 - 10 elementsAvailable options:
translation_key.created, translation_key.updated, translation_key.deleted, translation_value.updated, branch.created, branch.merged, import.completed, export.completed, language.added, language.removed Maximum string length:
500
