Not able to run workflow with workflow_dispatch event with API call

I have not got one successful api call, not even with curl, not sure why! Tried like 20-30 times with different variants, etc. Getting the same 404 error each time.

> http POST "Authorization:token ***" "Accept: application/vnd.github.v3+json" "ref=refs/heads/main"

HTTP/1.1 404 Not Found
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset
Content-Encoding: gzip
Content-Security-Policy: default-src 'none'
Content-Type: application/json; charset=utf-8
Date: Wed, 07 Apr 2021 17:38:45 GMT
Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
Transfer-Encoding: chunked
Vary: Accept-Encoding, Accept, X-Requested-With
X-Content-Type-Options: nosniff
X-Frame-Options: deny
X-GitHub-Media-Type: github.v3; format=json
X-GitHub-Request-Id: F38D:3DA2:1F302A:22FE5F:606DEE25
X-OAuth-Scopes: repo, write:packages
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4991
X-RateLimit-Reset: 1617819673
X-RateLimit-Used: 9
X-XSS-Protection: 0

    "documentation_url": "",
    "message": "Not Found"

import { Octokit } from '@octokit/rest'

(async () => {
	const octokit = new Octokit({ auth: "***" })
	const owner = 'owner'
	const repo = 'repo'
	const workflow_id = 7589211
	const ref = 'main'
	await octokit.actions.createWorkflowDispatch({


HttpError: Not Found
    at .../.github/workflows/node_modules/@octokit/request/dist-src/fetch-wrapper.js:49:31
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
error Command failed with exit code 1.