POST a file to https://up.anon.cat/upload, by default you will get a json response.
If you want a response in something else than json you add a flag to specify what format you want, for example https://up.anon.cat/upload?output=csv.
Valid response types are: json, csv, text, html and gyazo.
One file per request, up to 1 GB.
curl -i -F files[]=@yourfile.jpeg https://up.anon.cat/upload
You can also send the file as the request body instead of a multipart form, passing the name in the query string. This is the better option for large files: the length is known up front, there is no multipart envelope, and it is what the website itself uses.
curl -i -T yourfile.iso "https://up.anon.cat/upload?filename=yourfile.iso"
Both forms stream straight through to the CDN, so neither one is limited by the amount of disk space on the server.
Add scrub=1 and the file is stripped of its metadata on the way to the CDN: Exif and GPS from a JPEG, text and eXIf chunks from a PNG, Exif and XMP from a WebP. The pixels are untouched and anything that is not one of those three formats is stored exactly as it was sent.
curl -i -T photo.jpg "https://up.anon.cat/upload?filename=photo.jpg&scrub=1"
The website sends it on every upload. On a resumable upload the parameter goes on the /upload/finish call, not on each chunk.
Anon.Notes has its own API, and it is a different thing from the upload endpoint above: it writes into one note, not into the public file host. A key is made inside a note, on its settings page, and it can do nothing to any other note.
What it is for is a note as a receiver. A deploy script, a CI job, a cron or a bot pushes lines into it, and you read them later on a phone. Nothing to sign up for and nothing to poll: the note is the mailbox.
Base address is https://anon.cat/api/notes/. Everything speaks JSON and everything is authenticated the same way.
Open your note, go to Settings, and create a key under Developer API. It is shown once - copy it then, because nothing on this side can read it back to you afterwards.
A key carries a scope: append may add entries and read nothing, read may read entries and write nothing, and rw may do both and manage notifications. Give a machine the narrowest one that does its job.
Send it as a bearer token. It is never accepted in the query string, because the query string is written to the access log.
curl -H "Authorization: Bearer $ANON_KEY" https://anon.cat/api/notes/ping
Revoking a key is one click in the same panel, takes effect immediately, and does not disturb the note or any other key. Your password is not involved anywhere here, and a key cannot read it, change it, or delete the note.
POST to /api/notes/append with the text in a text field, or as the whole request body. Both of these do the same thing:
curl -H "Authorization: Bearer $ANON_KEY" -d "text=deploy 1.9.9 finished" https://anon.cat/api/notes/append
curl -H "Authorization: Bearer $ANON_KEY" -H "Content-Type: application/json" -d '{"text":"deploy 1.9.9 finished"}' https://anon.cat/api/notes/append
tail -n 20 build.log | curl -H "Authorization: Bearer $ANON_KEY" --data-binary @- https://anon.cat/api/notes/append
A log note gets one more entry. A page note grows: the text is appended to the end of the document, never over it, so a script with a stale copy cannot wipe out something you typed in the meantime.
The answer is 201 with the note's state in it. Add notify=false to skip the notifications for one call, which is what a backfill loop replaying old lines wants.
With a read or rw key, /api/notes/entries returns the entries decrypted, oldest first. limit and offset page through them, and order=desc starts from the newest, which is what a poller wants.
curl -H "Authorization: Bearer $ANON_KEY" "https://anon.cat/api/notes/entries?limit=10&order=desc"
/api/notes/note returns the note without its contents: how many entries it holds, when it was last written to, and how long it has left before the idle sweep would take it. Every read through the API also resets that clock, so a note a bot writes to daily never expires.
A note can tell you when a key writes to it, on Discord or on Telegram. Writing in the note yourself never sends one - the point is to hear about the machine, not about yourself.
Set one up in Settings, or through the API with an rw key. A test is fired the moment it is added, so a webhook URL copied wrong is a status code you see immediately.
curl -H "Authorization: Bearer $ANON_KEY" -H "Content-Type: application/json" -d '{"kind":"discord","url":"https://discord.com/api/webhooks/…","label":"deploys"}' https://anon.cat/api/notes/hooks
curl -H "Authorization: Bearer $ANON_KEY" -H "Content-Type: application/json" -d '{"kind":"telegram","bot":"123456789:AA…","chat":"-1001234567890"}' https://anon.cat/api/notes/hooks
By default a notification carries no text from the note: it says that something arrived, how much of it, which key sent it, and links back here - and the note is still behind its password. Pass preview=true and the entry itself is sent along, which means handing your text to Discord or Telegram. That is a real trade and it is why it is off unless you ask for it.
Only Discord webhook addresses and Telegram bots are accepted. An arbitrary URL is deliberately not offered: this server would be the one fetching it.