Developer Resources / Get started / Developer setup

Developer setup

This page covers your credentials, authentication, testing and where to go next. Your account admin has the account ID and Account API key from the dashboard.

What you need#

You needWhere it comes from
Account IDA short lowercase name, such as acme. Your account admin finds it on the Accounts page in the dashboard.
Account API keyIn the account's Account Settings, on the same page. Your account admin shares it with you securely. See where to find it.
A trial accountRequest one through the trial form. See Environments and testing.
At least one eventConfigured in the dashboard, or built by Claude. The Quickstart lists what its examples use.

Authentication#

Every GameLayer API request sends two things:

WhatWhereExample
Account API keyapi-key headerapi-key: your-account-api-key
Account IDaccount query parameter for GET and DELETE, body field for POST and PATCHaccount=acme
curl
curl "https://api.gamelayer.co/api/v0/events?account=acme" \
  -H "api-key: $GAMELAYER_API_KEY"

If the account ID doesn't match the key, the API answers 401 Unauthorized.

Keep the key on your servers#

Anyone who has the Account API key can call every GameLayer API operation for your account, not only the ones your app uses. That includes completing events and claiming prizes for any player, deleting players and setting leaderboard scores. The key doesn't give access to the Admin API.

  • Call GameLayer from your backend, and keep the key in a server-side secret such as an environment variable or a key vault.
  • Never put the key in a web page, a mobile app or a public repository.
  • If you think it has been exposed, contact developer@gamelayer.co straight away.

For a web or mobile app, give it a small endpoint on your backend that adds the key. See Never ship the key in an app.

Environments and testing#

There's one environment, production: the API is at https://api.gamelayer.co/api/v0 and the dashboard at app.gamelayer.co.

To test, use a separate trial account, so test players and events never mix with your live data. Request one through the trial form on gamelayer.io. A trial account works exactly like a live one, except that it has a limit on the number of players (error code 22 when you reach it).

Rate limits#

There are two kinds of limit, counted per minute: one per Account API key, and one per IP address.

Per key#

Writes and claims are limited per Account API key and account:

EndpointLimit per minute
POST /events/{id}/complete6,000
POST /players600
POST /quizzes/{id}/complete600
POST /surveys/{id}/complete600
Claims on prizes, mystery boxes and raffles60 each
  • Over a limit, the API answers 429 with a Retry-After header and "code": "RATE_LIMIT_EXCEEDED". Wait that long, then retry.
  • POST /players only creates players: for an existing player it answers 409 with error code 21. Updates (PUT or PATCH /players/{player}) and reads have no per-key limit.
  • A 429 with error code 24 is different: another request is updating the same player. Wait 1 second and retry.

Per IP address#

Any single IP address can send at most 2,000 requests a minute, across all endpoints. This applies whatever the per-key limits allow, so it's the real ceiling for one server: one server can't reach 6,000 event completions a minute.

  • Over it, requests get 429 with an error message and no Retry-After header. A 429 without Retry-After means: wait for the next minute, then retry.
  • If one server needs more, contact developer@gamelayer.co.

See When to retry for what's safe to send again.

The two APIs#

GameLayer APIAdmin API
What it doesRuns the game: players, completed events, progress, prize claimsBuilds the game: events, missions, achievements, levels, streaks, quizzes, surveys, leaderboards and prizes
Base URLhttps://api.gamelayer.co/api/v0https://api.gamelayer.co/admin/v0
Authenticationapi-key header with the Account API keyAuthorization: Bearer glak.… with an Agent Key
Typical callerYour backend, many times a secondThe dashboard, Claude, or your own agent or script
ReferenceGameLayer API · Try itAdmin API · Try it

GameLayer API

What it does
Runs the game: players, completed events, progress, prize claims
Base URL
https://api.gamelayer.co/api/v0
Authentication
api-key header with the Account API key
Typical caller
Your backend, many times a second
Reference
GameLayer API · Try it

Admin API

What it does
Builds the game: events, missions, achievements, levels, streaks, quizzes, surveys, leaderboards and prizes
Base URL
https://api.gamelayer.co/admin/v0
Authentication
Authorization: Bearer glak.… with an Agent Key
Typical caller
The dashboard, Claude, or your own agent or script
Reference
Admin API · Try it

The Account API key can't reach the Admin API, and an Agent Key can't call the GameLayer API. Most integrations only need the GameLayer API: you configure the game in the dashboard or with Claude. See Admin API and agents for scripting your configuration.

Developer kit#

One download with ready-to-run material:

  • Postman collection with a Getting Started folder that discovers your element IDs, creates a player, completes an event and claims a prize
  • Example clients in JavaScript, Python and C#, each with a runnable quickstart and a helper that retries event completions safely. They're examples to copy and adapt, not versioned packages.
  • curl script that runs the core flow
  • The guides on this site, as Markdown

Download the developer kit (.zip)

Where next#

  1. Quickstart: create a player, complete an event and claim a prize in about 10 minutes.
  2. Concepts: points and credits, requirements, periods and the progression cascade.
  3. Integration guide: patterns for production.
  4. Error codes: what each error means and what to do.

Questions: developer@gamelayer.co.