Unable to trigger a job to run in debug mode but can trigger restart with the same credentials

I’ve taken the token from my profile. I have push access to the repository. The repository is public. When I hit the endpoint for restart

  curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token ****" \
  https://api.travis-ci.org/job/{jobID}/restart

it starts the job but when I try to run the job in debug mode

  curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Travis-API-Version: 3" \
  -H "Authorization: token ****" \
  https://api.travis-ci.org/job/{jobID}/debug

it returns with

{
  "@type": "error",
  "error_type": "wrong_credentials",
  "error_message": "access denied"
}

Any help on this would be appreciated.

Is debug mode enabled for your project? For public repositories, it’s enabled manually by Travis staff on request.

I don’t know. How do I enable that? It is a public repository.