Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node allows editing an existing webhook in the Admin context of a Gitea instance via its API. It is useful for managing webhooks that trigger on repository or organization events, enabling users to update webhook settings such as activation status, authorization headers, branch filters, configuration details, and subscribed events.

Typical use cases include:

  • Activating or deactivating a webhook without deleting it.
  • Changing the authorization header used by the webhook for secure communication.
  • Filtering webhook triggers to specific branches.
  • Updating the JSON configuration payload of the webhook.
  • Modifying which events the webhook listens to.

For example, a user might want to disable a webhook temporarily during maintenance or update the list of events it listens to after adding new features to their repositories.

Properties

Name Meaning
Id The unique identifier of the webhook to update (required).
Active Boolean flag to activate (true) or deactivate (false) the webhook.
Authorization Header A string value to set or update the authorization header sent with webhook requests.
Branch Filter A string specifying branch name patterns to filter webhook triggers.
Config A JSON object containing additional configuration parameters for the webhook.
Events A JSON array specifying which events the webhook should listen to.

Output

The node outputs the response from the Gitea API after attempting to update the webhook. This output is structured as JSON data representing the updated webhook object, including its current properties and status.

No binary data output is produced by this node.

Dependencies

  • Requires access to a Gitea instance with API enabled.
  • Needs an API authentication token credential configured in n8n to authorize requests.
  • The base URL for the Gitea API must be provided in the credentials.
  • The node uses the Gitea REST API v1 endpoint /api/v1 to perform the update operation.

Troubleshooting

  • Invalid ID error: If the webhook ID does not exist or is incorrect, the API will return an error. Verify the ID before running the node.
  • Authentication failures: Ensure the API key or token has sufficient permissions to edit webhooks.
  • Malformed JSON in Config or Events: Since these fields expect JSON input, invalid JSON syntax will cause parsing errors. Validate JSON format before submitting.
  • Branch filter not working: Confirm the branch filter pattern matches the repository branches correctly.
  • API connectivity issues: Check network access to the Gitea server and correct base URL configuration.

Links and References

Discussion