{"__v":3,"_id":"5434b5a80ef9c0080016546f","category":{"__v":30,"_id":"5434918d0ef9c008001651ff","pages":["5435626c5ff8a51a006e4110","543553953513400800a14736","543555cc3513400800a14752","54355bcc35740020002a1b3b","5434928b0ef9c0080016520e","54347c8e5b10711400c6c30a","54346f750ef9c00800164fa0","543470f45b10711400c6c1e5","543477b70ef9c0080016505b","543478fb5b10711400c6c29f","54347d105b10711400c6c318","54347df00ef9c008001650d2","54347edf5b10711400c6c336","54357a175e1b2020004380dc","543483520ef9c0080016512a","543484820ef9c0080016513a","5434887e5b10711400c6c3cd","543488c05b10711400c6c3d2","54348ac85b10711400c6c401","5434959c0ef9c0080016522d","543497030ef9c00800165244","543498ae5b10711400c6c4f6","54349b7f0ef9c00800165293","54349c070ef9c00800165298","54349dbf0ef9c008001652ad","5434ab8e0ef9c00800165384","5434abbb0ef9c0080016538f","5434ac495b10711400c6c626","5434ada40ef9c008001653a8","5434af0a0ef9c008001653bc","5434af5f0ef9c008001653c8","5434b00a5b10711400c6c66b","5434b0d15b10711400c6c68c","5434b1ee0ef9c00800165406","5434b26d0ef9c0080016541c","5434b3560ef9c00800165427","5434b3b40ef9c0080016545a","5434b49f008ec22200d86ab9","5434b51f008ec22200d86aca","5434b5a80ef9c0080016546f","5434b5f4008ec22200d86ad8","5434b676008ec22200d86add","5434b6e6008ec22200d86ae5"],"project":"543469460ef9c00800164f0e","version":"54346a2a0ef9c00800164f28","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-08T01:21:17.804Z","from_sync":false,"order":1,"slug":"rest-api","title":"REST API"},"editedParams":true,"editedParams2":true,"is_link":false,"parentDoc":null,"project":"543469460ef9c00800164f0e","user":"543469060ef9c00800164f01","version":{"__v":7,"_id":"54346a2a0ef9c00800164f28","forked_from":"543469460ef9c00800164f11","project":"543469460ef9c00800164f0e","createdAt":"2014-10-07T22:33:14.982Z","releaseDate":"2014-10-07T22:33:14.982Z","categories":["54346a2b0ef9c00800164f29","543473445b10711400c6c21a","543473500ef9c00800164fde","54347c625b10711400c6c301","5434918d0ef9c008001651ff","5434b72c008ec22200d86ae7","5435990c495d5d0800f3a510"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-08T03:55:20.035Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"examples":{"codes":[]},"results":{"codes":[{"name":"Success","code":"{\n  \"id\" : \"12345\"\n}","language":"json","status":201},{"code":"{\n  \"status\": \"error\",\n  \"error\": \"A form id was not supplied\"\n}","language":"json","status":400,"name":"Form ID not specified"},{"code":"{\n  \"status\": \"error\",\n  \"error\": \"A valid form id was not supplied\"\n}","language":"json","status":404,"name":"Form not found"},{"code":"{\n  \"status\": \"error\",\n  \"error\": \"The action was forbidden by form permissions\"\n}","language":"json","status":403,"name":"Forbidden action"},{"code":"{\n  \"status\": \"error\",\n  \"error\": \"The url field is required\"\n}","language":"json","status":400,"name":"URL argument missing"},{"code":"{\n  \"status\": \"error\",\n  \"error\": \"Could not create the webook: Error specific message\"\n}","language":"json","status":500,"name":"Error creating webhook"}]},"settings":"","try":false,"auth":"required","params":[{"_id":"5434b5a80ef9c00800165473","ref":"","in":"path","required":true,"desc":"Form ID","default":"","type":"int","name":"id"},{"_id":"5434b5a80ef9c00800165472","ref":"","in":"body","required":true,"desc":"The webhook URL","default":"","type":"string","name":"url"},{"_id":"54c3a29cc8b0080d005e2ba2","ref":"","in":"body","required":false,"desc":"The webhook name","default":"Submit Action","type":"string","name":"name"},{"_id":"5434b5a80ef9c00800165471","ref":"","in":"body","required":false,"desc":"Used to help you prevent unauthorized calls to the webhook url","default":"","type":"string","name":"handshake_key"},{"_id":"54c3a29cc8b0080d005e2ba1","ref":"","in":"body","required":false,"desc":"Content Type of webhook data (urlencoded or json)","default":"urlencoded","type":"string","name":"content_type"},{"_id":"54c3a29cc8b0080d005e2ba0","ref":"","in":"body","required":false,"desc":"Flag to use field IDs as array keys in webhook data","default":"0","type":"boolean","name":"use_field_ids"},{"_id":"54c3a29cc8b0080d005e2b9f","ref":"","in":"body","required":false,"desc":"Flag to not include subfield names in webhook data","default":"0","type":"boolean","name":"no_subfield_names"},{"_id":"54c3a29cc8b0080d005e2b9e","ref":"","in":"body","required":false,"desc":"Flag to include field type in webhook data","default":"0","type":"boolean","name":"include_field_type"},{"_id":"582df5ac41771f0f004b9c71","ref":"","in":"body","required":false,"desc":"Field logic. See Field Logic section below.","default":"","type":"object","name":"logic"}],"url":"/v2/form/:id/webhook.json"},"isReference":false,"order":49,"body":"Add a new webhook to the specified form\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /api/v2/form/12345/webhook.json HTTP/1.1\\nHost: www.formstack.com\\nAuthorization: Bearer [[app:oauth_token]]\\nAccept: application/json\\nContent-Type: application/json\\n\\nurl=http%3A%2F%2Fwww.example.com\",\n      \"language\": \"http\"\n    },\n    {\n      \"code\": \"curl -X POST -i -H \\\"Accept: application/json\\\" -H \\\"Content-Type: application/json\\\" -H \\\"Authorization: Bearer [[app:oauth_token]]\\\" -d \\\"url=http%3A%2F%2Fwww.example.com\\\" https://www.formstack.com/api/v2/form/12345/webhook.json\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Field Logic\"\n}\n[/block]\nSee [Field Logic](doc:field-logic) for more information about the `logic` property.","excerpt":"Add a new webhook to the specified form","slug":"form-id-webhook-post","type":"post","title":"/form/:id/webhook"}

post/form/:id/webhook

Add a new webhook to the specified form

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

id:
required
integer
Form ID

Body Params

url:
required
string
The webhook URL
name:
stringSubmit Action
The webhook name
handshake_key:
string
Used to help you prevent unauthorized calls to the webhook url
content_type:
stringurlencoded
Content Type of webhook data (urlencoded or json)
use_field_ids:
boolean0
Flag to use field IDs as array keys in webhook data
no_subfield_names:
boolean0
Flag to not include subfield names in webhook data
include_field_type:
boolean0
Flag to include field type in webhook data
logic:
object
Field logic. See Field Logic section below.

Result Format


Documentation

Add a new webhook to the specified form [block:code] { "codes": [ { "code": "POST /api/v2/form/12345/webhook.json HTTP/1.1\nHost: www.formstack.com\nAuthorization: Bearer [[app:oauth_token]]\nAccept: application/json\nContent-Type: application/json\n\nurl=http%3A%2F%2Fwww.example.com", "language": "http" }, { "code": "curl -X POST -i -H \"Accept: application/json\" -H \"Content-Type: application/json\" -H \"Authorization: Bearer [[app:oauth_token]]\" -d \"url=http%3A%2F%2Fwww.example.com\" https://www.formstack.com/api/v2/form/12345/webhook.json", "language": "shell" } ] } [/block] [block:api-header] { "type": "basic", "title": "Field Logic" } [/block] See [Field Logic](doc:field-logic) for more information about the `logic` property.

User Information

Try It Out

post
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}