Update a file's expiry
curl --request PATCH \
--url https://api.opper.ai/v3/files/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ttl_seconds": 123
}
'import requests
url = "https://api.opper.ai/v3/files/{id}"
payload = { "ttl_seconds": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ttl_seconds: 123})
};
fetch('https://api.opper.ai/v3/files/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"bytes": 123,
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"filename": "<string>",
"id": "<string>",
"mime_type": "<string>",
"object": "file",
"purpose": "<string>",
"status": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}Files
Set or clear a file's expiry
Set or clear a file’s expiry. ttl_seconds is the only mutable field: a positive integer schedules the file to expire that many seconds from now; an explicit null clears a previously set expiry (files are permanent by default).
PATCH
/
v3
/
files
/
{id}
Update a file's expiry
curl --request PATCH \
--url https://api.opper.ai/v3/files/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ttl_seconds": 123
}
'import requests
url = "https://api.opper.ai/v3/files/{id}"
payload = { "ttl_seconds": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ttl_seconds: 123})
};
fetch('https://api.opper.ai/v3/files/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"bytes": 123,
"created_at": "2023-11-07T05:31:56Z",
"expires_at": "2023-11-07T05:31:56Z",
"filename": "<string>",
"id": "<string>",
"mime_type": "<string>",
"object": "file",
"purpose": "<string>",
"status": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": "<unknown>"
},
"meta": {}
}See the Files guide.
Authorizations
API key authentication. Pass your API key as a Bearer token.
Path Parameters
File ID (file_…)
Body
application/json
Positive integer (max 3153600000