# Trigger Action with an API call

**URL:** <https://forum.gitea.com/t/trigger-action-with-an-api-call/10427>\
**Category:** Actions\
**Created:** [January 14, 2025, 10:28pm UTC](https://forum.gitea.com/t/trigger-action-with-an-api-call/10427 "2025-01-14T22:28:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ghnp5](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@ghnp5](https://forum.gitea.com/u/ghnp5)\
**Post date:** [January 14, 2025, 10:28pm UTC](https://forum.gitea.com/t/trigger-action-with-an-api-call/10427/1 "2025-01-14T22:28:34Z")

</div>

The API docs are currently not working (I get a 404), but I’d like to know if is it possible to trigger an Action/Workflow without having to login to Gitea manually.

For example, some cronjob to make a POST call to Gitea, to invoke Action XYZ in repository ABC.

Is this possible?

Thanks!

---

<div class="post-metadata">

**Author:** ![jorgen-k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jorgen-k/32/6576_2.png) [@jorgen-k](https://forum.gitea.com/u/jorgen-k)\
**Post date:** [January 15, 2025, 10:54am UTC](https://forum.gitea.com/t/trigger-action-with-an-api-call/10427/2 "2025-01-15T10:54:03Z")

</div>

I am also looking for such a feature. There is a workaround mentioned here: [Actions - Manually trigger a workflow/action · Issue #23668 · go-gitea/gitea · GitHub](https://github.com/go-gitea/gitea/issues/23668)

---

<div class="post-metadata">

**Author:** ![ghnp5](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@ghnp5](https://forum.gitea.com/u/ghnp5)\
**Post date:** [January 15, 2025, 4:21pm UTC](https://forum.gitea.com/t/trigger-action-with-an-api-call/10427/3 "2025-01-15T16:21:57Z")

</div>

Thanks. Do you mean the “comment on issue” workaround?  
Yeah, I’d like something more direct, and that doesn’t write unnecessary “junk” in the database 🙂  
But that’s definitely something that can be considered. Thank you.

---

<div class="post-metadata">

**Author:** ![jorgen-k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/jorgen-k/32/6576_2.png) [@jorgen-k](https://forum.gitea.com/u/jorgen-k)\
**Post date:** [January 17, 2025, 4:34pm UTC](https://forum.gitea.com/t/trigger-action-with-an-api-call/10427/4 "2025-01-17T16:34:47Z")

</div>

I created a release trigger, works like a charm. But it depends on your need.

---

<div class="post-metadata">

**Author:** ![ghnp5](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@ghnp5](https://forum.gitea.com/u/ghnp5)\
**Post date:** [January 17, 2025, 4:48pm UTC](https://forum.gitea.com/t/trigger-action-with-an-api-call/10427/5 "2025-01-17T16:48:41Z")

</div>

Hey - what do you mean with “release trigger”? Maybe it can work for me, but I don’t understand what you mean with that 🙂 thanks!

---

<div class="post-metadata">

**Author:** ![Angelfish6898](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@Angelfish6898](https://forum.gitea.com/u/Angelfish6898)\
**Post date:** [February 9, 2025, 4:39pm UTC](https://forum.gitea.com/t/trigger-action-with-an-api-call/10427/6 "2025-02-09T16:39:53Z")

</div>

The latest version of gitea (currently 1.23.1) supports the trigger: `workflow_dispatch`. Unfortunately I haven’t seen any api support for it yet either.

But if you’re thinking about triggering the workflow from a cron job, then maybe you could use the `schedule` trigger?

```yaml
name: My test workflow
on:
  workflow_dispatch:
  schedule:
    - cron: "@daily"
[...]

```

/B 🙂

---

<div class="post-metadata">

**Author:** ![ghnp5](https://avatars.discourse-cdn.com/v4/letter/g/f9ae1b/32.png) [@ghnp5](https://forum.gitea.com/u/ghnp5)\
**Post date:** [February 9, 2025, 5:12pm UTC](https://forum.gitea.com/t/trigger-action-with-an-api-call/10427/7 "2025-02-09T17:12:50Z")

</div>

Thank you for the suggestion.  
Yeah, I already use `schedule` and `workflow_dispatch`, for other Actions.

But for this one, I want a way to trigger on demand, programmatically, that’s not necessarily on a fixed schedule.
