AnonFiles

API Documentation

Upload files directly to your account using our API

POST

Upload File

Send files with POST and receive a JSON response with the file URL.

Request JSON

curl -F "file=@test.txt" "https://api.anonfiles.sbs/upload?key={API_KEY}"

Request Pretty JSON

curl -F "file=@test.txt" "https://api.anonfiles.sbs/upload?key={API_KEY}&pretty"

Success Response

{
	"status": true,
	"data": {
		"file": {
			"url": {
				"full": "https://anonfiles.sbs/6rGoekB_bK2/test_txt",
				"short": "https://anonfiles.sbs/s/6rGoekB_bK2"
			}
		},
		"metadata": {
			"id": "6rGoekB_bK2",
			"name": "test.txt",
			"s_name": "test_txt",
			"size": {
				"bytes": "9",
				"readable": "9 B"
			},
			"type": "text/plain",
			"extension": ".txt"
		}
	}
}

Error Codes

(10) ERROR_FILE_NOT_PROVIDED
(11) ERROR_FILE_EMPTY
(12) ERROR_FILE_INVALID
(13) ERROR_INVALID_KEY
(14) ERROR_INVALID_REQUEST
(15) ERROR_EMPTY_KEY
(20) ERROR_USER_MAX_FILES_PER_HOUR_REACHED
(21) ERROR_USER_MAX_FILES_PER_DAY_REACHED
(22) ERROR_USER_MAX_BYTES_PER_HOUR_REACHED
(23) ERROR_USER_MAX_BYTES_PER_DAY_REACHED
(30) ERROR_FILE_DISALLOWED_TYPE
(31) ERROR_FILE_SIZE_EXCEEDED
(32) ERROR_FILE_BANNED
(33) ERROR_FILE_NOT_FOUND
(40) STATUS_ERROR_SYSTEM_FAILURE
GET

File Info

Retrieve information about a file using its ID.

Endpoint

https://api.anonfiles.sbs/v3/file/{FILE_ID}/info

Example Request

https://api.anonfiles.sbs/v3/file/6rGoekB_bK2/info

Success Response

{
	"status": true,
	"data": {
		"file": {
			"url": {
				"full": "https://anonfiles.sbs/6rGoekB_bK2/test_txt",
				"short": "https://anonfiles.sbs/s/6rGoekB_bK2"
			},
			"metadata": {
				"id": "6rGoekB_bK2",
				"name": "test.txt",
				"s_name": "test_txt",
				"size": {
					"bytes": 9,
					"readable": "9 B"
				},
				"type": "text/plain",
				"extension": ".txt",
				"created": "2024-11-06 18:58:01",
				"timestamp": 1730919481
			}
		}
	}
}

Error Response

{
	"status": false,
	"data": {
		"file": {
			"message": "The file you are looking for does not exist",
			"type": "ERROR_FILE_NOT_FOUND",
			"code": 33
		},
		"relay": {
			"tlbId": "875655a3-1f56-47fe-9b9d-3945552db99e",
			"timestamp": 1722966957189
		}
	}
}