Skip to the page

Build on ouicu

API

Your shares, sites, their visitors and the month's data over HTTP, with an API key.

Authentication

Send an API key in the Authorization header:

curl https://ouicu.com/api/usage \  -H "Authorization: Bearer $OUICU_API_KEY"

Make a key under Account, API keys; it is shown once. Keys you make there last until you revoke them. The key ouicu login saves works too, and lapses after 90 days unused. A key can do anything your account can, so keep it out of code and logs.

Answers and errors

Every answer is JSON. When ouicu refuses, the answer has an error in plain words, and the HTTP status says what kind:

{ "error": "That API key does not work. Run `ouicu login`." }
Error statuses
StatusMeaning
401No key, or one that doesn't work.
403The account's email address isn't confirmed, or the account is suspended.
404No such share or site on your account.
429More than 300 requests in a minute. Wait a moment.

Endpoints

API endpoints
EndpointWhat it does
GET /api/sharesYour shares.
POST /api/shares/{id}/stopStops a share.
GET /api/shares/{id}/requestsA share's latest requests.
GET /api/sitesYour uploaded sites.
DELETE /api/sites/{id}Deletes a site.
GET /api/sites/{id}/requestsA site's latest requests.
GET /api/usageThe month's data so far.
GET /api/cli/whoamiWho a key belongs to.

To upload a site from code, use the SDK's deploy() or ouicu deploy.

GET /api/shares

Live shares first, then the latest ended ones. Add ?limit= for up to 100; the default is 30.

curl https://ouicu.com/api/shares -H "Authorization: Bearer $OUICU_API_KEY"
Answer
{  "shares": [    {      "id": "0b8f6c4e-2d1a-4c3b-9e7f-5a6d8c9b1e20",      "name": "studiolund",      "url": "https://studiolund.ouicu.app",      "live": true,      "client": "studio-mac, macOS",      "startedAt": "2026-10-04T09:12:44.000Z",      "endedAt": null,      "ended": null,      "password": true,      "people": false,      "requests": 412,      "bytes": 18837504    }  ]}
Fields of a share
FieldWhat it holds
idThe share's id, for the calls below.
name, urlIts name and link.
liveWhether it is running now.
clientThe computer it runs on.
startedAt, endedAtWhen it started and ended (ISO 8601).
endedHow it ended, like "closed" or "stopped from the dashboard", or null while live.
passwordWhether visitors need a password.
peopleWhether only invited people may open it.
requests, bytesWhat visitors took from it.

POST /api/shares/{id}/stop

Stops a share. The ouicu share running it exits and says why, and the share's last version is taken down.

curl -X POST https://ouicu.com/api/shares/0b8f6c4e-2d1a-4c3b-9e7f-5a6d8c9b1e20/stop \  -H "Authorization: Bearer $OUICU_API_KEY"
Answer
{ "ok": true, "message": "Stopped 1 share." }

GET /api/shares/{id}/requests

The latest 50 requests to a share, newest first. ouicu keeps them in memory only, so they go when it restarts. available is false when they couldn't be read just now.

curl https://ouicu.com/api/shares/0b8f6c4e-2d1a-4c3b-9e7f-5a6d8c9b1e20/requests \  -H "Authorization: Bearer $OUICU_API_KEY"
Answer
{  "available": true,  "visitors": 2,  "requests": [    {      "at": "2026-10-04T09:20:03.118Z",      "method": "GET",      "path": "/pricing",      "status": 200,      "ms": 41,      "bytes": 18211,      "country": "DK",      "device": "phone",      "visitor": 2,      "ouicu": null    }  ]}
Fields of a request
FieldWhat it holds
atWhen it was answered (ISO 8601).
method, pathWhat was asked for.
status, ms, bytesThe answer's status, how long it took, and its size.
countryTwo letters, like DK, or null.
devicephone, tablet, computer, bot or unknown.
visitorA number for each visitor: 1 for the first seen.
ouicuWhich of ouicu's own pages answered, like notice, password or paused, or null when your site did.

GET /api/sites

Your uploaded sites, the latest upload first.

curl https://ouicu.com/api/sites -H "Authorization: Bearer $OUICU_API_KEY"
Answer
{  "sites": [    {      "id": "6a1d7f30-8b2c-4e95-a0f4-3c9e1b7d2a58",      "name": "calm-otter-4821",      "url": "https://calm-otter-4821.ouicu.app",      "files": 24,      "size": 1258291,      "uploadedAt": "2026-10-04T08:02:10.000Z",      "expiresAt": "2026-10-11T08:02:10.000Z",      "password": false,      "people": false,      "requests": 96,      "bytes": 3407872    }  ]}
Fields of a site
FieldWhat it holds
idThe site's id, for the calls below.
name, urlIts name and link.
files, sizeHow many files it holds, and their size in bytes.
uploadedAtWhen the latest upload finished.
expiresAtWhen it goes, on Free, or null.
password, peopleWhether a password or an invite list holds.
requests, bytesWhat visitors took from it.

DELETE /api/sites/{id}

Deletes a site and its files. Its link stops working.

curl -X DELETE https://ouicu.com/api/sites/6a1d7f30-8b2c-4e95-a0f4-3c9e1b7d2a58 \  -H "Authorization: Bearer $OUICU_API_KEY"
Answer
{ "ok": true }

GET /api/sites/{id}/requests

The latest requests to a site, in the same shape as a share's.

curl https://ouicu.com/api/sites/6a1d7f30-8b2c-4e95-a0f4-3c9e1b7d2a58/requests \  -H "Authorization: Bearer $OUICU_API_KEY"

GET /api/usage

The month's data so far, against your plan's allowance.

curl https://ouicu.com/api/usage -H "Authorization: Bearer $OUICU_API_KEY"
Answer
{  "plan": "hobby",  "month": "2026-10",  "bytes": 734003200,  "requests": 15230,  "allowanceBytes": 26843545600,  "resetsAt": "2026-11-01T00:00:00.000Z",  "over": false}
Fields of the month's data
FieldWhat it holds
planfree, hobby or pro.
monthThe month, in UTC.
bytes, requestsWhat visitors took so far this month.
allowanceBytesThe plan's data a month, in bytes.
resetsAtWhen the next month starts.
overWhether the allowance is used up, so previews are paused.

GET /api/cli/whoami

Who a key belongs to: handy to check a key works.

curl https://ouicu.com/api/cli/whoami -H "Authorization: Bearer $OUICU_API_KEY"
Answer
{  "email": "[email protected]",  "name": "Anna",  "plan": { "key": "hobby", "name": "Hobby", "source": "subscription" },  "key": { "name": "CI", "prefix": "ocu_x7Kq2mPa" }}