Skip to content
Browse documentation

OpenAPI operations

Update a project template

PATCH
/v1/templates/{id}
curl --request PATCH \
--url https://api.hooks.events/v1/templates/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "description": "example", "provider": "example", "targetType": "example", "targetLabel": "example", "destinationName": "example", "testEventType": "example", "fields": [ { "key": "example", "label": "example", "type": "text", "required": true, "secret": true, "sourceSecret": true, "placeholder": "example", "help": "example" } ], "filters": { "additionalProperty": "example" }, "config": { "additionalProperty": "example" }, "urlTemplate": "example", "bodyTemplate": "example", "auth": { "additionalProperty": "example" }, "headers": { "additionalProperty": "example" }, "setup": [ "example" ] }'

Requires the endpoints:write scope.

id
required
string
Media typeapplication/json
object
name
string
>= 1 characters <= 120 characters
description
string
>= 1 characters <= 400 characters
provider
string
>= 1 characters
targetType
string
>= 1 characters
targetLabel
string
>= 1 characters <= 80 characters
destinationName
string
>= 1 characters <= 60 characters
testEventType
string
>= 1 characters
fields
Array<object>
>= 1 items <= 10 items
object
key
required
string
/^[a-z][a-zA-Z0-9]*$/
label
required
string
>= 1 characters <= 120 characters
type
required
string
Allowed values: text url password
required
required
boolean
secret
boolean
sourceSecret
boolean
placeholder
string
<= 300 characters
help
string
<= 500 characters
filters
object
key
additional properties
config
object
key
additional properties
urlTemplate
string
>= 1 characters
bodyTemplate
string
>= 1 characters <= 4000 characters
auth
object
key
additional properties
headers
object
key
additional properties
string
<= 4000 characters
setup
Array<string>
>= 1 items <= 8 items

Success

Media typeapplication/json

Source→target template

object
key
additional properties

Example generated

{
"additionalProperty": "example"
}

Validation error

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}

Missing or invalid credentials

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}

The credential lacks the required scope, or the workspace is not writable

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}

Resource not found

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}

Rate limited

Media typeapplication/json
object
error
required
object
code
required

Machine-readable error code

string
message
required
string
requestId
required

Request id, also echoed in x-request-id

string
key
additional properties

Example generated

{
"error": {
"code": "example",
"message": "example",
"requestId": "example"
}
}
X-RateLimit-Limit
integer

Requests allowed per window

X-RateLimit-Remaining
integer
X-RateLimit-Reset
integer

Seconds until the window resets