Grant Plune AI credits by hand
const url = 'https://beta-api.plune.ai/v1/admin/credits';const options = { method: 'POST', headers: { cookie: 'plune_session=<plune_session>', 'Content-Type': 'application/json' }, body: '{"subject":{"kind":"company","id":"6f1c2b3a-0000-4000-8000-0000000000a5"},"amount":200,"validUntil":"2099-12-31T23:59:59.000Z","note":"goodwill after the outage of 12.11"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/admin/credits \ --header 'Content-Type: application/json' \ --cookie plune_session=<plune_session> \ --data '{ "subject": { "kind": "company", "id": "6f1c2b3a-0000-4000-8000-0000000000a5" }, "amount": 200, "validUntil": "2099-12-31T23:59:59.000Z", "note": "goodwill after the outage of 12.11" }'#1427 D15 (frames 08, 09): one grant, reason manual, of amount credits (1 to 100 000) to an account or a company, usable now until validUntil (required, in the future), with the operator’s note (required). The grant records who granted it, and the admin journal records the call with its subject, amount, end and the grant made. Owner-only, as POST /v1/admin/tier-grants; everyone else gets 404, before the body is read. Ten calls a minute.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
object
Examples
200 credits for a quarter
{ "subject": { "kind": "company", "id": "6f1c2b3a-0000-4000-8000-0000000000a5" }, "amount": 200, "validUntil": "2099-12-31T23:59:59.000Z", "note": "goodwill after the outage of 12.11"}Responses
Section titled “ Responses ”The grant written
object
#1427 D15: a grant as the admin sees it — with where it came from, the operator’s note and who granted it.
object
The payment or paid plan it came from (payment monopay <invoice>, tier_grant <id>).
The operator’s words on a grant by hand.
pack: the provider it was paid through.
month: the plan that paid for it.
month: its paid seats (Free and Personal: 1).
The address of whoever granted it by hand.
Example
{ "grant": { "reason": "signup", "provider": "paddle", "tier": "free" }}Not JSON, or a field that does not hold — no end, an end in the past, no note, an amount out of range
object
Example
{ "error": "validation failed — validUntil: must be in the future"}No / invalid session
The caller does not own the application — or there is no such account or company
object
Example generated
{ "error": "example"}Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over