How to fetch only specific data from /merge_requests api endpoint?

The GitLab list merge requests API endpoint shows a lot of data that is returned for each MR. I do not need all this data in the response. For each MR, I only need the MR iid and the MR description field.

Is there any way to specify in the API that I only need these two fields in the response and no other field?

There is no option to tell which fields you need. You can use view=simple to reduce the number of fields if you are fetching all MRs. Otherwise you need to process/filter the response yourself.

Alternatively, you can use GraphQL instead.

1 Like