Create a webhook endpoint
POST
/webhooks
const url = 'https://api.invogi.com/v1/webhooks';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"https://example.com","events":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.invogi.com/v1/webhooks \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "https://example.com", "events": [ "example" ] }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
url
required
string format: uri
events
required
Array<string>
Example generated
{ "url": "https://example.com", "events": [ "example" ]}Responses
Section titled “Responses”Webhook endpoint created
Media typeapplication/json
object
id
required
string
url
required
string format: uri
enabled
required
boolean
events
Array<string>
Example generated
{ "id": "example", "url": "https://example.com", "enabled": true, "events": [ "example" ]}Invalid request
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{ "error": { "code": "NOT_FOUND" }}Missing or invalid API key
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
request_id
required
string
Example
{ "error": { "code": "NOT_FOUND" }}