AWorld Lab
About
API Reference
API Reference
  • App API
  • Dashboard API
  • Overview
API Download
API Download
  • App API
  • Dashboard API
AWorld.orgAWorld Trust
About
API Reference
API Reference
  • App API
  • Dashboard API
  • Overview
API Download
API Download
  • App API
  • Dashboard API
AWorld.orgAWorld Trust
AWorld.org
  1. API Overview
  • AWorld Lab
    • Engagement for Businesses and Organizations
    • API-first for Gamification
    • Gamification Features and Mechanics
    • Infrastructure and Technology
    • Technical Details
  • API Overview
    • Getting Started
    • Multi-Tenancy
    • Workspaces
    • Authentication
    • Common Features
    • API Reference
      • App API Reference (Consumer)
        • ActivityLogs
          • Create activity log
        • Analytics
          • Get community metrics
        • Learning Paths
          • Items
            • List learning path items
          • List learning paths
          • Get learning path by ID
        • Learning Groups
          • Tags
            • List learning group tag assignments
            • Get learning group tag assignment
          • Translation
            • Get learning group translation
          • List learning groups
          • Get learning group by ID
        • Learning Path Assignments
          • Items
            • List learning path assignment items
          • Tags
            • List learning path assignment tags
            • Get learning path assignment tag by ID
          • Translation
            • Get learning path assignment translation
          • List learning path assignments
          • Get learning path assignment by ID
        • Missions
          • List missions
          • Get mission
        • Quizzes
          • Tags
            • List quiz tags
            • Get quiz tag by ID
          • Translation
            • Get quiz translation
          • List quizzes
          • Get quiz by ID
          • Submit quiz answers
        • Runtime Leaderboards
          • List runtime leaderboards
          • Get a runtime leaderboard by ID
          • Get leaderboard rankings
          • Get current user's ranking
        • Slides
          • TagAssignments
            • List slide tags
            • Get slide tag by ID
          • Translation
            • Get slide translation
          • List slides
          • Get slide by ID
          • Submit slide completion
        • Stories
          • TagAssignments
            • List story tags
            • Get story tag by ID
          • Translation
            • Get story translation
          • List stories
          • Get story by ID
          • Submit story completion
        • Streaks
          • List streaks
        • Users
          • Tags
            • List current user tags
            • Get current user tag by ID
          • Get current user
          • Get current user principal
          • Update current user
          • Get current user learning stats
        • VirtualBalances
          • List virtual balances
          • Get virtual balance by currency ID
        • VirtualTransactions
          • List virtual transactions
          • Create virtual transaction
          • Get virtual transaction by ID
          • Redeem virtual transaction
        • WorkspaceConfiguration
          • Get workspace configuration
      • Dashboard API Reference (Admin)
        • Activities
          • Tags
            • List activity tag assignments
            • Create multiple activity tag assignments
            • Update multiple activity tag assignments
            • Delete multiple activity tag assignments
            • Get activity tag assignment
            • Create activity tag assignment
            • Update activity tag assignment
            • Delete activity tag assignment
          • Translations
            • List activity translations
          • List activities
          • Create activity
          • Get activity by ID
          • Update activity
          • Publish an activity
        • Analytics
          • Get content analytics
          • Get economy analytics
          • Get engagement analytics
          • Get gamification analytics
          • Get learning analytics
          • Get analytics overview
          • Get quiz analytics
        • Learning Paths
          • Items
            • List learning group items
            • List learning path items
          • Tags
            • List learning path tag assignments
            • Create multiple learning path tag assignments
            • Update multiple learning path tag assignments
            • Delete multiple learning path tag assignments
            • Get learning path tag assignment
            • Create learning path tag assignment
            • Update learning path tag assignment
            • Delete learning path tag assignment
          • Translations
            • List learning path translations
          • List learning paths
          • Create learning path
          • Get learning path by ID
          • Update learning path
          • Publish learning path
        • Learning Groups
          • Tags
            • List learning group tag assignments
            • Create multiple learning group tag assignments
            • Update multiple learning group tag assignments
            • Delete multiple learning group tag assignments
            • Get learning group tag assignment
            • Create learning group tag assignment
            • Update learning group tag assignment
            • Delete learning group tag assignment
          • Translations
            • List learning group translations
          • List learning groups
          • Create learning group
          • Get learning group by ID
          • Update learning group
          • Publish learning group
        • LearningPathRules
          • List learning path rules
          • Create learning path rule
          • Get learning path rule by ID
          • Update learning path rule
          • Publish learning path rule
        • LearningPathAssignments
          • List learning path assignments
          • Create learning path assignment (manual)
          • Get learning path assignment by ID
        • Missions
          • Create mission (manual)
        • MissionRules
          • Tags
            • List mission rule tag assignments
            • Create multiple mission rule tag assignments
            • Update multiple mission rule tag assignments
            • Delete multiple mission rule tag assignments
            • Get mission rule tag assignment
            • Create mission rule tag assignment
            • Update mission rule tag assignment
            • Delete mission rule tag assignment
          • Translations
            • List mission rule translations
          • List mission rules
          • Create mission rule
          • Get mission rule by ID
          • Update mission rule
          • Publish mission rule
        • MissionConfigurations
          • Tags
            • List mission configuration tag assignments
            • Create multiple mission configuration tag assignments
            • Update multiple mission configuration tag assignments
            • Delete multiple mission configuration tag assignments
            • Create mission configuration tag assignment
            • Update mission configuration tag assignment
            • Delete mission configuration tag assignment
            • Get mission configuration tag assignment
          • Translations
            • List mission configuration translations
          • List mission configurations
          • Create mission configuration
          • Get mission configuration by ID
          • Update mission configuration
          • Publish mission configuration
        • Mobility
          • Get mobility activation
          • Update mobility activation
          • List mobility milestones
          • Get mobility milestone
          • Redeem mobility milestone
          • Get MotionTag status
          • Get MotionTag token
          • List mobility trackings
          • List mobility activations
          • Create mobility activation
        • Media
          • Tags
            • List media tag assignments
            • Create multiple media tag assignments
            • Update multiple media tag assignments
            • Delete multiple media tag assignments
            • Get media tag assignment
            • Create media tag assignment
            • Update media tag assignment
            • Delete media tag assignment
        • MediaLibrary
          • Translations
            • List media translations
          • List media files
          • Get presigned upload URL
          • Get media file by ID
          • Update media file metadata
          • Delete media file
        • Quizzes
          • Translations
            • List quiz translations
          • Tags
            • List quiz tag assignments
            • Create multiple quiz tag assignments
            • Update multiple quiz tag assignments
            • Delete multiple quiz tag assignments
            • Get quiz tag assignment
            • Create quiz tag assignment
            • Update quiz tag assignment
            • Delete quiz tag assignment
          • List quizzes
          • Create quiz
          • Get quiz by ID
          • Update quiz
          • Publish quiz
        • RewardRules
          • List reward rules
          • Create reward rule
          • Get reward rule by ID
          • Update reward rule
          • Publish reward rule
        • Runtime Leaderboards
          • Create a runtime leaderboard
          • List runtime leaderboards
          • Get a runtime leaderboard by ID
          • Update a runtime leaderboard
        • RuntimeLeaderboardConfigurations
          • List runtime leaderboard configurations
          • Create a new runtime leaderboard configuration
          • Get runtime leaderboard configuration by ID
          • Update a runtime leaderboard configuration
          • Create a new runtime leaderboard instance
          • List translations for a runtime leaderboard configuration
        • Slides
          • Tags
            • List slide tag assignments
            • Create multiple slide tag assignments
            • Update multiple slide tag assignments
            • Delete multiple slide tag assignments
            • Get slide tag assignment
            • Create slide tag assignment
            • Update slide tag assignment
            • Delete slide tag assignment
          • Translations
            • List slide translations
          • List slides
          • Create slide
          • Get slide by ID
          • Update slide
          • Publish slide
        • Stories
          • Tags
            • List story tag assignments
            • Create multiple story tag assignments
            • Update multiple story tag assignments
            • Delete multiple story tag assignments
            • Get story tag assignment
            • Create story tag assignment
            • Update story tag assignment
            • Delete story tag assignment
          • Translations
            • List story translations
            • List story translations
          • List stories
          • Create story
          • Get story by ID
          • Update story
          • Publish story
        • StreakConfigurations
          • Tags
            • List streak configuration tag assignments
            • Create multiple streak configuration tag assignments
            • Update multiple streak configuration tag assignments
            • Delete multiple streak configuration tag assignments
            • Get streak configuration tag assignment
            • Create streak configuration tag assignment
            • Update streak configuration tag assignment
            • Delete streak configuration tag assignment
          • Translations
            • List streak configuration translations
          • List streak configurations
          • Create streak configuration
          • Get streak configuration by ID
          • Update streak configuration
          • Publish streak configuration
        • StreakRules
          • Tags
            • List streak rule tag assignments
            • Create multiple streak rule tag assignments
            • Update multiple streak rule tag assignments
            • Delete multiple streak rule tag assignments
            • Get streak rule tag assignment
            • Create streak rule tag assignment
            • Update streak rule tag assignment
            • Delete streak rule tag assignment
          • Translations
            • List streak rule translations
          • Create streak rule
          • List streak rules
          • Get streak rule by ID
          • Update streak rule
          • Publish streak rule
        • Tags
          • Translations
            • List tag translations
          • Create tag
          • List all tags
          • Get tag by ID
          • Update tag
          • Publish tag
        • Users
          • Tags
            • List user tag assignments
            • Create multiple user tag assignments
            • Update multiple user tag assignments
            • Delete multiple user tag assignments
            • Get user tag assignment
            • Create user tag assignment
            • Update user tag assignment
            • Delete user tag assignment
          • Create user
          • List users
          • Get user by external ID
          • Get current user
          • Get user by ID
          • Get current user principal
          • Update user by ID
          • Delete (anonymise) user by ID
        • VirtualCurrencies
          • Translations
            • List streak rule translations
          • Create virtual currency
          • List virtual currencies
          • Get virtual currency
          • Update virtual currency
          • Publish virtual currency
        • VirtualTransactions
          • Create Virtual Transaction
        • WorkspaceConfiguration
          • Get workspace configuration
          • Update workspace configuration
          • Delete workspace configuration
          • Publish workspace configuration
  • Schemas
    • App Schemas
      • Schemas
      • CommunityMetricsResponse
      • GetCurrentUserTagResponse
      • GetCurrentUserStatsResponse
      • GetQuizTagResponse
      • GetQuizTranslationResponse
      • GetStoryTagResponse
      • GetLearningGroupTranslationResponse
      • GetStoryTranslationResponse
      • GetVirtualBalanceResponse
      • GetLearningPathAssignmentTagResponse
      • GetVirtualTransactionResponse
      • GetLearningPathAssignmentTranslationResponse
      • GetMissionResponse
      • ListCurrentUserTagAssignmentsResponse
      • ListMissionsResponse
      • GetRuntimeLeaderboardRankingsMeResponse
      • GetRuntimeLeaderboardRankingsResponse
      • ListStreaksResponse
      • ListVirtualBalancesResponse
      • GetSlideTagResponse
      • ListVirtualTransactionsResponse
      • GetSlideTranslationResponse
      • RedeemVirtualTransactionResponse
      • SubmitQuizResponse
      • SubmitStoryResponse
      • ListLearningPathAssignmentItemsResponse
      • ListLearningPathAssignmentTagsResponse
      • SubmitSlideResponse
      • UpdateCurrentUserResponse
    • Dashboard Schemas
      • Schemas
        • CreateActivityResponse
        • CreateVirtualTransactionResponse
        • GetMobilityActivationResponse
        • GetQuizResponse
        • GetStoryResponse
        • JsonLogicExpression
        • Lang
        • ListQuizTagAssignmentsResponse
        • ListQuizzesResponse
        • ListStoriesResponse
        • ListStoryTagAssignmentsResponse
        • SourceRegion
        • Timezone
        • UpdateMobilityActivationResponse
      • CreateActivityResponse
      • ActivityTranslation
      • CreateVirtualTransactionResponse
      • ActivityWithResolvedFields
      • GetCurrentUserPrincipalResponse
      • ContentAnalyticsResponse
      • GetCurrentUserResponse
      • CreateActivityTagAssignmentResponse
      • CreateActivityTagAssignmentsResponse
      • GetQuizResponse
      • CreateMissionConfigurationResponse
      • CreateMissionConfigurationTagAssignmentResponse
      • CreateLearningGroupResponse
      • CreateMissionConfigurationTagAssignmentsResponse
      • GetLearningGroupResponse
      • CreateLearningGroupTagAssignmentResponse
      • GetStoryResponse
      • CreateMissionResponse
      • GetLearningGroupTagAssignmentResponse
      • CreateLearningGroupTagAssignmentsResponse
      • CreateMissionRuleResponse
      • CreateLearningPathAssignmentResponse
      • CreateMissionRuleTagAssignmentResponse
      • GetLearningPathAssignmentResponse
      • CreateLearningPathResponse
      • CreateMissionRuleTagAssignmentsResponse
      • CreateLearningPathRuleResponse
      • CreateQuizResponse
      • CreateLearningPathTagAssignmentResponse
      • JsonLogicExpression
      • CreateQuizTagAssignmentResponse
      • GetLearningPathResponse
      • CreateLearningPathTagAssignmentsResponse
      • Lang
      • CreateQuizTagAssignmentsResponse
      • CreateMediaTagAssignmentResponse
      • CreateRewardRuleResponse
      • CreateMediaTagAssignmentsResponse
      • CreateStoryResponse
      • ListQuizTagAssignmentsResponse
      • CreateStoryTagAssignmentResponse
      • ListQuizzesResponse
      • CreateStoryTagAssignmentsResponse
      • ListStoriesResponse
      • CreateStreakConfigurationResponse
      • ListStoryTagAssignmentsResponse
      • CreateStreakConfigurationTagAssignmentResponse
      • GetRuntimeLeaderboardResponse
      • CreateStreakConfigurationTagAssignmentsResponse
      • GetSlideResponse
      • CreateStreakRuleResponse
      • CreateTagResponse
      • CreateMobilityActivationResponse
      • CreateUserResponse
      • SourceRegion
      • CreateVirtualCurrencyResponse
      • DeleteMissionConfigurationTagAssignmentResponse
      • Timezone
      • DeleteMissionConfigurationTagAssignmentsResponse
      • CreateRuntimeLeaderboardConfigurationRequest
      • DeleteMissionRuleTagAssignmentResponse
      • GetWorkspaceConfigurationResponse
      • CreateRuntimeLeaderboardConfigurationResponse
      • DeleteMissionRuleTagAssignmentsResponse
      • CreateRuntimeLeaderboardInstanceRequest
      • DeleteQuizTagAssignmentResponse
      • CreateRuntimeLeaderboardInstanceResponse
      • DeleteQuizTagAssignmentsResponse
      • CreateRuntimeLeaderboardResponse
      • DeleteStoryTagAssignmentResponse
      • ListLearningGroupItemsResponse
      • CreateSlideResponse
      • DeleteStoryTagAssignmentsResponse
      • ListLearningGroupsResponse
      • CreateSlideTagAssignmentResponse
      • DeleteStreakConfigurationTagAssignmentResponse
      • ListLearningGroupTagAssignmentsResponse
      • CreateSlideTagAssignmentsResponse
      • DeleteStreakConfigurationTagAssignmentsResponse
      • DeleteUserResponse
      • ListLearningPathAssignmentsResponse
      • GetActivityResponse
      • GetActivityTagAssignmentResponse
      • ListLearningPathsResponse
      • GetMissionConfigurationResponse
      • GetMissionConfigurationTagAssignmentResponse
      • GetMissionRuleResponse
      • GetMissionRuleTagAssignmentResponse
      • ListRuntimeLeaderboardsResponse
      • ListSlidesResponse
      • GetMobilityMilestoneResponse
      • ListSlideTagAssignmentsResponse
      • GetMotionTagStatusResponse
      • GetMotionTagTokenResponse
      • DeleteLearningGroupTagAssignmentResponse
      • DeleteLearningGroupTagAssignmentsResponse
      • GetQuizTagAssignmentResponse
      • DeleteLearningPathTagAssignmentResponse
      • GetRewardRuleResponse
      • DeleteLearningPathTagAssignmentsResponse
      • DeleteMediaResponse
      • GetStoryTagAssignmentResponse
      • DeleteMediaTagAssignmentResponse
      • GetStreakConfigurationResponse
      • DeleteMediaTagAssignmentsResponse
      • GetStreakConfigurationTagAssignmentResponse
      • GetStreakRuleResponse
      • GetStreakRuleTagAssignmentResponse
      • GetTagResponse
      • GetUserByExternalIdResponse
      • GetUserResponse
      • GetUserTagAssignmentResponse
      • DeleteSlideTagAssignmentResponse
      • GetVirtualCurrencyResponse
      • DeleteSlideTagAssignmentsResponse
      • ListActivitiesResponse
      • ListActivityTagAssignmentsResponse
      • ListActivityTranslationsResponse
      • ListMissionConfigurationsResponse
      • DeleteWorkspaceConfigurationResponse
      • ListMissionConfigurationTagAssignmentsResponse
      • EconomyAnalyticsResponse
      • ListMissionConfigurationTranslationsResponse
      • EngagementAnalyticsResponse
      • ListMissionRulesResponse
      • GamificationAnalyticsResponse
      • ListMissionRuleTagAssignmentsResponse
      • ListMissionRuleTranslationsResponse
      • ListMobilityMilestonesResponse
      • ListMobilityTrackingsResponse
      • ListQuizTranslationsResponse
      • ListRewardRulesResponse
      • GetLearningPathRuleResponse
      • GetLearningPathTagAssignmentResponse
      • ListStoryTranslationsResponse
      • GetMediaResponse
      • ListStreakConfigurationsResponse
      • GetMediaTagAssignmentResponse
      • ListStreakConfigurationTagAssignmentsResponse
      • ListStreakConfigurationTranslationsResponse
      • ListStreakRulesResponse
      • ListStreakRuleTranslationResponse
      • ListTagsResponse
      • ListUsersResponse
      • ListVirtualCurrenciesResponse
      • ListVirtualCurrencyTranslationResponse
      • PublishActivityResponse
      • PublishMissionConfigurationResponse
      • PublishMissionRuleResponse
      • GetRuntimeLeaderboardConfigurationResponse
      • PublishQuizResponse
      • PublishRewardRuleResponse
      • PublishStoryResponse
      • GetSlideTagAssignmentResponse
      • PublishStreakConfigurationResponse
      • PublishStreakRuleResponse
      • PublishTagResponse
      • PublishVirtualCurrencyResponse
      • RedeemMobilityMilestoneResponse
      • StreakRuleTagAssignmentsCollection
      • StreakRuleTagAssignmentsList
      • GetUploadUrlResponse
      • UpdateActivityResponse
      • UpdateActivityTagAssignmentResponse
      • UpdateActivityTagAssignmentsResponse
      • UpdatedStreakRuleTagAssignmentsCollection
      • UpdatedUserTagAssignmentsCollection
      • UpdateMissionConfigurationResponse
      • UpdateMissionConfigurationTagAssignmentResponse
      • LearningAnalyticsResponse
      • UpdateMissionConfigurationTagAssignmentsResponse
      • UpdateMissionRuleResponse
      • UpdateMissionRuleTagAssignmentResponse
      • UpdateMissionRuleTagAssignmentsResponse
      • UpdateQuizResponse
      • UpdateQuizTagAssignmentResponse
      • ListLearningGroupTranslationsResponse
      • UpdateQuizTagAssignmentsResponse
      • UpdateRewardRuleResponse
      • ListLearningPathItemsResponse
      • UpdateStoryResponse
      • ListLearningPathRulesResponse
      • UpdateStoryTagAssignmentResponse
      • UpdateStoryTagAssignmentsResponse
      • ListLearningPathTagAssignmentsResponse
      • UpdateStreakConfigurationResponse
      • ListLearningPathTranslationsResponse
      • UpdateStreakConfigurationTagAssignmentResponse
      • ListMediaResponse
      • UpdateStreakConfigurationTagAssignmentsResponse
      • ListMediaTagAssignmentsResponse
      • UpdateStreakRuleResponse
      • ListMediaTranslationsResponse
      • UpdateStreakRuleTagAssignmentResponse
      • UpdateTagResponse
      • UpdateUserTagAssignmentResponse
      • UpdateVirtualCurrencyResponse
      • UserTagAssignmentsCollection
      • UserTagAssignmentsList
      • ListMobilityActivationsResponse
      • ListRuntimeLeaderboardConfigurationsResponse
      • ListRuntimeLeaderboardConfigurationTranslationsResponse
      • ListSlideTranslationsResponse
      • ListTagTranslationsResponse
      • MediaTranslation
      • MediaWithResolvedFields
      • OverviewAnalyticsResponse
      • PublishLearningGroupResponse
      • PublishLearningPathResponse
      • PublishLearningPathRuleResponse
      • PublishSlideResponse
      • PublishWorkspaceConfigurationResponse
      • QuizAnalyticsResponse
      • UpdateLearningGroupResponse
      • UpdateLearningGroupTagAssignmentResponse
      • UpdateLearningGroupTagAssignmentsResponse
      • UpdateLearningPathResponse
      • UpdateLearningPathRuleResponse
      • UpdateLearningPathTagAssignmentResponse
      • UpdateLearningPathTagAssignmentsResponse
      • UpdateMediaResponse
      • UpdateMediaTagAssignmentResponse
      • UpdateMediaTagAssignmentsResponse
      • UpdateRuntimeLeaderboardConfigurationRequest
      • UpdateRuntimeLeaderboardConfigurationResponse
      • UpdateRuntimeLeaderboardResponse
      • UpdateSlideResponse
      • UpdateSlideTagAssignmentResponse
      • UpdateSlideTagAssignmentsResponse
      • UpdateUserResponse
      • UpdateWorkspaceConfigurationResponse
About
API Reference
API Reference
  • App API
  • Dashboard API
  • Overview
API Download
API Download
  • App API
  • Dashboard API
AWorld.orgAWorld Trust
About
API Reference
API Reference
  • App API
  • Dashboard API
  • Overview
API Download
API Download
  • App API
  • Dashboard API
AWorld.orgAWorld Trust
AWorld.org
  1. API Overview

Common Features

This page documents common features and behaviors shared across all AWorld API contexts (Consumer/App, Admin/Dashboard, and Portal). Refer to the specific context documentation for context-specific details.

Authentication Basics#

All AWorld APIs require authentication using a valid access token. Requests must include an Authorization header:
Authorization: Bearer YOUR_ACCESS_TOKEN
For information on obtaining access tokens, see the Authentication.

Custom Claims#

AWorld APIs use custom claims in the access token to enforce permissions and operations. When performing a sign-in, all necessary custom claims are automatically included in the access token.
Each context requires specific claims:
App Context: accountId, workspaceId, principalId, userId, and others
Dashboard Context: accountId, workspaceId, principalId, userId, and others
Portal Context: principalId and others
Refer to each context's documentation for specific claim requirements.

Machine-to-Machine (M2M) Flows#

APIs can be invoked in machine-to-machine (M2M) flows using client credentials. The implementation details vary by context:
App and Dashboard Contexts: Requires the x-user-id header to impersonate a user
Portal Context: Operates at the platform level with principal-level permissions
See the specific context documentation for detailed implementation guidance.

API Versioning#

GraphQL#

GraphQL APIs typically use a rolling updates approach without formal versioning until breaking changes occur. This allows the API to evolve while maintaining backward compatibility. During this pre-alpha stage, more significant changes may occur, but once stable, changes will follow the rolling approach.

REST#

REST APIs (when published) will use explicit versioning (e.g., v1, v2). The version numbers will be aligned with GraphQL whenever REST requires updates.

API Features#

Caching#

Queries (read-only operations) leverage an internal caching mechanism to improve performance. This means that repeated identical queries may return faster as they might be served from cache.

Idempotency#

Most operations that cause side effects (like creating resources) are idempotent, and their results are cached temporarily for up to 5 minutes. This provides several benefits:
If you submit the same mutation multiple times concurrently or within a short time window, only the first request will be fully processed.
Subsequent identical requests within the cache period will return the same payload as the first successful call, with an additional x-idempotency-key header in the response.
This prevents duplicate resource creation and helps maintain data consistency during network issues or retries.
After the cache expires, further identical requests will be executed again, and the business logic will determine the response. For instance, attempts to create a resource after the cache has expired will likely fail because the resource already exists.

Response Compression#

To reduce payload size and improve transfer times, you can enable compression by including the following header in your requests:
Accept-Encoding: gzip

Schema Introspection#

GraphQL provides introspection capabilities that allow you to explore available operations, types, and fields. You can use standard GraphQL introspection queries to discover the schema details:
Many GraphQL clients (for example Postman) automatically provide introspection features, allowing you to browse the schema and available operations.
Note: The AWorld API is in pre-alpha stage and undergoes frequent updates. Schema introspection is a great way to discover the latest available operations.

Pagination#

List queries in AWorld support pagination through a Connection pattern with the following structure:
All operations that return paginated lists return a "Connection" that contains a list of items of the relevant type and an optional nextToken for requesting the next page.
Example query with pagination:
The pagination input typically follows this structure:
Example variables:
{
  "input": {
    "limit": 10,
    "nextToken": "eyJsYXN0SXRlbUlkIjoiMTIzNDUiLCJsYXN0SXRlbVZhbHVlIjoidGVzdCJ9"
  }
}

Pagination Guidelines#

You can specify an optional limit to control the number of items returned per page
If no limit is provided, the system will use a default value
To retrieve the next page, pass the nextToken from the previous response
Important: A nextToken is only valid when used with the same limit that was used in the original request. You should not mix tokens returned from calls with different limit values

Rate Limiting#

At pre-alpha stage, there are no rate limits applied yet.

Data Validation#

AWorld APIs employ strict validation for all data inputs to ensure consistency, security, and data integrity. Understanding these validation rules helps you build more robust integrations.

Common Types and Validation Rules#

The system enforces specific validation rules for different types of data:

Identifiers#

Account IDs, Workspace IDs: Must be exactly the specified length, containing only alphanumeric characters, underscores, and hyphens
User IDs, Principal IDs: Must be valid nanoid format
Client IDs: Non-empty string identifiers

String Data#

Names:
Must be 2-50 characters
Can contain letters from multiple scripts (Latin, Chinese, Arabic, etc.)
May include hyphens, apostrophes, and spaces
Cannot contain consecutive spaces

Timestamps#

Created/Updated At: Must be valid ISO datetime strings

Language Codes#

Language codes follow IETF language tags
Typically simple codes like "en" or "fr"
Some exceptions like Chinese which uses "zh-TW" and "zh-CN"

Timezones#

All timezone values must be valid IANA timezone identifiers (e.g., "Europe/Rome", "America/New_York")

Validation Behavior#

When validation fails, the API returns appropriate error responses with details about the validation failure. These responses include:
The field that failed validation
A description of why the validation failed
Any constraints or expected formats
This information helps you quickly identify and fix data issues in your requests.

Language Selection#

For user-facing APIs (like the App context), entities will return data and metadata in a single language. The language selection mechanism works as follows:
1.
The language is determined by the lang custom claim in the access token
2.
This claim is set automatically when a user signs in, based on their profile preferences
3.
All content will be returned in the language specified by this claim
4.
If content is not available in the requested language, it may fall back to a default language (typically English)
Important: If a user changes their language preference in their profile, the access token needs to be refreshed to retrieve content in the newly selected language. Simply changing the profile setting without getting a new token will not affect API responses.
This behavior applies to all translatable content in the system, including quiz questions and answers, UI text, and any other localized resources.

Best Practices#

1.
Use GraphQL variables for dynamic values rather than string interpolation
2.
Request only the fields you need to minimize response size and processing time
3.
Implement error handling to gracefully handle different error scenarios
4.
Use pagination for large result sets to improve performance
5.
Secure endpoints by implementing proper authorization checks
6.
Handle token refresh when user preferences change (for example, to ensure content is delivered in the preferred language, selected timezone is respected, etc)
Modified at 2025-06-26 10:29:57
Previous
Authentication
Next
App API Reference (Consumer)
Built with