GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → putApiV4ProjectsIdRepositoryFilesFilePath

AI-generated

Summary

Update the content of a file in a specific project repository on GitLab by specifying the project ID, URL-encoded file path, and providing update details in the request body.

Inputs

  • id (required) — The project ID identifying the GitLab project where the file is located.
  • file_path (required) — The URL-encoded path to the file in the repository to update.
  • putApiV4ProjectsIdRepositoryFilesFilePath (required) — The request body containing parameters required to update the file, such as branch name, commit message, content, and encoding.
  • baseUrl — Optional custom base URL for the GitLab instance; defaults to https://gitlab.com.
  • skipAuthentication — Optional flag to skip authentication; defaults to false.

Output shape

a single JSON object representing the updated file's metadata as returned by the GitLab API.

The operation sends a PUT request to the endpoint /api/v4/projects/{id}/repository/files/{file_path} where 'id' and 'file_path' are path parameters. The request body must conform to the GitLab API schema for file updates. Authentication is required unless explicitly skipped. The response includes details about the updated file, useful for confirming the update.

Links

Discussion