GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → postApiV4ProjectsIdRepositoryFilesFilePath

AI-generated

Summary

Create a new file in a GitLab project's repository at a specified file path by sending a POST request to the GitLab API endpoint for repository files.

Inputs

  • id (required) — The project ID or URL-encoded path (e.g., 'gitlab-org/gitlab') identifying the GitLab project where the file will be created.
  • file_path (required) — The URL-encoded path of the file within the repository to create (e.g., 'lib%2Fclass%2Erb').
  • postApiV4ProjectsIdRepositoryFilesFilePath (required) — The request body containing the file creation parameters according to the GitLab API specification for creating repository files. This includes file content, branch, commit message, and other relevant properties.

Output shape

a single JSON object representing the API response to the file creation request

The response structure conforms to GitLab's API specification for repository file creation. No pagination applies. Errors will provide appropriate HTTP status codes and messages within the response.

Links

Discussion