---
title: Authentication
description: Discover how Storyblok's API authentication mechanism works through API access tokens.
url: https://storyblok.com/docs/api/graphql/getting-started/authentication
---

# Authentication

Communicating with the GraphQL endpoint requires an access token. Send authenticated requests as shown below:

```js
const url = "https://gapi.storyblok.com/v1/api";
const headers = {
 Token: "YOUR_PREVIEW_TOKEN",
 Version: "draft",
 "Content-Type": "application/json",
};
const body = JSON.stringify({
 query: "query { PageItems { items { name } } }",
});

fetch(url, {
 method: "POST",
 headers: headers,
 body: body,
})
 .then((response) => response.json())
 .then((data) => console.log(data))
 .catch((error) => console.error("Error:", error));
```

## Pagination

-   [Previous: Introduction](/docs/api/graphql)
-   [Next: Field Generation](/docs/api/graphql/getting-started/field-generation)
