Amazon CodeCommit Codecommit File API
The Codecommit File API from Amazon CodeCommit — 3 operation(s) for codecommit file.
The Codecommit File API from Amazon CodeCommit — 3 operation(s) for codecommit file.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/amazon-codecommit:amazon-codecommit-file-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.1.0
info:
title: AWS CodeCommit File API
version: '2015-04-13'
description: Generated from AWS's published Smithy model for AWS CodeCommit. 3 operation(s).
contact:
name: Amazon Web Services
url: https://aws.amazon.com/contact-us/
license:
name: Apache 2.0
identifier: Apache-2.0
url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://codecommit.{region}.amazonaws.com
variables:
region:
default: us-east-1
security:
- sigv4: []
paths:
/#DeleteFile:
post:
operationId: DeleteFile
summary: Delete File
description: Deletes a specified file from a specified branch. A commit is created on the branch that contains the revision.
The file still exists in the commits earlier to the commit that contains the deletion.
responses:
'200':
description: Success
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/DeleteFileOutput'
'400':
description: BranchDoesNotExistException; BranchNameIsTagNameException; BranchNameRequiredException; CommitMessageLengthExceededException;
EncryptionKeyAccessDeniedException; EncryptionKeyDisabledException; EncryptionKeyNotFoundException; EncryptionKeyUnavailableException;
FileDoesNotExistException; InvalidBranchNameException; InvalidEmailException; InvalidParentCommitIdException;
InvalidPathException; InvalidRepositoryNameException; NameLengthExceededException; ParentCommitDoesNotExistException;
ParentCommitIdOutdatedException; ParentCommitIdRequiredException; PathRequiredException; RepositoryDoesNotExistException;
RepositoryNameRequiredException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/BranchDoesNotExistException'
'500':
description: EncryptionIntegrityChecksFailedException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/EncryptionIntegrityChecksFailedException'
parameters:
- name: X-Amz-Target
in: header
required: true
schema:
type: string
enum:
- CodeCommit_20150413.DeleteFile
requestBody:
required: true
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/DeleteFileInput'
tags:
- File
/#GetFile:
post:
operationId: GetFile
summary: Get File
description: Returns the base-64 encoded contents of a specified file and its metadata.
responses:
'200':
description: Success
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/GetFileOutput'
'400':
description: CommitDoesNotExistException; EncryptionKeyAccessDeniedException; EncryptionKeyDisabledException; EncryptionKeyNotFoundException;
EncryptionKeyUnavailableException; FileDoesNotExistException; FileTooLargeException; InvalidCommitException; InvalidPathException;
InvalidRepositoryNameException; PathRequiredException; RepositoryDoesNotExistException; RepositoryNameRequiredException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/CommitDoesNotExistException'
'500':
description: EncryptionIntegrityChecksFailedException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/EncryptionIntegrityChecksFailedException'
parameters:
- name: X-Amz-Target
in: header
required: true
schema:
type: string
enum:
- CodeCommit_20150413.GetFile
requestBody:
required: true
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/GetFileInput'
tags:
- File
/#PutFile:
post:
operationId: PutFile
summary: Put File
description: Adds or updates a file in a branch in an CodeCommit repository, and generates a commit for the addition
in the specified branch.
responses:
'200':
description: Success
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/PutFileOutput'
'400':
description: BranchDoesNotExistException; BranchNameIsTagNameException; BranchNameRequiredException; CommitMessageLengthExceededException;
DirectoryNameConflictsWithFileNameException; EncryptionKeyAccessDeniedException; EncryptionKeyDisabledException;
EncryptionKeyNotFoundException; EncryptionKeyUnavailableException; FileContentRequiredException; FileContentSizeLimitExceededException;
FileNameConflictsWithDirectoryNameException; FilePathConflictsWithSubmodulePathException; FolderContentSizeLimitExceededException;
InvalidBranchNameException; InvalidDeletionParameterException; InvalidEmailException; InvalidFileModeException;
InvalidParentCommitIdException; InvalidPathException; InvalidRepositoryNameException; NameLengthExceededException;
ParentCommitDoesNotExistException; ParentCommitIdOutdatedException; ParentCommitIdRequiredException; PathRequiredException;
RepositoryDoesNotExistException; RepositoryNameRequiredException; SameFileContentException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/BranchDoesNotExistException'
'500':
description: EncryptionIntegrityChecksFailedException
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/EncryptionIntegrityChecksFailedException'
parameters:
- name: X-Amz-Target
in: header
required: true
schema:
type: string
enum:
- CodeCommit_20150413.PutFile
requestBody:
required: true
content:
application/x-amz-json-1.1:
schema:
$ref: '#/components/schemas/PutFileInput'
tags:
- File
components:
securitySchemes:
sigv4:
type: apiKey
in: header
name: Authorization
description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
x-aws-sigv4:
signingName: codecommit
schemas:
BranchDoesNotExistException:
type: object
properties:
message:
type: string
description: Any message associated with the exception.
CommitDoesNotExistException:
type: object
properties:
message:
type: string
description: Any message associated with the exception.
DeleteFileInput:
type: object
properties:
repositoryName:
type: string
description: The name of the repository that contains the file to delete.
branchName:
type: string
description: The name of the branch where the commit that deletes the file is made.
filePath:
type: string
description: The fully qualified path to the file that to be deleted, including the full name and extension of that
file. For example, /examples/file.md is a fully qualified path to a file named file.md in a folder named examples.
parentCommitId:
type: string
description: The ID of the commit that is the tip of the branch where you want to create the commit that deletes
the file. This must be the HEAD commit for the branch. The commit that deletes the file is created from this commit
ID.
keepEmptyFolders:
type: boolean
description: If a file is the only object in the folder or directory, specifies whether to delete the folder or
directory that contains the file. By default, empty folders are deleted. This includes empty folders that are
part of the directory structure. For example, if the path to a file is dir1/dir2/dir3/dir4, and dir2 and dir3
are empty, deleting the last file in dir4 also deletes the empty folders dir4, dir3, and dir2.
commitMessage:
type: string
description: The commit message you want to include as part of deleting the file. Commit messages are limited to
256 KB. If no message is specified, a default message is used.
name:
type: string
description: The name of the author of the commit that deletes the file. If no name is specified, the user's ARN
is used as the author name and committer name.
email:
type: string
description: The email address for the commit that deletes the file. If no email address is specified, the email
address is left blank.
required:
- repositoryName
- branchName
- filePath
- parentCommitId
DeleteFileOutput:
type: object
properties:
commitId:
type: string
description: The full commit ID of the commit that contains the change that deletes the file.
blobId:
type: string
description: The blob ID removed from the tree as part of deleting the file.
treeId:
type: string
description: The full SHA-1 pointer of the tree information for the commit that contains the delete file change.
filePath:
type: string
description: The fully qualified path to the file to be deleted, including the full name and extension of that file.
required:
- commitId
- blobId
- treeId
- filePath
EncryptionIntegrityChecksFailedException:
type: object
properties:
message:
type: string
description: Any message associated with the exception.
GetFileInput:
type: object
properties:
repositoryName:
type: string
description: The name of the repository that contains the file.
commitSpecifier:
type: string
description: The fully quaified reference that identifies the commit that contains the file. For example, you can
specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/main. If none is provided, the
head commit is used.
filePath:
type: string
description: The fully qualified path to the file, including the full name and extension of the file. For example,
/examples/file.md is the fully qualified path to a file named file.md in a folder named examples.
required:
- repositoryName
- filePath
GetFileOutput:
type: object
properties:
commitId:
type: string
description: The full commit ID of the commit that contains the content returned by GetFile.
blobId:
type: string
description: The blob ID of the object that represents the file content.
filePath:
type: string
description: The fully qualified path to the specified file. Returns the name and extension of the file.
fileMode:
type: string
enum:
- EXECUTABLE
- NORMAL
- SYMLINK
description: The extrapolated file mode permissions of the blob. Valid values include strings such as EXECUTABLE
and not numeric values. The file mode permissions returned by this API are not the standard file mode permission
values, such as 100644, but rather extrapolated values. See the supported return values.
fileSize:
type: integer
description: The size of the contents of the file, in bytes.
fileContent:
type: string
format: byte
description: The base-64 encoded binary data object that represents the content of the file.
required:
- commitId
- blobId
- filePath
- fileMode
- fileSize
- fileContent
PutFileInput:
type: object
properties:
repositoryName:
type: string
description: The name of the repository where you want to add or update the file.
branchName:
type: string
description: The name of the branch where you want to add or update the file. If this is an empty repository, this
branch is created.
fileContent:
type: string
format: byte
description: The content of the file, in binary object format.
filePath:
type: string
description: The name of the file you want to add or update, including the relative path to the file in the repository.
If the path does not currently exist in the repository, the path is created as part of adding the file.
fileMode:
type: string
enum:
- EXECUTABLE
- NORMAL
- SYMLINK
description: The file mode permissions of the blob. Valid file mode permissions are listed here.
parentCommitId:
type: string
description: The full commit ID of the head commit in the branch where you want to add or update the file. If this
is an empty repository, no commit ID is required. If this is not an empty repository, a commit ID is required.
The commit ID must match the ID of the head commit at the time of the operation. Otherwise, an error occurs, and
the file is not added or updated.
commitMessage:
type: string
description: A message about why this file was added or updated. Although it is optional, a message makes the commit
history for your repository more useful.
name:
type: string
description: The name of the person adding or updating the file. Although it is optional, a name makes the commit
history for your repository more useful.
email:
type: string
description: An email address for the person adding or updating the file.
required:
- repositoryName
- branchName
- fileContent
- filePath
PutFileOutput:
type: object
properties:
commitId:
type: string
description: The full SHA ID of the commit that contains this file change.
blobId:
type: string
description: The ID of the blob, which is its SHA-1 pointer.
treeId:
type: string
description: The full SHA-1 pointer of the tree information for the commit that contains this file change.
required:
- commitId
- blobId
- treeId
x-provenance:
method: harvested
publisher: Amazon Web Services
source: https://raw.githubusercontent.com/aws/api-models-aws/582e55931c45b944739742a2c1620b6026dd2d13/models/codecommit/service/2015-04-13/codecommit-2015-04-13.json
note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)