DataStoreService: StudioAccessToApisNotAllowed: Studio access to APIs is not allowed.What it means in Roblox Luau and how to fix it

What it means

Studio was not allowed to reach the data store. In a test session inside Studio, data stores stay blocked until you switch on API access for the experience. Older versions of Studio printed this as an HTTP 403 error; the cause and the fix are the same.

The same error also shows up as:

  • DataStoreService: StudioAccessToApisNotAllowed: Studio access to APIs is not allowed. API: GetAsync, Data Store: Coins
  • 502: API Services rejected request with error. HTTP 403 (Forbidden)

The smallest script that triggers it

Triggers the errorline 4: error here
local DataStoreService = game:GetService("DataStoreService")
local store = DataStoreService:GetDataStore("Coins")
 
local coins = store:GetAsync("Player_1")

The fix

Fixedline 2: the fix
-- 1. Publish the place (File > Publish to Roblox)
-- 2. Game Settings > Security > Enable Studio Access to API Services
local DataStoreService = game:GetService("DataStoreService")
local store = DataStoreService:GetDataStore("Coins")
 
local ok, coins = pcall(function()
  return store:GetAsync("Player_1")
end)
if not ok then
  warn("Could not load coins: " .. tostring(coins))
end

The setting gives Studio permission to call data stores, and pcall stops a failed request from ending the script.

Common causes

  1. Enable Studio Access to API Services is switched off in Game Settings. It is off by default.
  2. The setting was switched on in a different experience. It is saved per experience, so a new place or a copy starts with it off.

Practice this until it sticks

A Deep Dive on DataStores and saving player data: 5-minute lessons, each with a quiz. What you miss comes back in the next module. One Deep Dive a day is free. No card.