Create a webhook
curl --request POST \
--url https://api.onlyform.com/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"form_id": "507f1f77bcf86cd799439011",
"url": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({form_id: '507f1f77bcf86cd799439011', url: '<string>'})
};
fetch('https://api.onlyform.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onlyform.com/v1/webhooks"
payload = {
"form_id": "507f1f77bcf86cd799439011",
"url": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onlyform.com/v1/webhooks"
payload := strings.NewReader("{\n \"form_id\": \"507f1f77bcf86cd799439011\",\n \"url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"id": "507f1f77bcf86cd799439011",
"form_id": "507f1f77bcf86cd799439011",
"url": "<string>",
"enabled": true,
"event_types": [
"form.response.completed"
],
"has_secret": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}Webhooks
Create a webhook
Onlyform validates the destination against private and reserved networks. Requires webhooks:write.
POST
https://api.onlyform.com
/
v1
/
webhooks
Create a webhook
curl --request POST \
--url https://api.onlyform.com/v1/webhooks \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"form_id": "507f1f77bcf86cd799439011",
"url": "<string>"
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({form_id: '507f1f77bcf86cd799439011', url: '<string>'})
};
fetch('https://api.onlyform.com/v1/webhooks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.onlyform.com/v1/webhooks"
payload = {
"form_id": "507f1f77bcf86cd799439011",
"url": "<string>"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.onlyform.com/v1/webhooks"
payload := strings.NewReader("{\n \"form_id\": \"507f1f77bcf86cd799439011\",\n \"url\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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))
}{
"id": "507f1f77bcf86cd799439011",
"form_id": "507f1f77bcf86cd799439011",
"url": "<string>",
"enabled": true,
"event_types": [
"form.response.completed"
],
"has_secret": true,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"status": 123,
"request_id": "<string>",
"details": [
{}
]
}Authorizations
A scoped key with the of_live_ prefix, generated from Profile > API keys.
Body
application/json
Response
Webhook created.
Pattern:
^[0-9a-fA-F]{24}$Example:
"507f1f77bcf86cd799439011"
Pattern:
^[0-9a-fA-F]{24}$Example:
"507f1f77bcf86cd799439011"
Allowed value:
"form.response.completed"Was this page helpful?