Studios
Studios that give Shop credits to their players out of a budget, managed by admins
Every studio with its budget figures. Requires signed fetch from an address in READ_ONLY_ADMIN_ADDRESSES or READ_WRITE_ADMIN_ADDRESSES.
Signed fetch authentication using @dcl/platform-crypto-middleware (ADR-44l). Requires auth chain headers (x-identity, x-signature, x-timestamp) for signature validation. See http://adr.decentraland.org/adr/ADR-44l for details.
The studios, by name
The signed-fetch address is not an allowed admin for this route
Internal server error
GET /admin/studios HTTP/1.1
Host: credits.decentraland.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"studios": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"status": "active",
"createdBy": "text",
"createdAt": 1,
"updatedAt": 1,
"balanceCents": 1,
"depositedCents": 1,
"grantedCents": 1,
"grantCount": 1,
"operatorCount": 1
}
]
}Creates an active studio with an empty budget. Names are unique regardless of case. Requires signed fetch from an address in READ_WRITE_ADMIN_ADDRESSES; that address is recorded as the creator.
Signed fetch authentication using @dcl/platform-crypto-middleware (ADR-44l). Requires auth chain headers (x-identity, x-signature, x-timestamp) for signature validation. See http://adr.decentraland.org/adr/ADR-44l for details.
Trimmed before it is stored; a single line of printable characters
Studio created
Invalid studio id or request body
The signed-fetch address is not an allowed admin for this route
A studio with that name already exists
Internal server error
POST /admin/studios HTTP/1.1
Host: credits.decentraland.org
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 22
{
"name": "Pixel Forge"
}{
"studio": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"status": "active",
"createdBy": "text",
"createdAt": 1,
"updatedAt": 1,
"balanceCents": 1,
"depositedCents": 1,
"grantedCents": 1,
"grantCount": 1,
"operatorCount": 1
}
}The studio, its operators and a page of its budget history, newest first. Requires signed fetch from an address in READ_ONLY_ADMIN_ADDRESSES or READ_WRITE_ADMIN_ADDRESSES.
Signed fetch authentication using @dcl/platform-crypto-middleware (ADR-44l). Requires auth chain headers (x-identity, x-signature, x-timestamp) for signature validation. See http://adr.decentraland.org/adr/ADR-44l for details.
History entries per page. Larger values are capped at 200; invalid ones fall back to 50.
500The studio
Invalid studio id or request body
The signed-fetch address is not an allowed admin for this route
No studio with that id
Internal server error
GET /admin/studios/{studioId} HTTP/1.1
Host: credits.decentraland.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"studio": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"status": "active",
"createdBy": "text",
"createdAt": 1,
"updatedAt": 1,
"balanceCents": 1,
"depositedCents": 1,
"grantedCents": 1,
"grantCount": 1,
"operatorCount": 1
},
"operators": [
{
"address": "text",
"addedBy": "text",
"createdAt": 1
}
],
"entries": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"kind": "deposit",
"usdCents": 1,
"note": null,
"createdBy": "text",
"createdAt": 1,
"creditId": null,
"recipient": null
}
],
"page": {
"limit": 1,
"offset": 1,
"total": 1
},
"grantLimits": {
"maxGrantCents": null
}
}Renames a studio, or pauses or resumes it. Send only the fields to change. A paused studio keeps its budget but cannot grant. Requires signed fetch from an address in READ_WRITE_ADMIN_ADDRESSES.
Signed fetch authentication using @dcl/platform-crypto-middleware (ADR-44l). Requires auth chain headers (x-identity, x-signature, x-timestamp) for signature validation. See http://adr.decentraland.org/adr/ADR-44l for details.
Studio updated
Invalid studio id or request body
The signed-fetch address is not an allowed admin for this route
No studio with that id
Another studio already has that name
Internal server error
PATCH /admin/studios/{studioId} HTTP/1.1
Host: credits.decentraland.org
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"status": "paused"
}{
"studio": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "text",
"status": "active",
"createdBy": "text",
"createdAt": 1,
"updatedAt": 1,
"balanceCents": 1,
"depositedCents": 1,
"grantedCents": 1,
"grantCount": 1,
"operatorCount": 1
}
}Allows a wallet to act for the studio. Adding a wallet that is already an operator is not an error. Requires signed fetch from an address in READ_WRITE_ADMIN_ADDRESSES.
Signed fetch authentication using @dcl/platform-crypto-middleware (ADR-44l). Requires auth chain headers (x-identity, x-signature, x-timestamp) for signature validation. See http://adr.decentraland.org/adr/ADR-44l for details.
^0x[a-fA-F0-9]{40}$The wallet was already an operator; nothing changed
Present when adding; false if the wallet was already an operator
Present when removing
The wallet was added
Invalid studio id or request body
The signed-fetch address is not an allowed admin for this route
No studio with that id
Internal server error
POST /admin/studios/{studioId}/operators HTTP/1.1
Host: credits.decentraland.org
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 18
{
"address": "text"
}{
"studioId": "123e4567-e89b-12d3-a456-426614174000",
"address": "text",
"added": true,
"removed": true
}Stops a wallet from acting for the studio. Requires signed fetch from an address in READ_WRITE_ADMIN_ADDRESSES.
Signed fetch authentication using @dcl/platform-crypto-middleware (ADR-44l). Requires auth chain headers (x-identity, x-signature, x-timestamp) for signature validation. See http://adr.decentraland.org/adr/ADR-44l for details.
The operator's wallet
^0x[a-fA-F0-9]{40}$The wallet was removed
Present when adding; false if the wallet was already an operator
Present when removing
Invalid studio id or request body
The signed-fetch address is not an allowed admin for this route
STUDIO_NOT_FOUND: no studio with that id. OPERATOR_NOT_FOUND: the wallet does not act for it.
Internal server error
DELETE /admin/studios/{studioId}/operators/{address} HTTP/1.1
Host: credits.decentraland.org
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"studioId": "123e4567-e89b-12d3-a456-426614174000",
"address": "text",
"added": true,
"removed": true
}Adds an entry to the studio's budget ledger. credits are whole Shop credits (1 credit = 10 cents) and are stored as cents. A deposit must be positive. An adjustment may go either way, needs a note, and may never take the balance below zero. Requires signed fetch from an address in READ_WRITE_ADMIN_ADDRESSES; that address is recorded on the entry.
New budget (a deposit or an upward adjustment) counts against a service-wide daily ceiling on deposits (DAILY_STUDIO_DEPOSIT_LIMIT_CENTS, UTC day by the database clock) and is refused while no ceiling is configured. Studios themselves have no limits: what a studio can give is its budget.
Idempotent on idempotencyKey: repeating a request with the same key and the same body answers 200 with replayed: true and the entry the first request wrote, and writes nothing, even once the day's ceiling is reached. The same key with a different body is refused. A new entry is announced on Slack; a replay is not.
Signed fetch authentication using @dcl/platform-crypto-middleware (ADR-44l). Requires auth chain headers (x-identity, x-signature, x-timestamp) for signature validation. See http://adr.decentraland.org/adr/ADR-44l for details.
Positive for a deposit; either sign for an adjustment. At most 10,000,000 either way.
Optional on a deposit, required on an adjustment
The caller's key for this operation, e.g. a new UUID; reuse it only to retry it
^[A-Za-z0-9._:-]{8,128}$The key already recorded this change; nothing new was written
The change in cents, signed
The studio's balance now (after the change, or as it stands on a replay)
True when the idempotency key had already recorded this change
Entry recorded
Invalid studio id or request body
The signed-fetch address is not an allowed admin for this route
No studio with that id
STUDIO_BUDGET_EXCEEDED: the adjustment would take the studio's budget below zero.
IDEMPOTENCY_KEY_REUSED: the key was already used for a different request.
DAILY_DEPOSIT_LIMIT_EXCEEDED: the new budget would pass the daily deposit ceiling
Internal server error
DEPOSITS_NOT_CONFIGURED: new budget requested while no daily deposit ceiling is configured
POST /admin/studios/{studioId}/budget HTTP/1.1
Host: credits.decentraland.org
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 113
{
"kind": "deposit",
"credits": 5000,
"note": "October budget",
"idempotencyKey": "7f9c2ba4-e88f-4c4b-9a39-1b5d8c3c2f10"
}{
"entryId": "123e4567-e89b-12d3-a456-426614174000",
"studioId": "123e4567-e89b-12d3-a456-426614174000",
"kind": "deposit",
"usdCents": 1,
"balanceCents": 1,
"replayed": true
}Last updated