---
title: Troubleshoot Optimizely Graph errors in C# SDK
slug: cms-13/docs/error-reference
docTags: 
createdAt: 2026-07-30T20:22:03.194Z
---

When a request to Optimizely Graph fails, the service returns an HTTP status code and a specific error code. These errors usually result from authentication issues, invalid queries, or unsynchronized content.

This reference lists common errors returned by Optimizely Graph, explains their typical causes, and shows how to resolve them. Use this information to diagnose problems in your queries and configuration.

:::hint{type="danger"}
**Warning**
Never include API keys or secrets when sharing error details.
:::

## HTTP errors

HTTP errors indicate problems with the request format, missing resources, or service availability.

### 400 – `BAD_REQUEST`

**Message**

Bad Request – the GraphQL request is malformed.

**Possible causes**

- The GraphQL query syntax is invalid.
- A field name is misspelled.
- The request body is not valid JSON.
- Required query parameters are missing.

**Resolution**

- Check the error response body for details about the failure.
- Validate the query syntax for missing braces, parentheses, or quotation marks.
- Confirm that all required parameters are included in the request.

### 404 – `NOT_FOUND`

**Message**

Not Found – the requested endpoint or content does not exist.

**Possible causes**

- The content has not synchronized to Optimizely Graph yet.

**Resolution**

Run the [Graph Full Synchronization](docId\:sNcLLcLYgWv_QVb0Mtqus) scheduled job in CMS. When it completes, retry your query.

### 500 – `INTERNAL_ERROR`

**Message**

Internal Server Error – service issues.

**Possible causes**

- Optimizely Graph is experiencing service issues.
- Query complexity exceeds processing limits.
- Unexpected server-side errors occur.

**Resolution**

- Simplify the query by reducing the result set or removing complex filters.
- If the issue persists, contact Optimizely Support and include the `correlation-id` value from the response header.

## Authentication errors

Authentication errors occur when credentials are missing or invalid.

### 401 – `GRAPH_AUTH_FAILED`

**Message**

Authentication failed – invalid or missing API key.

**Possible causes**

- `AppKey` or `Secret` is not configured in `appsettings.json`.
- The configured keys are incorrect.

**Resolution**

Verify that `appsettings.json` (or environment variables) contains the correct values:

```json
{
  "Optimizely": {
    "Graph": {
      "Endpoint": "https://cg.optimizely.com",
      "AppKey": "YOUR_APPKEY_HERE",
      "Secret": "YOUR_SECRET_KEY_HERE"
    }
  }
}
```

See [Authentication](docId:7S9dTMUKYWTDBF6Vs0grs) for credential setup.

## Query errors

Query errors occur when the GraphQL query syntax or field references are invalid.

### 400 – `GRAPH_QUERY_INVALID`

**Message**

Query validation failed – syntax errors in GraphQL query.

**Possible causes**

- Malformed lambda expressions in `.Where()` clauses.
- Invalid filter expressions or comparison operators.
- Incorrect method chaining order.
- Missing brackets or parentheses.

**Resolution**

- Verify all brackets and parentheses are balanced.
- Check that `.Where()` expressions use supported comparison operators.
- Confirm methods are chained in a valid order: `Where`, then `OrderBy`, then `Skip` and `Limit`, then `GetAsContentAsync`.
- Build up the query step by step to identify the problem method.

### 400 – `GRAPH_FIELD_UNKNOWN`

**Message**

Unknown field – the query references a non-existent property.

**Possible causes**

- Field name is misspelled in the query.
- Property does not exist on the content type.
- Property is not indexed in Optimizely Graph.
- Case-sensitivity mismatch (field names are case-sensitive).

**Resolution**

- Verify the exact spelling and casing of the field name.
- Confirm that the property exists on the content type.
- Confirm that the property is indexed in Optimizely Graph.
- If you recently added the property, trigger reindexing by running the [Graph Full Synchronization scheduled job](docId\:sNcLLcLYgWv_QVb0Mtqus) in CMS.
