مواد پر جائیں
AtheronDEVELOPERS
GraphQL

GraphQL پلے گراؤنڈ

وہی API جو REST میں ہے، جو چاہیے اس کے لیے ایک ہی درخواست۔ ٹیسٹ کلید استعمال کریں: یہ اسی ٹیب میں رہتی ہے اور ہماری API کے سوا کہیں نہیں جاتی۔

یہ کہاں ہے

  • کوئریز: POST https://developers.aton-network.org/api/graphql
  • سبسکرپشنز: wss://developers.aton-network.org/api/graphql/ws (graphql-transport-ws)
  • اسکیما، ورژن 2026-10-15: schema.graphql
  • ایونٹس اسٹریم اور ویب ہُکس: AsyncAPI تفصیل

ہر فیلڈ ایک REST کال بھی ہے، اسی حق اور اسی کوٹے کے ساتھ۔ ایک درخواست اپنی لاگت آپ کے api کوٹے سے لیتی ہے، اس لیے ایک ساتھ دو چیزیں مانگنے کی لاگت دو ہے۔

حدیں

فی درخواست آپریشنز1 (بیچنگ نہیں)
فی درخواست لاگت25 (ہمارا ڈیٹا بیس پڑھنے والی ہر فیلڈ کی لاگت 1، انٹروسپیکشن 5)
گہرائی5 سطحیں (انٹروسپیکشن کے اندر 15)
منتخب فیلڈز300، ایلیاسز اور فریگمنٹس وہیں گنے جاتے ہیں جہاں آئیں
درخواست کا سائز16 KB، 2,000 ٹوکن، ویری ایبلز 4 KB
سبسکرپشنزفی ساکٹ 5؛ ہر ایپ اور ماحول کے لیے Server-Sent Events پر 10 ایونٹ اسٹریمز، اور WebSockets پر 10

خرابیاں

ہر خرابی میں extensions.code ہوتا ہے، وہی کوڈ جو REST دیتا ہے جہاں موجود ہو۔

کوڈاسٹیٹسکیوںکیا کریں
invalid_key401کوئی API کلید نہیں بھیجی گئی، یا یہ ہماری نہیں، اس کی میعاد ختم ہو گئی یا منسوخ کر دی گئی۔درست کلید Authorization: Bearer ath_test_... یا ath_live_... کے طور پر بھیجیں (WebSocket پر، connection_init کے payload میں)۔
missing_rightڈیٹا کے ساتھکلید میں وہ حق نہیں جو کسی فیلڈ کو چاہیے۔ وہ فیلڈ null ہے؛ باقی جواب موجود ہے۔پورٹل میں اس حق (app:read, usage:read, events:read) والی کلید بنائیں، یا صرف وہی مانگیں جو یہ کلید پڑھ سکتی ہے۔
not_foundڈیٹا کے ساتھکلید والی ایپ ہٹا دی گئی ہے، یا ایونٹس کی after آئی ڈی اس ایپ کی نہیں یا 30 دن سے پرانی ہے۔ایسی ایپ کی کلید استعمال کریں جو اب بھی موجود ہو؛ 30 دن کے اندر ملی آئی ڈی سے دوبارہ شروع کریں، یا after کے بغیر شروع کریں۔
rate_limited429اس منٹ یا دن کا آپ کا api کوٹہ ختم ہو گیا۔ ہر درخواست اپنی لاگت کوٹے سے لیتی ہے؛ بہت زیادہ کھلی ایونٹ اسٹریمز پر بھی یہی جواب آتا ہے۔Retry-After میں دیے گئے سیکنڈ انتظار کریں۔ ڈیٹا بیس تک جانے والی کم فیلڈز یا کم ایلیاسز مانگیں۔
invalid_request400درخواست نہیں چل سکی: JSON نہیں، ایک بیچ (array)، نحوی خرابی، کوئی فیلڈ یا آرگیومنٹ جو اسکیما میں نہیں، operationName کے بغیر ایک سے زیادہ آپریشن، یا HTTP پر بھیجی گئی سبسکرپشن۔پیغام دیکھیں؛ اسکیما /graphql/schema.graphql پر ہے۔ ہر درخواست میں ایک آپریشن بھیجیں؛ سبسکرپشنز WebSocket پر جاتی ہیں۔
query_too_complex400کوئی حد پار ہو گئی: گہرائی، منتخب فیلڈز (ایلیاسز اور فریگمنٹس وہیں گنے جاتے ہیں جہاں آئیں)، انٹروسپیکشن کی گہرائی، یا لاگت۔درخواست کو تقسیم کریں، یا ایک بار میں کم مانگیں۔ حدیں اسی صفحے پر درج ہیں۔
persisted_query_not_found200کسی محفوظ کوئری کا ہیش ہمیں ابھی معلوم نہیں (پیغام PersistedQueryNotFound)۔وہی درخواست ہیش کے ساتھ کوئری سمیت دوبارہ بھیجیں؛ پھر یہ رکھ لی جاتی ہے، اور اس کے بعد صرف ہیش کافی ہے۔
server_errorڈیٹا کے ساتھہماری طرف کچھ غلط ہو گیا۔ اس کی تفصیل نہیں دکھائی جاتی۔تھوڑی دیر میں دوبارہ کوشش کریں۔ اگر یہ ہوتا رہے تو سپورٹ صفحے پر وقت کے ساتھ ہمیں بتائیں۔

اسکیما

"""
Atheron developer API, GraphQL, version 2026-10-15. A field is never removed or changed in a way that breaks a client without first being marked @deprecated, with the date and what replaces it, at least six months before.
"""
schema {
  query: Query
  subscription: Subscription
}

"""The developer API, version 2026-10-15. Every field is a REST call too."""
type Query {
  """
  Your application as registered, for this key's environment. Needs app:read. Same as GET /api/v1/app.
  """
  app: App

  """
  Calls, errors and latency per day and bucket, for this key's environment. Needs usage:read. Same as GET /api/v1/usage.
  """
  usage(
    """1 to 90; anything else is brought within."""
    days: Int = 7
  ): Usage
}

"""
Your application as registered, for the environment the API key belongs to. The same fields as GET /api/v1/app.
"""
type App {
  """The name people see on the consent screen."""
  name: String!

  """Where the app is: development, review or live."""
  state: String!

  """confidential (a server that keeps a secret) or public (PKCE only)."""
  kind: String!

  """The quota tier: free, growth, scale or partner."""
  quota: String!

  """The environment of this key."""
  env: Environment!

  """The OAuth client ID for this environment."""
  clientId: String!

  """The redirect addresses registered for this environment."""
  redirectUris: [String!]!

  """The scopes this environment's client may ask for."""
  scopes: [String!]!

  """The scopes review approved for live."""
  approvedScopes: [String!]!

  """Your privacy policy, shown on the consent screen."""
  privacyUrl: String

  """Your homepage, shown on the consent screen."""
  homepageUrl: String

  """Client secrets and certificates in force."""
  credentials: Int!

  """Named testers on the test client."""
  testers: Int!

  """Webhooks for this environment."""
  webhooks: Int!
}

"""Which of the app's two clients a key belongs to."""
enum Environment {
  """The test client: you, your team and up to 25 named testers."""
  TEST

  """The live client, after review."""
  LIVE
}

"""
Calls, errors and latency per day and bucket. The same answer as GET /api/v1/usage.
"""
type Usage {
  """The environment of this key."""
  env: Environment!

  """How many days the answer covers, 1 to 90."""
  days: Int!

  """One row per day and bucket, oldest first."""
  usage: [UsageDay!]!
}

"""One day and bucket of calls. Days are UTC."""
type UsageDay {
  """The day, YYYY-MM-DD, UTC."""
  day: String!

  """token, userinfo, userinfo:sensitive, api, sandbox or sign-in."""
  bucket: String!

  """Requests counted. A GraphQL request counts as its cost."""
  calls: Int!

  """Of those, how many failed."""
  errors: Int!

  """Mean time taken, in milliseconds."""
  msAvg: Int

  """Longest time taken, in milliseconds."""
  msMax: Int!
}

"""
Events as they happen, over WebSocket (graphql-transport-ws). The same events as GET /api/v1/events and your webhooks.
"""
type Subscription {
  """
  Events for this key's app and environment. Needs events:read. Same as GET /api/v1/events.
  """
  events(
    """Only these kinds. All kinds when left out."""
    types: [EventType!]

    """Resume after this event id (kept 30 days)."""
    after: ID
  ): Event!
}

"""
One event, with the same five fields a webhook delivery's body carries.
"""
type Event {
  """The event's id. Send it back as after to resume."""
  id: ID!

  """The kind of event."""
  type: EventType!

  """When it was raised, ISO 8601."""
  created: String!

  """The client it concerns."""
  clientId: String!

  """What happened."""
  data: EventData!
}

"""The kinds of event, as webhooks name them."""
enum EventType {
  USER_SIGNED_IN
  CONSENT_REVOKED
  MEMBERSHIP_CHANGED
  PING
}

"""
What happened. Which fields are present depends on the type, exactly as in a webhook's data.
"""
type EventData {
  """The person, as the sub claim your app was given. Absent for ping."""
  sub: ID

  """user.signed_in: the scopes of this sign-in."""
  scopes: [String!]

  """When it happened, ISO 8601."""
  at: String
}