Write file content
curl --request PUT \
--url https://api.arg.ai/api/workspaces/{workspaceId}/files/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>"
}
'import requests
url = "https://api.arg.ai/api/workspaces/{workspaceId}/files/content"
payload = { "content": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>'})
};
fetch('https://api.arg.ai/api/workspaces/{workspaceId}/files/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"detail": "<string>"
}Files
Write file content
Write a file. Pass baseRevision for a compare-and-set write: a mismatch returns 409 with the current revision instead of overwriting someone else’s change.
PUT
/
api
/
workspaces
/
{workspaceId}
/
files
/
content
Write file content
curl --request PUT \
--url https://api.arg.ai/api/workspaces/{workspaceId}/files/content \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"content": "<string>"
}
'import requests
url = "https://api.arg.ai/api/workspaces/{workspaceId}/files/content"
payload = { "content": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>'})
};
fetch('https://api.arg.ai/api/workspaces/{workspaceId}/files/content', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"detail": "<string>"
}Authorizations
bearerAuthapiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
File path.
Set to false when you do not need the stable file ID.
Body
application/json
Response
Successful response
The response is of type object.