@@ -38,6 +38,8 @@ The simplest way to authenticate webhook requests is using a secret token. Vapi
3838
3939For more complex authentication scenarios, you can configure custom headers that Vapi will include with each webhook request.
4040
41+ This could include short lived JWTs/API Keys passed along via the Authorization header, or any other header that your server checks for.
42+
4143#### Configuration
4244
4345``` json
@@ -82,3 +84,32 @@ For OAuth2-protected webhook endpoints, you can configure OAuth2 credentials tha
82843 . Vapi includes the access token in the Authorization header for webhook requests
83854 . Your server validates the access token before processing the webhook
84865 . When the token expires, Vapi automatically requests a new one
87+
88+ #### OAuth2 Token Response Format
89+
90+ Your server should return a JSON response with the following format:
91+
92+ ``` json
93+ {
94+ "access_token" : " eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." ,
95+ "token_type" : " Bearer" ,
96+ "expires_in" : 3600 ,
97+ "refresh_token" : " tGzv3JOkF0XG5Qx2TlKWIA" , // Optional
98+ "scope" : " read write" // Optional, only if scope was requested
99+ }
100+ ```
101+
102+ Example error response:
103+
104+ ``` json
105+ {
106+ "error" : " invalid_client" ,
107+ "error_description" : " Invalid client credentials"
108+ }
109+ ```
110+
111+ Common error types:
112+ - ` invalid_client ` : Invalid client credentials
113+ - ` invalid_grant ` : Invalid or expired refresh token
114+ - ` invalid_scope ` : Invalid scope requested
115+ - ` unauthorized_client ` : Client not authorized for this grant type
0 commit comments