Le Terrier

L'API du Terrier

Commande tes lapins depuis un script, une appli ou une box domotique.

Chaque appel passe en HTTPS avec l'en-tête Authorization: Bearer <jeton>. Le jeton se crée sur la page Intégration ; il ne voit que les lapins de ton compte, et tu peux l'y révoquer. Les corps sont en JSON.

curl -X POST https://terrier.cyberloutre.fr/api/rabbits/0019db000000/speak -H "Authorization: Bearer …" -H "Content-Type: application/json" -d '{"text": "Bonjour !"}'

openapi.json · la description OpenAPI 3.1, pour les générateurs de code et Swagger.

SKILL.md · une skill pour les agents IA (Claude Code et d'autres) : lecture d'abord, jeton en lecture seule conseillé.

L’API répond aussi au script d’une page web, quel que soit le site (CORS), avec le jeton seulement, jamais ta session : ne mets pas le jeton dans une page publique.

GET /api/books
The talking books this warren holds: slug and title.
GET /api/jingles
The jingles a rabbit can play.
GET /api/rabbits
Your rabbits.
GET /api/rabbits/{mac}
One rabbit: name, firmware, online, its settings (voice included); keys, passwords and calendar addresses show as "(set)".
GET /api/rabbits/{mac}/air
Air quality where the rabbit lives.
POST /api/rabbits/{mac}/air
Show the air quality on the belly (and say it with speak=true).
Pas sur a Nabaztag v1
speak
POST /api/rabbits/{mac}/alarm
Set the wake-up alarm (jingle, weather).
Pas sur a Nabaztag v1
jingle, weather
POST /api/rabbits/{mac}/ambient
Set or clear one raw ambient service on the belly.
Pas sur a Nabaztag v1
clear_all, value, clear
POST /api/rabbits/{mac}/ask
Ask the owner's model a question; the rabbit says the answer.
Pas sur a Nabaztag v1
q
POST /api/rabbits/{mac}/belly/clear
Switch the belly lights off.
Pas sur a Nabaztag v1
GET /api/rabbits/{mac}/birthdays
The birthdays the rabbit wishes.
POST /api/rabbits/{mac}/birthdays
{"name": "Léa", "day": "MM-DD" or "YYYY-MM-DD"}.
name, day
DELETE /api/rabbits/{mac}/birthdays/{bid}
Forget a birthday.
POST /api/rabbits/{mac}/book
Read one of the talking books of 2006 ({"book": slug}), or stop ({"stop": true}); GET /api/books lists them.
Pas sur a Nabaztag v1
stop, book
POST /api/rabbits/{mac}/breath
The colour it breathes in at rest ({"colour": ...}): a tag's or a v1's.
colour
GET /api/rabbits/{mac}/button
What each head-button gesture does.
POST /api/rabbits/{mac}/button
{"gesture": "click" | "double_click" | "long_click" | "double_long_click", "type": …} -- the same actions a tag takes.
gesture
DELETE /api/rabbits/{mac}/button/{gesture}
Clear a gesture.
POST /api/rabbits/{mac}/camera
Karotz only: allow or forbid its camera (enabled: true/false; off by default).
Pas sur a Nabaztag:tag, a Nabaztag v1, a TagTagTag
enabled
GET /api/rabbits/{mac}/choreographies
The choreographies saved on this rabbit's page: POST .../choreography {"name": ...} plays one.
POST /api/rabbits/{mac}/choreography
Play a choreography of your own: LEDs in RGB and ears, step by step in time.
Pas sur a Nabaztag v1
steps, name, tempo_ms
POST /api/rabbits/{mac}/compliment
Say a compliment.
Pas sur a Nabaztag v1
POST /api/rabbits/{mac}/config
Write settings.
POST /api/rabbits/{mac}/counter
Show a number on the belly.
Pas sur a Nabaztag v1, a Karotz, a TagTagTag
value
POST /api/rabbits/{mac}/ears
Move the ears (left, right): 0 upright, 10 lying flat; up to 16 is taken, but past 10 the ear goes on round and forward.
left, right
POST /api/rabbits/{mac}/jingle
Play one of the jingles.
Pas sur a Nabaztag v1
name
GET /api/rabbits/{mac}/journal
Today's home notes.
POST /api/rabbits/{mac}/journal
{"text": "le colis est arrivé"}: a note for the day's home summary.
text
POST /api/rabbits/{mac}/leds
Light the LEDs one by one in RGB (bottom, left, middle, right, top); the others stay.
Pas sur a Nabaztag v1
leds
POST /api/rabbits/{mac}/listen
Push-to-talk: one utterance, transcribed, answered out loud.
Pas sur a Nabaztag v1, a Karotz, a TagTagTag
seconds
POST /api/rabbits/{mac}/mail
Send a message to a friend's rabbit (text, jingle, to = handle).
to, text, jingle
GET /api/rabbits/{mac}/mail
The waiting mail, without its sound.
GET /api/rabbits/{mac}/mail/{mail_id}/audio
One waiting voice message, as the MP3 it is.
POST /api/rabbits/{mac}/mail/block
Block or unblock a sender.
handle, unblock
POST /api/rabbits/{mac}/mail/read
Say the waiting mail now.
POST /api/rabbits/{mac}/minuteur
The kitchen timer: {"minutes": n} starts it, {"cancel": true} stops it.
Pas sur a Nabaztag v1
cancel, minutes
GET /api/rabbits/{mac}/mood
The rabbit's mood.
POST /api/rabbits/{mac}/mood
Tell the rabbit somebody interacted with it.
kind
POST /api/rabbits/{mac}/name
Rename the rabbit; its handle follows, friends included (as the page).
name
POST /api/rabbits/{mac}/nightlight
Night light on the belly (on, colour, level).
Pas sur a Nabaztag v1
on, colour, level
POST /api/rabbits/{mac}/nose
Blink the nose.
Pas sur a Nabaztag v1, a Karotz, a TagTagTag
mode
POST /api/rabbits/{mac}/notify
One call for "something happened": a colour on the belly, a jingle, a sentence, a nose blink, a count.
Pas sur a Nabaztag v1
colour, level, nose, jingle, text
POST /api/rabbits/{mac}/now
Do a "now" action (what: taichi, story, joke, horoscope, nameday, briefing, agenda, news, transport, weather, time, compliment, fierte, advent).
Pas sur a Nabaztag v1
what
POST /api/rabbits/{mac}/os-update
Terrier OS's update for a Karotz on it, as its page's button: the version on offer, sent inside its session.
Pas sur a Nabaztag:tag, a Nabaztag v1, a TagTagTag
GET /api/rabbits/{mac}/palette
What its lights take: the belly's colour names, its breathing colours, its LEDs, the nose's modes, the ears' range (0 upright, 10 flat).
POST /api/rabbits/{mac}/photo
Karotz only: take one picture and get it as JPEG, inside the rabbit's encrypted session.
Pas sur a Nabaztag:tag, a Nabaztag v1, a TagTagTag
POST /api/rabbits/{mac}/play
Play a sound or a stream from a public URL (mp3), or stop.
Pas sur a Nabaztag v1
stop, url
POST /api/rabbits/{mac}/podcast
Play a podcast episode.
Pas sur a Nabaztag v1
stop, feed, episode
GET /api/rabbits/{mac}/podcast
The podcasts set on this rabbit.
POST /api/rabbits/{mac}/pomodoro
The pomodoro, as a press on the head: starts one, or cancels the one running.
Pas sur a Nabaztag v1
POST /api/rabbits/{mac}/radio
Play a radio station, or stop it.
Pas sur a Nabaztag v1
stop, url, station
POST /api/rabbits/{mac}/reload
Restart the rabbit so it loads the runtime served now (Naboot v2).
GET /api/rabbits/{mac}/reminders
The reminders.
POST /api/rabbits/{mac}/reminders
{"at": "18:00", "text": "...", "repeat": "once|daily|weekdays|weekend", "date": "YYYY-MM-DD" for once}.
at, text, repeat, date, confirm, notify
DELETE /api/rabbits/{mac}/reminders/{rid}
Delete a reminder.
POST /api/rabbits/{mac}/rfid
Bind a tag.
Pas sur a Nabaztag v1
tag
DELETE /api/rabbits/{mac}/rfid/{tag}
Unbind a tag.
POST /api/rabbits/{mac}/rfid/seen
Report a tag seen by a reader (for external RFID readers).
Pas sur a Nabaztag v1
tag, reader
GET /api/rabbits/{mac}/settings
What this warren will accept, and what it holds now — so a client can build its own form without hard-coding eight belly colours.
POST /api/rabbits/{mac}/sleep
Put the rabbit to sleep or wake it up (asleep: true/false).
asleep
POST /api/rabbits/{mac}/speak
Say a text in the rabbit's voice.
text
GET /api/rabbits/{mac}/state
What the rabbit says about itself, asked now.
POST /api/rabbits/{mac}/taichi
Start the tai-chi of 2006, or stop it ({"stop": true}).
Pas sur a Nabaztag v1
stop
POST /api/rabbits/{mac}/tell
{"what": "joke" | "ephemeris" | "transport" | "story" | "agenda" | "alerts" | "weather" | "clock" | "wakeup" | "twitch" | "pomodoro" (starts one, or cancels it)
Pas sur a Nabaztag v1
what, minutes
POST /api/rabbits/{mac}/transport/stop
{"network": <id>, "id": <stop id from /transport/stops>, "name": <its name>}.
network, id, name
GET /api/rabbits/{mac}/transport/stops
?network=<id>&q=<name>: the stops a rabbit can be set to.
?network=…&q=…
POST /api/rabbits/{mac}/update
The update button, for a script (2026-11-13): the same image, the same signature check, the same way to the rabbit.
Pas sur a Nabaztag v1, a Karotz, a TagTagTag
GET /api/rabbits/{mac}/voices
The voices it can take, your ElevenLabs ones included (id "eleven@<voice id>"), and the one it has; set one with /config {"voice": id}.
POST /api/rabbits/{mac}/volume
Set the loudness now and keep it (percent: 0-100).
Pas sur a Nabaztag v1, a Karotz
percent
POST /api/rabbits/{mac}/weather/place
The weather's town by name, as the page takes it: one match is set, several are listed for the caller to choose (send one back by lat/lon through /config), none
place
GET /api/transport/networks
Public transport networks a rabbit can follow.
GET /api/weather/places
?q=<town>: candidates, with what /config takes (weather_place, weather_lat, weather_lon) -- the page's town picker, for a script.
?q=…