# Access Token not working

**URL:** https://forum.pirsch.io/t/access-token-not-working/90
**Category:** General
**Created:** [June 14, 2024, 6:07pm UTC](https://forum.pirsch.io/t/access-token-not-working/90 "2024-06-14T18:07:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Shubham](https://forum.pirsch.io/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Shubham](https://forum.pirsch.io/u/Shubham)
#### Post date: [June 14, 2024, 6:07pm UTC](https://forum.pirsch.io/t/access-token-not-working/90/1 "2024-06-14T18:07:04Z")

</div>

When using an access token instead of client oAuth keys getting the following error

```auto
{
  validation: null,
  error: ['token contains an invalid number of segments']
}

```

---

<div class="post-metadata">

### Author: ![Marvin](https://forum.pirsch.io/user_avatar/forum.pirsch.io/marvin/32/16_2.png) [@Marvin](https://forum.pirsch.io/u/Marvin)
#### Post date: [June 15, 2024, 9:24am UTC](https://forum.pirsch.io/t/access-token-not-working/90/2 "2024-06-15T09:24:42Z")

</div>

What endpoint did you use the access key for? The error message is a JWT (JSON Web Token) error, which is only used in the case of oAuth.

Access keys are write-only and cannot be used to read statistics.

---

<div class="post-metadata">

### Author: ![Shubham](https://forum.pirsch.io/letter_avatar_proxy/v4/letter/s/85e7bf/32.png) [@Shubham](https://forum.pirsch.io/u/Shubham)
#### Post date: [June 15, 2024, 2:06pm UTC](https://forum.pirsch.io/t/access-token-not-working/90/3 "2024-06-15T14:06:45Z")

</div>

Hi @Marvin I was using it to create a domain

```auto
POST /api/v1/domain

```

---

<div class="post-metadata">

### Author: ![Marvin](https://forum.pirsch.io/user_avatar/forum.pirsch.io/marvin/32/16_2.png) [@Marvin](https://forum.pirsch.io/u/Marvin)
#### Post date: [June 15, 2024, 2:24pm UTC](https://forum.pirsch.io/t/access-token-not-working/90/4 "2024-06-15T14:24:07Z")

</div>

Sorry, that won’t work. Access keys are write-only. For the user-level client you’ll have to use oAuth and create it on the account settings page.

> **[Pirsch Analytics Documentation](https://docs.pirsch.io/api-sdks/api-guide#accessing-the-api)**
>
> Pirsch is a simple, privacy-friendly, and open-source web analytics solution.
