File Endpoints
GET /files
Fetch all files stored on Cumulonimbus.
Non-Public Endpoint
This endpoint is not public and requires authentication of a user with staff
permissions.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the STAFF_READ_FILES
scope.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
limit | number | query | No | The maximum number of files to return. The default and maximum value is 50 |
offset | number | query | No | The offset to start from when returning files. The default value is 0 |
Example Requests
curl -X GET \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
"https://alekeagle.me/api/files?limit=5&offset=0"
fetch('https://alekeagle.me/api/files?limit=5&offset=0', {
method: 'GET',
headers: {
Authorization:
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
},
});
Responses
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
GET /files?uid=:id
Fetch files owned by the specified user.
Non-Public Endpoint
This endpoint is not public and requires authentication of a user with staff
permissions.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the STAFF_READ_FILES
scope.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
limit | number | query | No | The maximum number of files to return. The default and maximum value is 50 |
offset | number | query | No | The offset to start from when returning files. The default value is 0 |
uid | string | query | Yes | The User's ID. |
Example Requests
curl -X GET \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
"https://alekeagle.me/api/files?limit=5&offset=0&uid=1234567890123"
fetch('https://alekeagle.me/api/files?limit=5&offset=0&uid=1234567890123', {
method: 'GET',
headers: {
Authorization:
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
},
});
Responses
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
GET /files?uid=me
Fetch files owned by the authenticated user.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_READ
scope.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
limit | number | query | No | The maximum number of files to return. The default and maximum value is 50 |
offset | number | query | No | The offset to start from when returning files. The default value is 0 |
uid | string | query | Yes | Must be the string me . |
Example Requests
curl -X GET \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
"https://alekeagle.me/api/files?limit=5&offset=0&uid=me"
fetch('https://alekeagle.me/api/files?limit=5&offset=0&uid=me', {
method: 'GET',
headers: {
Authorization:
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
},
});
Responses
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
GET /files/:id
Get a file by its ID. Attempting to fetch a file owned by another user without staff
permissions or scoped sessions without the proper scopes will return a 404 error regardless of whether the file exists. This is to prevent scraping via the API.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_READ
(STAFF_READ_FILES
for staff) scope.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
id | string | path | Yes | The file ID |
Example Requests
curl -X GET \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
"https://alekeagle.me/api/files/abcdefghij.png"
fetch('https://alekeagle.me/api/files/abcdefghij.png', {
method: 'GET',
headers: {
Authorization:
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
},
});
Responses
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
PUT /files/:id/name
Update a file's display name. Attempting to modify a file owned by another user without staff
permissions or scoped sessions without the proper scopes will return a 404 error regardless of whether the file exists. This is to prevent scraping via the API.
Kill Switch Behavior
This endpoint is affected by the following kill switches:
FILE_MODIFY(6)
and will fail with the error ServiceUnavailable if any of these kill switches are enabled.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_MODIFY
(STAFF_MODIFY_FILES
for staff) scope.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
id | string | path | Yes | The file ID |
name | string | body | Yes | The new display name |
Example Requests
curl -X PUT \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-H "Content-Type: application/json" \
-d '{"name": "My File"}' \
"https://alekeagle.me/api/files/abcdefghij.png/name"
fetch('https://alekeagle.me/api/files/abcdefghij.png/name', {
method: 'PUT',
headers: {
'Authorization':
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'My File',
}),
});
Responses
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
DELETE /files/:id/name
Delete a file's display name. Attempting to modify a file owned by another user without staff
permissions or scoped sessions without the proper scopes will return a 404 error regardless of whether the file exists. This is to prevent scraping via the API.
Kill Switch Behavior
This endpoint is affected by the following kill switches:
FILE_MODIFY(6)
and will fail with the error ServiceUnavailable if any of these kill switches are enabled.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_MODIFY
(STAFF_MODIFY_FILES
for staff) scope.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
id | string | path | Yes | The file ID |
Example Requests
```sh [cURL]
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
"https://alekeagle.me/api/files/abcdefghij.png/name"
fetch('https://alekeagle.me/api/files/abcdefghij.png/name', {
method: 'DELETE',
headers: {
Authorization:
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
},
});
Responses
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
PUT /files/:id/extension
Update a file's extension. Attempting to modify a file owned by another user without staff
permissions or scoped sessions without the proper scopes will return a 404 error regardless of whether the file exists. This is to prevent scraping via the API.
Kill Switch Behavior
This endpoint is affected by the following kill switches:
FILE_MODIFY(6)
and will fail with the error ServiceUnavailable if any of these kill switches are enabled.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_MODIFY
(STAFF_MODIFY_FILES
for staff) scope.
Warning
Since the file extension is part of the file's ID, changing the extension will change the file's ID. This means that any links to the file will no longer work.
Note
When a file's extension is changed, it is logged to the server's logs, that way staff can use this information to help improve the file type detection.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
id | string | path | Yes | The file ID |
extension | string | body | Yes | The new file extension |
Example Requests
curl -X PUT \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-H "Content-Type: application/json" \
-d '{"extension": "png"}' \
"https://alekeagle.me/api/files/abcdefghij.png/extension"
fetch('https://alekeagle.me/api/files/abcdefghij.png/extension', {
method: 'PUT',
headers: {
'Authorization':
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
'Content-Type': 'application/json',
},
body: JSON.stringify({
extension: 'png',
}),
});
Responses
- 200 OK
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
DELETE /files/:id
Delete a file. Attempting to delete a file owned by another user without staff
permissions or scoped sessions without the proper scopes will return a 404 error regardless of whether the file exists. This is to prevent scraping via the API.
Kill Switch Behavior
This endpoint is affected by the following kill switches:
FILE_DELETE(7)
and will fail with the error ServiceUnavailable if any of these kill switches are enabled.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_MODIFY
(STAFF_MODIFY_FILES
for staff) scope.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
id | string | path | Yes | The file ID |
Example Requests
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
"https://alekeagle.me/api/files/abcdefghij.png"
fetch('https://alekeagle.me/api/files/abcdefghij.png', {
method: 'DELETE',
headers: {
Authorization:
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
},
});
Responses
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
DELETE /files
Delete multiple files. Attempting to delete files owned by another user without staff
permissions will have them removed from the list of files to be deleted. Scoped sessions missing the required scope will receive 403 forbidden.
Kill Switch Behavior
This endpoint is affected by the following kill switches:
FILE_DELETE(7)
and will fail with the error ServiceUnavailable if any of these kill switches are enabled.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_MODIFY
(STAFF_MODIFY_FILES
for staff) scope.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
ids | string | body | Yes | The file IDs |
Example Requests
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-H "Content-Type: application/json" \
-d '{"ids":["abcdefghij.png","klmnopqrst.png"]}' \
"https://alekeagle.me/api/files"
fetch('https://alekeagle.me/api/files', {
method: 'DELETE',
headers: {
'Authorization':
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
'Content-Type': 'application/json',
},
body: JSON.stringify({
ids: ['abcdefghij.png', 'klmnopqrst.png'],
}),
});
Responses
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
DELETE /files/all
Deletes all files owned by the authenticated user.
Kill Switch Behavior
This endpoint is affected by the following kill switches:
FILE_DELETE(7)
and will fail with the error ServiceUnavailable if any of these kill switches are enabled.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_MODIFY
(STAFF_MODIFY_FILES
for staff) scope.
Identity Reverification
This endpoint will require you to provide your password to confirm it's you. More information can found in the Identity Reverification section.
Parameters
There are no parameters for this endpoint.
Example Requests
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-H "Content-Type: application/json" \
"https://alekeagle.me/api/files/all"
fetch('https://alekeagle.me/api/files/all', {
method: 'DELETE',
headers: {
'Authorization':
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
Responses
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
DELETE /files/all?uid=me
Equivalent to DELETE /files/all
DELETE /files/all?uid=:id
Deletes all files owned by the user specified.
Non-Public Endpoint
This endpoint is not public and requires authentication of a user with staff
permissions.
Kill Switch Behavior
This endpoint is affected by the following kill switches:
FILE_DELETE(7)
and will fail with the error ServiceUnavailable if any of these kill switches are enabled.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the FILE_MODIFY
(STAFF_MODIFY_FILES
for staff) scope.
Identity Reverification
This endpoint will require you to provide your password to confirm it's you. More information can found in the Identity Reverification section.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
uid | string | query | Yes | The User's ID. |
Example Requests
curl -X DELETE \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-H "Content-Type: application/json" \
-d '{"password":"password"}' \
"https://alekeagle.me/api/files/all?uid=me"
fetch('https://alekeagle.me/api/files/all?uid=me', {
method: 'DELETE',
headers: {
'Authorization':
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
'Content-Type': 'application/json',
},
body: JSON.stringify({
password: 'password',
}),
});
Responses
- 200 OK
- 401 Unauthorized
- 403 Forbidden
- 404 Not Found
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable
POST /upload
Uploads a file to the server.
Kill Switch Behavior
This endpoint is affected by the following kill switches:
FILE_CREATE(5)
and will fail with the error ServiceUnavailable if any of these kill switches are enabled.
Scoped Session
Requests to this endpoint using a scoped session require the session to have the UPLOAD_FILE
scope.
Email Verification Requirement
A verified email is required to upload files.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
file | file | body | Yes | The file |
Request Content-Type
To upload a file, you must use the multipart/form-data
content type.
Example Requests
curl -X POST \
-H "Authorization: eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q" \
-F "file=@/path/to/file.png" \
"https://alekeagle.me/api/upload"
const formData = new FormData();
formData.append('file', file);
fetch('https://alekeagle.me/api/upload', {
method: 'POST',
headers: {
Authorization:
'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiVGhlIGV4YW1wbGUgdG9rZW4gZm9yIGRvY3MuYWxla2VhZ2xlLm1lIiwic3ViIjoiMTY0NzAxNTAyODYyNiIsImlhdCI6MTY4NzA2NzYxNCwiZXhwIjoyMDAyNjQzNjE0fQ.qAwhjhtGT56iAI52EsdVYcaTjmLPeR51TALkJ1CwRlfyDHwrsOTzAe8Y3za_tJqkvSaohwQq4cD7lZbTzMSw8Q',
},
body: formData,
});
Responses
- 201 Created
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
- 413 Payload Too Large
- 429 Too Many Requests
- 500 Internal Server Error
- 503 Service Unavailable