curl --request PUT \
--url https://api.getcargo.io/v1/context/files/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"content": "<string>",
"commitMessage": "<string>",
"sha": "<string>"
}
'{
"sha": "<string>"
}Write or update the content of a file in the context repository.
curl --request PUT \
--url https://api.getcargo.io/v1/context/files/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"content": "<string>",
"commitMessage": "<string>",
"sha": "<string>"
}
'{
"sha": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Request body schema for writing a file to the repository.
Full path to the file to write in the repository.
The content to write to the file.
Optional commit message. Defaults to 'Update
SHA of the existing file to update. If omitted, the current SHA is fetched automatically.
Successful response
The SHA of the file after writing.
Was this page helpful?