Repository navigation
docs(webhooks): say how the OAuth 2.0 token request is sent - #616
Open
viniciusgiles wants to merge 1 commit into
Open
viniciusgiles wants to merge 1 commit into
viniciusgiles wants to merge 1 commit into
Conversation
Describe auth_request_details.body as form fields POSTed to the token URL, so that keys such as scope and audience are clearly supported. State what the token response must contain, when an update sends a test POST request, and show grant_type in the stored examples.
rafaelmatsumotomb
approved these changes
Nov 11, 2026
danielfsousa
approved these changes
Nov 11, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The webhooks reference said only that
auth_request_details.body"likely should contain the client ID, client secret, and grant type". It did not say how SparkPost sendsbody, so readers could not tell that they can add keys such asscope.This change updates the Webhooks Object, Create and Update sections of
content/api/webhooks.apibin the same way:body: SparkPost POSTs it tourlwithContent-Type: application/x-www-form-urlencoded, one form field per key.grant_typedefaults toclient_credentials. Other keys, such asscopeoraudience, are sent as is. An example shows abodywithscopeand the form it is sent as.url: redirects are not followed. The response must be JSON that containsaccess_token, andtoken_type, if present, must beBearer. SparkPost then sendsAuthorization: Bearer <access_token>with each batch, and requests a new token when the target responds with HTTP 400 or 401.target,auth_request_detailsorcustom_headers, or setsactiveto true, sends a test POST request. For oauth2 with newauth_request_details, SparkPost requests a new token first. A failed token request or a non-200 test response fails the update with HTTP 400. Before, the text named onlytarget."grant_type": "client_credentials"in the storedbody, as the API returns it.Verification
fury-adapter-apib-parser) and gives the same warnings asmain./api/webhooks/: theurlandbodyattributes under Webhooks Object, Create a Webhook and Update a Webhook, and the paragraph under Update a Webhook.🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes to the webhooks API Blueprint; no runtime or API behavior changes.
Overview
Expands the Event Webhooks API reference for OAuth 2.0
auth_request_detailsso integrators know how SparkPost actually calls the token endpoint and uses the result.The
urlandbodyfield descriptions are rewritten consistently on the Webhooks Object, Create, and Update sections: token requests use the token URL directly (redirects fail), expect JSON withaccess_token(andBeareriftoken_typeis set), attachAuthorization: Bearer …on webhook batches, and refresh tokens on 400/401. Thebodyis sent asapplication/x-www-form-urlencoded, with defaultgrant_typeofclient_credentialsand support for extra keys such asscopeoraudience, including a concrete form-encoded example.Update a Webhook now documents when a validation test POST runs (not only on
targetchanges): also whenauth_request_details,custom_headers, oractive: trueare involved, with OAuth token fetch before the test whenauth_request_detailschanges. Retrieve/list response examples add"grant_type": "client_credentials"in storedauth_request_details.body.Reviewed by Cursor Bugbot for commit a6111db. Bugbot is set up for automated code reviews on this repo. Configure here.