Update a source
PATCH/v1/sources/{sourceId}preview
Rename a source, change the type and channels of the events it receives from now on, or link or unlink its transform. Refused with 400 for a transformId that is not a source transform in this app.
Path parameters
sourceIdstring RequiredA source ID, starting with src_.
Body
namestring OptionalHuman-readable label for the source, such as the provider that sends to it.
1 to 120 characters
defaultTypestring OptionalThe type of every event this source receives, for example billing.webhook.
1 to 64 characters
defaultChannelsstring[] OptionalChannels every event this source receives is addressed to. Empty: the events reach only destinations that list no channel. Stored sorted, without duplicates.
At most 10 items
transformIdstring | null OptionalThe source transform to link. null unlinks it.
Returns
The command completed.200
dataobject RequiredA source: a URL a webhook provider sends requests to, each of which becomes an event.
idstring RequiredA source ID, starting with src_.
namestring RequiredHuman-readable label for the source, such as the provider that sends to it.
1 to 120 characters
urlstring RequiredThe source’s URL without its token. Requests go to this URL followed by / and the token, which is shown only when the source is created or its token rotated.
tokenLast4string RequiredThe last four characters of the token.
previousTokenExpiresAtstring | null RequiredWhen the token a rotation replaced stops working. Null when there is none.
defaultTypestring RequiredThe type of every event this source receives, for example billing.webhook.
1 to 64 characters
defaultChannelsstring[] RequiredChannels every event this source receives is addressed to. Empty: the events reach only destinations that list no channel. Stored sorted, without duplicates.
At most 10 items
signatureobject | null RequiredThe HMAC check every request must pass. Null: the source is URL only.
queryChallengeobject | null RequiredThe GET URL check. Null: none.
bodyChallengeobject | null RequiredThe POST URL check. Null: none.
transformIdstring | null RequiredThe transform that builds every event. Null: a JSON body becomes the payload as received.
createdAtstring (date-time) RequiredISO 8601 timestamp.
updatedAtstring (date-time) RequiredISO 8601 timestamp.
lastEventAtstring | null RequiredWhen this source last received a request that became an event, to the minute. Null when there is none.
Example
curl -X PATCH "https://api.payloadpuffin.com/v1/sources/$SOURCEID" \
-H "Authorization: Bearer $PAYLOADPUFFIN_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"name":"example"}'{
"data": {
"id": "id",
"name": "name",
"url": "url",
"tokenLast4": "tokenLast4",
"previousTokenExpiresAt": "previousTokenExpiresAt",
"defaultType": "defaultType",
"defaultChannels": [
"defaultChannels"
],
"signature": {
"algorithm": "sha256",
"header": "header",
"encoding": "hex",
"secretEncoding": "text",
"delimiter": "delimiter",
"prefix": "prefix",
"timestamp": {
"header": "header",
"prefix": "prefix",
"toleranceSeconds": 1
},
"signedContent": "signedContent",
"storeUnverified": true,
"previousSecretExpiresAt": "previousSecretExpiresAt"
},
"queryChallenge": {
"tokenParameter": "tokenParameter",
"token": "token",
"challengeParameter": "challengeParameter"
},
"bodyChallenge": {
"member": "member",
"value": "value",
"echo": "echo"
},
"transformId": "transformId",
"createdAt": "createdAt",
"updatedAt": "updatedAt",
"lastEventAt": "lastEventAt"
}
}Errors
Errors use application/problem+json. The code member is stable; branch on it rather than on title or detail.
4XXapplication/problem+jsonThe request was rejected.