Cannot trigger pipeline by api

Hi!

I am new at circleci and I am trying to run cypress testing from a gitlab repository.

I have created the project, the personal api token and iam trying to run the following:

curl --location --request POST 'https://circleci.com/api/v2/project/circleci/QNXJ3nyzoTQ2zESAUe2BuK/F52t7CH2t9uHH9UBjEnCCG/pipeline' \
--header 'Circle-Token: PERSONAL_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
    "branch":"run_ci"
}'

buy I keep getting

{
    "message": "An internal server error occurred."
}

But if I run get to project info api (GET https://circleci.com/api/v2/project/circleci/QNXJ3nyzoTQ2zESAUe2BuK/F52t7CH2t9uHH9UBjEnCCG) it works, so the problem is with /pipeline endpoint.

If I do a commit in the repo the trigger works as expected, the problem is only with the api.

Hope someone can help me, Thanks!

Hello

The reason that this is happening is that currently when using the Gitlab integration with CircleCI we do not have support for POST API requests.

As you have found you will see an error when trying to do this.

GET requests will work and it is only POST requests which will fail.

Sorry for any inconvenience this has caused you.

There are plans to support this in the future going forwards.

Kind Regards
Owen Oliver

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.