Replace a string in a file
curl --request POST \
--url https://api.arg.ai/api/workspaces/{workspaceId}/tools/edit-file \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"old_string": "<string>",
"new_string": "<string>"
}
'import requests
url = "https://api.arg.ai/api/workspaces/{workspaceId}/tools/edit-file"
payload = {
"path": "<string>",
"old_string": "<string>",
"new_string": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({path: '<string>', old_string: '<string>', new_string: '<string>'})
};
fetch('https://api.arg.ai/api/workspaces/{workspaceId}/tools/edit-file', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"detail": "<string>"
}Agent Tools
Replace a string in a file
POST
/
api
/
workspaces
/
{workspaceId}
/
tools
/
edit-file
Replace a string in a file
curl --request POST \
--url https://api.arg.ai/api/workspaces/{workspaceId}/tools/edit-file \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"path": "<string>",
"old_string": "<string>",
"new_string": "<string>"
}
'import requests
url = "https://api.arg.ai/api/workspaces/{workspaceId}/tools/edit-file"
payload = {
"path": "<string>",
"old_string": "<string>",
"new_string": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({path: '<string>', old_string: '<string>', new_string: '<string>'})
};
fetch('https://api.arg.ai/api/workspaces/{workspaceId}/tools/edit-file', 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
Body
application/json
Response
Successful response
The response is of type object.