Request Format
All GraphQL requests use POST /graphql and pass an allowed document ID from the API reference.
Key terms in this section: documentId, variables, Context token, and X-Project-Context.
Request Body
{
"documentId": "me",
"variables": {}
}
| Field | Type | Description |
|---|---|---|
documentId | String | Allowed document ID from the API reference |
variables | Object | Operation variables. Use {} when no variables are required |
Reference examples show the full variable set for each operation, including optional fields. Optional fields can be omitted when the scenario does not use them.
To execute a scenario, send the document ID and its variables in the format below.
Required Headers
| Header | Description |
|---|---|
Accept-Language | Preferred response languages in standard HTTP format, for example en-US, en;q=0.9, ru;q=0.8 |
Content-Type | Always application/json |
X-Project-Context | identity.contextToken from the project configuration |
X-Request-Id | Request ID for tracing and support |
Context Headers
| Header | Description |
|---|---|
Authorization | Bearer <sessionId> for an authenticated user |
Use identity.contextToken from the downloaded project configuration unchanged. Authenticated operations also pass Authorization: Bearer <sessionId>.
Authenticated operations use the selected server; change it with the changeServer document. Public catalogs and operations targeting a specific server accept gameServerId in variables.
Request Examples
Operation pages can show the request and response side by side, so the full API exchange is visible at once.
POST /graphql HTTP/1.1
Accept-Language: en
Content-Type: application/json
X-Project-Context: <project-context-token>
X-Request-Id: optional-request-id
{
"documentId": "me",
"variables": {}
}
{
"data": {
"me": {
"id": 1,
}
}
}
- curl
- fetch
- PHP
- JS
- C#
- Rust
- Go
- Python
curl -X POST https://project.example/graphql \
-H "Accept-Language: en" \
-H "Content-Type: application/json" \
-H "X-Project-Context: <project-context-token>" \
-H "X-Request-Id: optional-request-id" \
-d '{"documentId":"me","variables":{}}'
await fetch('/graphql', {
method: 'POST',
headers: {
'Accept-Language': 'en',
'Content-Type': 'application/json',
'X-Project-Context': projectConfig.identity.contextToken,
'X-Request-Id': requestId,
},
body: JSON.stringify({
documentId: 'servers',
variables: {},
}),
});
$response = file_get_contents('https://project.example/graphql', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => [
'Accept-Language: en',
'Content-Type: application/json',
'X-Project-Context: ' . $projectContextToken,
'X-Request-Id: ' . $requestId,
],
'content' => json_encode([
'documentId' => 'me',
'variables' => new stdClass(),
]),
],
]));
async function api(documentId, variables = {}) {
return fetch('/graphql', {
method: 'POST',
headers: {
'Accept-Language': 'en',
'Content-Type': 'application/json',
'X-Project-Context': projectConfig.identity.contextToken,
'X-Request-Id': requestId,
},
body: JSON.stringify({documentId, variables}),
}).then((response) => response.json());
}
using System.Net.Http.Headers;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://project.example/graphql");
request.Headers.AcceptLanguage.ParseAdd("en");
request.Headers.Add("X-Project-Context", projectContextToken);
request.Headers.Add("X-Request-Id", requestId);
request.Content = new StringContent(
"""{"documentId":"me","variables":{}}""",
Encoding.UTF8,
"application/json"
);
using var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
let client = reqwest::Client::new();
let response = client
.post("https://project.example/graphql")
.header("Accept-Language", "en")
.header("Content-Type", "application/json")
.header("X-Project-Context", project_context_token)
.header("X-Request-Id", request_id)
.json(&serde_json::json!({
"documentId": "me",
"variables": {}
}))
.send()
.await?;
let data: serde_json::Value = response.json().await?;
package main
import (
"bytes"
"encoding/json"
"net/http"
)
func main() {
payload, _ := json.Marshal(map[string]any{
"documentId": "me",
"variables": map[string]any{},
})
request, _ := http.NewRequest("POST", "https://project.example/graphql", bytes.NewReader(payload))
request.Header.Set("Accept-Language", "en")
request.Header.Set("Content-Type", "application/json")
request.Header.Set("X-Project-Context", projectContextToken)
request.Header.Set("X-Request-Id", requestId)
response, err := http.DefaultClient.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
}
import requests
response = requests.post(
"https://project.example/graphql",
headers={
"Accept-Language": "en",
"Content-Type": "application/json",
"X-Project-Context": project_context_token,
"X-Request-Id": request_id,
},
json={
"documentId": "me",
"variables": {},
},
)
data = response.json()
The API honors Accept-Language quality weights and regional tags. If the project does not publish a matching language, it falls back to the profile language, project language, or en.