Skip to content
Coritan Docs

Organization integrations

Connect your organization to Discord and set up the game proxy your customers' players join through.

View as Markdown

The Discord and Game proxy pages connect your organization to services outside Coritan. Open your organization, then Growth, to find them. Only owners and admins see them; a link to one takes any other member to the organization's Overview instead.

Integration What it does
Discord Runs your own bot in your community's Discord server: support tickets in a staff channel, slash commands for customers, role menus, and your server's public channels on your storefront.
Game proxy Sets the join addresses your customers' game servers get, and the messages players see in their server list and when they join.
Medal quest Boosts a server for a while when a player finishes your quest on Medal: each boost lifts it one level, and each level can give it more. Coritan sets it up with you, as described below.

Every change on these pages goes on your organization's audit log.

In a Medal quest, a player signs up for Medal with your referral link, records a Minecraft clip, and enters the address players use to join their server. Your customers must sign up for Medal with your referral link, or the boost will not work. When the player finishes, Medal's servers call your organization's endpoint, and the server at that address is boosted until the boost ends. A free server always qualifies. A paid server qualifies only when your organization allows it. A boost is never billed: it changes no plan price and no invoice, and usage billing counts a boosted server at its plan's memory, CPU and disk.

A server can hold up to 10 boosts at once, each with its own end date, and its level is how many it holds. Anyone who knows a server's address can boost it, so a server's players can boost it together. Your organization can have two ladders that say what each level gives:

  • Free servers: more memory, CPU and disk, a longer wait before the server sleeps when nobody is playing (up to 240 minutes), MySQL databases, and perks: no "Hosted by" message in the game chat, first place in the start queue on its machine, schedules (they run while the server is online and never start a sleeping server), snapshot download, keeping the world from the inactivity cleanup while boosted, and a Boosted badge on your community server list.
  • Paid servers: extras on top of the plan: memory, CPU, disk, ports, MySQL databases, daily automatic backups, and the Boosted badge.

Each level holds the totals at that level, and a number a level leaves out carries forward from the level below. Without a ladder for a plan, each boost adds the same amount of memory and nothing else.

When a boost ends, the level drops. Memory and CPU go back when the server next stops. Disk never drops below what the world already uses, so the server still starts; it gives the rest back once the world fits. The rest of a level ends at once, and databases and ports already made keep working. Moving a server to a paid plan moves its boosts onto the paid ladder, and the free plan moves them back. Two days before a level drops, we email the server's owner how to boost it again, with your referral link.

Coritan sets the quest up for your organization: both ladders, how long a boost lasts, the limits per server and per player, whether paid servers can claim a boost, your referral link, and the key Medal uses. Contact support to start one or to change it. The key starts with mdl_, and Coritan can show it only once, when it is made.

Medal calls this endpoint from its own servers. No member or customer token works on it; only your organization's Medal key does.

Shell
curl -X POST "https://api.coritan.com/api/v1/orgs/acme/partners/medal/boosts" \
  -H "Authorization: Bearer $MEDAL_KEY" \
  -H "Content-Type: application/json" \
  -d '{"server_address": "myworld.example.com", "claim_id": "qc_7f2a91"}'

The fields can also arrive as form fields or in the query string. A field in the body wins over the same one in the query string.

Field Required Meaning
server_address Yes The address the player typed: the server's join address or a custom domain linked to it, and for a paid server also its IP and port or a floating IP attached to it. Case, a trailing dot and a scheme are ignored, and so is a port after a name. A free server has no IP of its own, so an IP never finds one.
claim_id No An ID for this quest completion, up to 128 characters. A retry with the same claim_id answers with the grant already made.
medal_user_id No The player's Medal account ID, up to 128 characters. The per-player cooldown and the limit on one player's share of a server only apply when Medal sends it.
dry_run No true checks the address and every rule and grants nothing. The answer's status is then eligible, and it names the level the claim would reach.

A grant answers 201 with status: granted, the boost (memory_mb, the memory this boost adds, granted_at, expires_at), the server and a message written for the player. With a ladder for the server's plan, it also carries level, max_level, ladder (free or paid) and perks, what that level gives. A replayed claim_id answers 200 with replayed: true.

A refusal answers {"detail": {"code": "...", "message": "..."}} and changes nothing, so the player can fix a typo and try again:

Status code When
400 invalid_request server_address is missing, a field is too long, or the body cannot be read.
401 unauthorized The key is missing or wrong, belongs to another organization, or the call came from outside the allowed addresses.
403 integration_disabled The quest is switched off, or the organization is not active.
404 server_not_found No server of your organization has that address.
409 server_already_boosted The server holds as many boosts as it may. expires_at says when it can take another.
409 user_cooldown This Medal account claimed recently. next_eligible_at says when it can claim again.
409 player_server_limit This Medal account already holds as many of this server's boosts as one account may. expires_at says when its soonest one ends.
422 not_eligible reason is paid_plan (the server is on a paid plan and your organization limits boosts to free servers), no_room (the machine a paid server runs on has no room right now for the memory or disk the next level adds, so the player can try again later) or server_unavailable.
429 rate_limited The key made too many calls this hour. Wait for the time in the Retry-After header.

The server's limits rise at once. A Java memory setting left at its default follows the new memory when the server restarts; an owner who set it raises it in the server's settings first.

Showing the offer to your customers

Section titled Showing the offer to your customers

Coritan also sets your referral link: the Medal link your customers sign up with. While the quest is on and has a key, every server of your organization that can take a boost (every free server, and every paid server when your organization allows paid boosts) carries a boosts field in GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}. It holds:

  • how many boosts the server has active out of its limit, whether it can take one now (claimable) and when the soonest one ends (expires_at); each active boost's dates are in active_boosts;
  • its level out of max_level, the ladder it climbs (free or paid), the ladder's levels (or null without one), what the level gives now (perks) and what the next boost would give (next);
  • referral_url, where every boost button should send people: your referral link, else your signup link, else Medal's site. Tell your customers to sign up for Medal with it, or the boost will not work;
  • address, what to enter in the quest, and paid, which is true on a paid server, so your storefront can word the levels as extras on top of the plan.

The server's own cpu_percent and disk_mb include what its level adds, as memory_mb does, with the plan's figures in base_cpu_percent and base_disk_mb. Each item in its entitlements carries boost_unlocks_at: the level that unlocks what the free plan withholds, or null. A paid server carries boosts: null unless your organization allows paid boosts.

Asking what to offer a customer

Section titled Asking what to offer a customer

To decide whether your storefront should mention the quest to a signed-in customer right now, call GET /api/v1/orgs/{org_slug}/portal/partners/medal/offer with the customer's token as Authorization: Bearer $CUSTOMER_TOKEN. It reads the quest and the customer's own servers, writes nothing, and answers for that customer only, so do not cache it.

Shell
curl "https://api.coritan.com/api/v1/orgs/acme/portal/partners/medal/offer" \
  -H "Authorization: Bearer $CUSTOMER_TOKEN"

The answer holds show, state, server, offer and account_age_ok. show is true only when there is something to do. state says what:

state show Meaning
no_server true The customer has no server yet. Suggest making one and getting Medal.
free_claimable true A free server of theirs can take a boost.
paid_claimable true A paid server of theirs can take a boost and no free one can. Your organization has to allow paid boosts.
all_boosted false Every server that can take a boost has as many as it may.
not_eligible false The customer has servers and none can take a boost, for example paid servers when your organization keeps boosts to free servers.
too_new false The account is less than 24 hours old.
unavailable false The quest is off or has no key.

server is the one to point at, or null: a free server that can take a boost first, otherwise a paid one. It holds id, uuid, name, address (what players join with, and what to enter in the quest), plan (free or paid), boost_memory_mb (the memory the next boost adds), level, max_level and next. offer holds the boost on offer (memory_mb, duration_days), paid_servers (whether paid servers can claim), referral_url, quest_url, signup_url, partner_url, max_level and your ladders (levels, paid_levels), or null when the quest is off. account_age_ok is true once the account is 24 hours old. Only servers the customer owns count, not servers shared with them. A support session acting as the customer always gets show: false.

API operations on this page

MethodPathWhat it does
POST/api/v1/orgs/{org_slug}/partners/medal/boostsMedal claim
GET/api/v1/orgs/{org_slug}/portal/partners/medal/offerWhat the brand's Medal quest has to offer the signed-in customer right now