Create a file in a repository
POST
/repos/{owner}/{repo}/contents/{filepath}
repository
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/v1/repos///contents/' \
--header 'Content-Type: application/json' \
--data-raw '{
"author": {
"email": "user@example.com",
"name": "string"
},
"branch": "string",
"committer": {
"email": "user@example.com",
"name": "string"
},
"content": "string",
"dates": {
"author": "2019-08-24T14:15:22Z",
"committer": "2019-08-24T14:15:22Z"
},
"message": "string",
"new_branch": "string",
"signoff": true
}'
Response Response Example
201 - Example 1
{
"commit": {
"author": {
"date": "string",
"email": "user@example.com",
"name": "string"
},
"committer": {
"date": "string",
"email": "user@example.com",
"name": "string"
},
"created": "2019-08-24T14:15:22Z",
"html_url": "string",
"message": "string",
"parents": [
{
"created": "2019-08-24T14:15:22Z",
"sha": "string",
"url": "string"
}
],
"sha": "string",
"tree": {
"created": "2019-08-24T14:15:22Z",
"sha": "string",
"url": "string"
},
"url": "string"
},
"content": {
"_links": {
"git": "string",
"html": "string",
"self": "string"
},
"content": "string",
"download_url": "string",
"encoding": "string",
"git_url": "string",
"html_url": "string",
"name": "string",
"path": "string",
"sha": "string",
"size": 0,
"submodule_git_url": "string",
"target": "string",
"type": "string",
"url": "string"
},
"verification": {
"payload": "string",
"reason": "string",
"signature": "string",
"signer": {
"email": "user@example.com",
"name": "string",
"username": "string"
},
"verified": true
}
}
Request
Path Params
owner
stringÂ
required
repo
stringÂ
required
filepath
stringÂ
required
Body Params application/json
Responses
Modified at 2022-09-10 23:12:52