AnonFiles

API Documentation

Want to upload straight to your account using our API? Please login for account API keys and more information on how to upload files to your account using our API.


Upload File

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

Request JSON

curl -F "[email protected]" "https://api.anonfiles.ch/upload?key={YOUR_API_KEY}"

Request Pretty JSON

curl -F "[email protected]" "https://api.anonfiles.ch/upload?key={YOUR_API_KEY}&pretty"

Success Response

{
	"status": true,
	"data": {
		"file": {
			"url": {
				"full": "https://anonfiles.ch/nCzLKH5hQQL/test_txt",
				"short": "https://anonfiles.ch/s/nCzLKH5hQQL"
			},
			"metadata": {
				"id": "nCzLKH5hQQL",
				"name": "test.txt",
				"s_name": "test_txt",
				"size": {
					"bytes": 9,
					"readable": "9 B"
				},
				"type": "text/plain",
				"extension": ".txt",
				"created": "2025-04-07 10:13:07",
				"timestamp": 1744020787
			}
		}
	}
}

Error Codes


File Info

Get file information using the file ID.

Endpoint

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

Example Request

https://api.anonfiles.ch/v3/file/nCzLKH5hQQL/info

Success Response

{
	"status": true,
	"data": {
		"file": {
			"url": {
				"full": "https://anonfiles.ch/nCzLKH5hQQL/test_txt",
				"short": "https://anonfiles.ch/s/nCzLKH5hQQL"
			},
			"metadata": {
				"id": "nCzLKH5hQQL",
				"name": "test.txt",
				"s_name": "test_txt",
				"size": {
					"bytes": 9,
					"readable": "9 B"
				},
				"type": "text/plain",
				"extension": ".txt",
				"created": "2025-04-07 10:13:07",
				"timestamp": 1744020787
			}
		}
	}
}

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
		}
	}
}