Skip to main content

Error code reference

Response structure​

Standard APIs return:

{
"code": 40013,
"msg": "Signature verification failed. Please check the authentication parameters.",
"data": null
}
FieldDescription
codeBusiness code. 200 on success; on failure, one of the error codes below
msgError description that can be shown directly to the caller
dataBusiness data on success; usually null on failure
HTTP status and business codes

Most gateway business errors (authentication failure, no permission, IP blocking, WAF blocking) return HTTP 200; you need to read code to determine the result. Exceptions: authentication/authorization failures for authType=jwt return 401/403/503; flow control returns 429, circuit breaking returns 503, downstream unavailable returns 503, and timeout returns 504.

The code output by the gateway's top-level exception handler is a string (such as "50001"), while filters and business APIs usually output numeric values. Clients should handle both strings and numbers when parsing.

Authentication and authorization (40001–40033)​

Error codeMessageCommon causesTroubleshooting advice
40001API not found or offlinePath/method mismatch, API not released, route not syncedVerify the release environment and path prefix; check the gateway routes
40002Authentication failed: the app has no permission for the APIThe API is not authorized to the appGrant authorization in app authorization or approval
40003The API authorization has expiredThe authorization is time-limited and has expiredRenew it or switch to permanent authorization
40006The API is offlineThe release snapshot was taken offlineBring it online again and sync the environment
40007The API call count has reached the limitAuthorization/subscription quota exhaustedAdjust the quota or retry the next day
40008X-AppKey in the header cannot be emptySimple authentication without an AppKeyAdd X-AppKey
40009Authentication parameters cannot be emptySignature authentication missing AppKey/Timestamp/SignProvide all four authentication headers
40010Timestamp expired / nonce invalidTime skew over 10 minutes, or nonce replayCalibrate the clock; generate a new nonce for each request
40012The IP address is not in the valid rangeAPI-level IP rule blockedCheck the rule type (allow/deny list) and the client egress IP
40013Signature verification failedWrong AppSecret, incorrect sign string construction, algorithm mismatchCheck each item against the signature guide
40018The IP address is not in the authentication authorization rangeApp credential-level IP whitelist blockedAdd the egress IP in the app configuration
40019App disabledThe app has been disabledEnable the app
40020MCP is not enabled for this appAccessing /mcp/{appCode} but MCP is not enabled for the appEnable MCP in the app settings
40021Subscription expired or frozenSubscription expired, unsubscribed, or frozenCheck the subscription status and validity period
40022The target address is not allowedProxy mode target hit the outbound blacklistAdjust the target address or security policy
40023Subscription daily call quota exceededSubscription daily quota exhaustedRetry the next day or adjust the quota
40024Authorization header must not be emptyAn oauth2 API call has no Authorization: Bearer <token>, or the Bearer prefix is misspelledExchange a token at /oauth2/token first, then add the header
40025Token invalid or expiredToken expired, tampered with, issued by another environment, or the app was deletedExchange a new token and verify the environment the token came from
40026Token revoked, please obtain a new oneThe token was revoked (server-side session deleted)Exchange a new token
40028Authorization header is missing the Bearer tokenA JWT API call has no Authorization header, or the value is emptyAdd Authorization: Bearer <token>
40029JWT invalid or expiredInvalid signature, iss, aud, exp, typ, kid, or claims; malformed Authorization headerCheck each requirement in Enterprise IdP JWT authentication
40030Identity provider temporarily unavailable, please retry laterJWT is disabled, or the IdP / JWKS is unreachableCheck apigo.jwt.enabled and IdP connectivity; retry after Retry-After
40031JWT subject is not bound to any appThe token subject does not match the credential bindingConfigure JWT identity binding on the credential and confirm the subject matches exactly
40032Insufficient JWT scopeThe scope requirement is not met (reserved)Check the scopes issued by the IdP
40033This app is bound to an enterprise identity; static credentials are disabledAn app bound to JWT still calls with X-AppKey / appSecret while the switch is onUse the Bearer token issued by the IdP, or turn off apigo.jwt.disable-static-credentials-for-bound-apps

The /oauth2/token endpoint does not use the codes above; it returns OAuth2 standard errors (invalid_request / unsupported_grant_type / invalid_client / server_error). See OAuth2 client credentials authentication.

JWT authentication (authType=jwt) uses standard HTTP semantics: 401 (missing/invalid token), 403 (subject unbound/app disabled/IP/not authorized), and 503 (IdP unavailable). The body still uses {code,msg} and may additionally include error / error_description and WWW-Authenticate. API-not-found and API-offline are evaluated before authentication and still return HTTP 200. See Enterprise IdP JWT authentication.

401/402 semantics: 401 means the login session has expired, and 402 means the user is not logged in. Both apply to admin JWT sessions and do not appear in the open API signature flow.

Parameters and SQL (41000–41013)​

Error codeMessageDescription
41000Required parameter cannot be emptyA required parameter defined by the API is missing
41006The API path is already in usePath + method conflict on save (the admin also returns 50011)
41007At least one of the multi-select parameters must be providedParameter validation rule not satisfied
41008Invalid request parameter value formatType conversion failed, e.g. text passed for a numeric parameter
41009Only one of the mutually exclusive parameters may be providedMutually exclusive parameters provided together
41010Pagination parameters cannot be emptyPagination API missing the page number or page size
41011Invalid request parameter nameThe parameter name uses a runtime reserved word
41012Invalid SQL interpolation parameterUnsafe ${} interpolation used; change to #{} prepared statements
41013Orchestration rule validation failedInvalid field orchestration configuration in LAYOUT mode
40011SQL execution failedSQL syntax error, missing table/field, data source connection error
40014SQL contains special charactersCharacters such as - not wrapped in double quotes
40015Operation type not supportedThe current mode does not support the operation (e.g. a non-query SQL going through the cache)
40016Third-party API call failedThe proxy target returned an error or the connection failed

System and data sources (5xxxx)​

Error codeMessageDescription
50001System busyUnified fallback for uncaught exceptions
50002System upgradingService maintenance state
50003Downstream service instance connection errorExecution service unreachable
50004API response timeoutDownstream processing timeout
50010Login failed, please check the database connectionQuerying the user failed during login
50011The API path already existsPath conflict when saving the API
51001Data source initialization failedConnection pool creation failed
51002Failed to query the schema / index listData source configuration or permission issue
51003Plugin name cannot be emptyDriver getName() returned empty
51004Plugin name already existsTwo drivers registered the same type name
51005Failed to query indexesMetadata read failed
52005Missing request parametersMissing required parameters during SQL construction
55000Plugin exceptionInternal error in the data source driver
44001Null pointer exceptionNull pointer in the gateway processing chain; check the logs
45001Database password decryption failedThe data source password ciphertext does not match the key

Permissions and operations (43xxx)​

Error codeMessageDescription
43000Invalid operationThe operation is not allowed in the current state
43001Invalid APIThe API does not exist or has been deleted
43002API already released, take it offline firstReleased APIs cannot be edited directly
43003No operation permissionThe current user has no permission on the project/resource

MCP protocol errors​

The MCP endpoint returns JSON-RPC 2.0 error objects and does not use the {code,msg,data} structure:

{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32602,
"message": "Invalid params"
}
}
Error codeMeaningScenario
-32600Invalid RequestThe request body is not valid JSON-RPC, or the method name is missing
-32601Method Not FoundCalled an unimplemented method
-32602Invalid ParamsMissing parameters, type errors, tool not authorized
-32603Internal ErrorTool execution failed, insufficient permission, response body too large, gateway internal error

When an MCP request is rate limited or circuit-broken, the HTTP status is 429 or 503 respectively, and the response body remains a JSON-RPC error object.

License errors (L001–L015)​

License validation failures block service startup or trigger an exit. For error codes, see Deployment topology and License.

Troubleshooting order​

  1. Check the HTTP status first: for 429 check flow control rules, for 503 check circuit breaking and instance health, for 504 check the timeout configuration.
  2. Then check the business code: for authentication errors (400xx), verify AppKey/signature/IP first; for parameter errors (410xx), verify the input parameters and types.
  3. Use the traceId: the X-TraceId response header can be used to locate the full request chain in the call logs.
  4. Confirm the release state: 40001 and 40006 are usually caused by an unsynced environment or an API that is not online.
  5. Check runtime sync: if rule or route changes do not take effect, run a manual reconciliation.