Replace File Content
curl --request PUT \
--url https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/files/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'const form = new FormData();
form.append('file', '<string>');
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/files/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/files/{id}"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, files=files, headers=headers)
print(response.text){
"name": "<string>",
"url": "<string>",
"mimetype": "<string>",
"size": 123,
"workspaceId": "<string>",
"path": "<string>",
"id": "<string>",
"expiresAt": "<string>",
"expiresAfter": 123,
"metadata": {},
"public": true,
"shareToken": "<string>",
"orgSlug": "<string>"
}{
"error": "BadParameters",
"message": "<string>",
"details": "<unknown>"
}{
"error": "AuthenticationError",
"message": "Unauthenticated"
}{
"error": "ForbiddenError",
"message": "Forbidden"
}{
"error": "ObjectNotFound",
"message": "<string>"
}Prisme.ai Workspaces
Replace File Content
Replace the content of an existing file. The file must belong to the specified workspace.
PUT
/
v2
/
workspaces
/
{workspaceId}
/
files
/
{id}
Replace File Content
curl --request PUT \
--url https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/files/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file='@example-file'const form = new FormData();
form.append('file', '<string>');
const options = {method: 'PUT', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/files/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.studio.prisme.ai/v2/workspaces/{workspaceId}/files/{id}"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {"Authorization": "Bearer <token>"}
response = requests.put(url, files=files, headers=headers)
print(response.text){
"name": "<string>",
"url": "<string>",
"mimetype": "<string>",
"size": 123,
"workspaceId": "<string>",
"path": "<string>",
"id": "<string>",
"expiresAt": "<string>",
"expiresAfter": 123,
"metadata": {},
"public": true,
"shareToken": "<string>",
"orgSlug": "<string>"
}{
"error": "BadParameters",
"message": "<string>",
"details": "<unknown>"
}{
"error": "AuthenticationError",
"message": "Unauthenticated"
}{
"error": "ForbiddenError",
"message": "Forbidden"
}{
"error": "ObjectNotFound",
"message": "<string>"
}Authorizations
BearerAuthOrgApiKeyAuthBearerAuth & OrgApiKeyAuth
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
multipart/form-data
The new file content to replace the existing one
Response
Success Response
Number of seconds after which the file will be automatically removed. This is currently a best effort expiration as it will be deleted only upon the next restart after expiration date.
Reflects whether the file has public-read ACL at storage provider. True by default
A share token to append as a ?token query parameter to grant read access with given url
Organization slug set at creation time
Was this page helpful?