> ## Documentation Index
> Fetch the complete documentation index at: https://docs.learningcommons.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting started

> Get started with the Knowledge Graph GraphQL API by learning the base URL, authentication requirements, and making your first request with code examples in cURL, Python, and JavaScript.

export const GatedCallout = ({children}) => <div className="eyebrow-callout not-prose rounded-xl border border-gray-200/80 p-5 dark:border-white/10" style={{
  marginBottom: "1rem",
  borderRadius: "4px"
}}>
    <div className="mb-3">
      <Badge color="orange" size="md" icon="lock">
        Gated
      </Badge>
    </div>
    <div className="callout-body text-[15px] leading-relaxed text-gray-700 dark:text-gray-300">{children}</div>
    <style>{`.callout-body a { text-decoration: underline; text-decoration-color: #178251; }`}</style>
  </div>;

export const EarlyAccessCallout = ({children}) => <div className="eyebrow-callout not-prose rounded-xl border border-gray-200/80 p-5 dark:border-white/10" style={{
  marginBottom: "1rem",
  borderRadius: "4px"
}}>
    <div className="mb-3">
      <Badge color="green" size="md" icon="flask">
        Early access
      </Badge>
    </div>
    <div className="callout-body text-[15px] leading-relaxed text-gray-700 dark:text-gray-300">{children}</div>
    <style>{`.callout-body a { text-decoration: underline; text-decoration-color: #178251; }`}</style>
  </div>;

<GatedCallout>
  Access to this resource is restricted and requires prior approval. In some cases, a license may also be required. Contact [support@learningcommons.org ↗](mailto:support@learningcommons.org) for information about access and eligibility.
</GatedCallout>

## Base URL

All GraphQL queries should be sent to the root endpoint:

```text theme={null}
POST https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql
```

## Authentication

All requests require authentication using an API key included in the request headers:

`x-api-key: YOUR_API_KEY`

<Warning>
  An API key for the GraphQL endpoint will be securely shared with you separately.
</Warning>

## Making your first request

Here are simple examples to get you started.

We recommend using the `gql` library for better GraphQL support, schema validation, and error handling.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST \
    -H 'Content-Type: application/json' \
    -H 'x-api-key: YOUR_API_KEY' \
    -d '{"query":"{ courses(limit: 5) { identifier name academicSubject } }"}' \
    https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql
  ```

  ```python Python theme={null}
  pip install gql[requests]

  import os
  from gql import Client, gql
  from gql.transport.requests import RequestsHTTPTransport

  # Setup client
  transport = RequestsHTTPTransport(
      url="https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql",
      headers={"x-api-key": os.getenv("API_KEY")},  # Your API key from 1Password
      use_json=True,
  )

  client = Client(transport=transport, fetch_schema_from_transport=False)

  # Execute query
  query = gql("""
  {
    courses(limit: 5) {
      identifier
      name
      academicSubject
    }
  }
  """)

  result = client.execute(query)
  print(result)
  ```

  ```javascript JavaScript theme={null}
  const url = "https://cumtxmqb68.execute-api.us-west-2.amazonaws.com/staging/v1.0.0/graphql";
  const apiKey = process.env.API_KEY; // Your API key from 1Password

  const query = `
  {
    courses(limit: 5) {
      identifier
      name
      academicSubject
    }
  }
  `;

  fetch(url, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': apiKey
    },
    body: JSON.stringify({ query })
  })
  .then(response => response.json())
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));
  ```
</CodeGroup>

These examples will return up to 5 courses, along with their identifiers, names, and academic subjects.
