LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/webhook_endpoints" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"webhook_endpoint": {
"webhook_url": "https://foo.bar",
"signature_algo": "hmac"
}
}'
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
from lago_python_client.models import WebhookEndpoint
client = Client(api_key='__YOUR_API_KEY__')
webhook_endpoint = WebhookEndpoint(
webhook_url='https://foo.bar',
signature_algo: 'hmac'
)
try:
client.webhook_endpoints.create(webhook_endpoint)
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.webhook_endpoints.create({
webhook_url: 'https://foo.bar',
signature_algo: 'hmac'
})
await client.webhookEndpoints.createWebhookEndpoint({
webhook_endpoint: {
webhook_url: "https://foo.bar",
signature_algo: "hmac",
},
});
import "fmt"
import "github.com/getlago/lago-go-client"
func main() {
lagoClient := lago.New().
SetApiKey("__YOUR_API_KEY__")
webhookEndpointInput := &lago.WebhookEndpointInput{
WebhookURL: "https://foo.bar"
}
webhookEndpoint, err := lagoClient.WebhookEndpoint().Create(webhookEndpointInput)
if err != nil {
// Error is *lago.Error
panic(err)
}
// webhookEndpoint is *lago.WebhookEndpoint
fmt.Println(webhookEndpoint)
}
{
"webhook_endpoint": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"webhook_url": "Prepaid",
"created_at": "2022-04-29T08:59:51Z",
"signature_algo": "hmac"
}
}{
"status": 400,
"error": "Bad request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}Webhook endpoints
Create a webhook endpoint
This endpoint is used to create a webhook endpoint.
POST
/
webhook_endpoints
LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/webhook_endpoints" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"webhook_endpoint": {
"webhook_url": "https://foo.bar",
"signature_algo": "hmac"
}
}'
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
from lago_python_client.models import WebhookEndpoint
client = Client(api_key='__YOUR_API_KEY__')
webhook_endpoint = WebhookEndpoint(
webhook_url='https://foo.bar',
signature_algo: 'hmac'
)
try:
client.webhook_endpoints.create(webhook_endpoint)
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.webhook_endpoints.create({
webhook_url: 'https://foo.bar',
signature_algo: 'hmac'
})
await client.webhookEndpoints.createWebhookEndpoint({
webhook_endpoint: {
webhook_url: "https://foo.bar",
signature_algo: "hmac",
},
});
import "fmt"
import "github.com/getlago/lago-go-client"
func main() {
lagoClient := lago.New().
SetApiKey("__YOUR_API_KEY__")
webhookEndpointInput := &lago.WebhookEndpointInput{
WebhookURL: "https://foo.bar"
}
webhookEndpoint, err := lagoClient.WebhookEndpoint().Create(webhookEndpointInput)
if err != nil {
// Error is *lago.Error
panic(err)
}
// webhookEndpoint is *lago.WebhookEndpoint
fmt.Println(webhookEndpoint)
}
{
"webhook_endpoint": {
"lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"lago_organization_id": "1a901a90-1a90-1a90-1a90-1a901a901a90",
"webhook_url": "Prepaid",
"created_at": "2022-04-29T08:59:51Z",
"signature_algo": "hmac"
}
}{
"status": 400,
"error": "Bad request"
}{
"status": 401,
"error": "Unauthorized"
}{
"status": 422,
"error": "Unprocessable entity",
"code": "validation_errors",
"error_details": {}
}LAGO_URL="https://api.getlago.com"
API_KEY="__YOUR_API_KEY__"
curl --location --request POST "$LAGO_URL/api/v1/webhook_endpoints" \
--header "Authorization: Bearer $API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"webhook_endpoint": {
"webhook_url": "https://foo.bar",
"signature_algo": "hmac"
}
}'
from lago_python_client.client import Client
from lago_python_client.exceptions import LagoApiError
from lago_python_client.models import WebhookEndpoint
client = Client(api_key='__YOUR_API_KEY__')
webhook_endpoint = WebhookEndpoint(
webhook_url='https://foo.bar',
signature_algo: 'hmac'
)
try:
client.webhook_endpoints.create(webhook_endpoint)
except LagoApiError as e:
repair_broken_state(e) # do something on error or raise your own exception
require 'lago-ruby-client'
client = Lago::Api::Client.new(api_key: '__YOUR_API_KEY__')
client.webhook_endpoints.create({
webhook_url: 'https://foo.bar',
signature_algo: 'hmac'
})
await client.webhookEndpoints.createWebhookEndpoint({
webhook_endpoint: {
webhook_url: "https://foo.bar",
signature_algo: "hmac",
},
});
import "fmt"
import "github.com/getlago/lago-go-client"
func main() {
lagoClient := lago.New().
SetApiKey("__YOUR_API_KEY__")
webhookEndpointInput := &lago.WebhookEndpointInput{
WebhookURL: "https://foo.bar"
}
webhookEndpoint, err := lagoClient.WebhookEndpoint().Create(webhookEndpointInput)
if err != nil {
// Error is *lago.Error
panic(err)
}
// webhookEndpoint is *lago.WebhookEndpoint
fmt.Println(webhookEndpoint)
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Webhook Endpoint payload
Show child attributes
Show child attributes
Response
Webhook Endpoint created
Show child attributes
Show child attributes
⌘I