Skip to content

Grant Plune AI credits by hand

POST
/v1/admin/credits
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.

Media type application/json
object
subject
required
object
kind
required
string
Allowed values: user company
id
required
string
amount
required
integer
>= 1 <= 100000
validUntil
required
string format: date-time
note
required
string
>= 1 characters <= 1000 characters
Examples
Example goodwill

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

The grant written

Media type application/json
object
grant
required

#1427 D15: a grant as the admin sees it — with where it came from, the operator’s note and who granted it.

object
id
required
string
reason
required
string
Allowed values: signup month pack manual
amount
required
integer
used
required
integer
left
required
integer
validFrom
required
string format: date-time
validUntil
required
string format: date-time
nullable
expired
required
boolean
sourceRef
required

The payment or paid plan it came from (payment monopay <invoice>, tier_grant <id>).

string
nullable
note
required

The operator’s words on a grant by hand.

string
nullable
grantedBy
required
string
nullable
createdAt
required
string format: date-time
provider
required

pack: the provider it was paid through.

string
nullable
Allowed values: paddle monopay liqpay
tier
required

month: the plan that paid for it.

string
nullable
Allowed values: free personal team enterprise
seats
required

month: its paid seats (Free and Personal: 1).

integer
nullable
grantedByEmail
required

The address of whoever granted it by hand.

string
nullable
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

Media type application/json
object
error
required
string
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

Media type application/json
object
error
required
string
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.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over