# Access Token Endpoints {#access-token-endpoints}


Manage API access tokens for programmatic access.


## Base Path {#base-path}


```
/api/access-token
```


## Endpoints {#endpoints}



### List Tokens {#list-tokens}


```
GET /api/access-token
Authorization: Bearer {token}
```

Returns all access tokens for the current user/tenant.


### Create Token {#create-token}


```
POST /api/access-token
Authorization: Bearer {token}
```

**Body:**

```json
{
  "name": "CI/CD Token",
  "expiresAt": "2026-12-31T00:00:00Z",
  "scopes": ["read:employees", "write:tasks"]
}
```

**Response:**

```json
{
  "id": "uuid",
  "name": "CI/CD Token",
  "token": "gzy_xxxxxxxxxxxxxxxxxxxx",
  "expiresAt": "2026-12-31T00:00:00Z"
}
```

> **Note:** The `token` value is only shown once at creation time. Store it securely.


### Revoke Token {#revoke-token}


```
DELETE /api/access-token/:id
Authorization: Bearer {token}
```


### Update Token {#update-token}


```
PUT /api/access-token/:id
Authorization: Bearer {token}
```

```json
{
  "name": "Updated Name",
  "expiresAt": "2027-06-30T00:00:00Z"
}
```


## Token Usage {#token-usage}


Use access tokens as Bearer tokens:

```bash
curl -H "Authorization: Bearer gzy_xxxxxxxxxxxxxxxxxxxx" \
  https://api.example.com/api/employee
```


## Token Scopes {#token-scopes}


| Scope              | Description                |
| ------------------ | -------------------------- |
| `read:employees`   | Read employee data         |
| `write:employees`  | Modify employee data       |
| `read:tasks`       | Read tasks                 |
| `write:tasks`      | Create/modify tasks        |
| `read:timesheets`  | Read time entries          |
| `write:timesheets` | Create/modify time entries |
| `admin`            | Full admin access          |


## Related Pages {#related-pages}


- [Auth Endpoints](https://sourcey-gauzy.pages.dev/api/auth-endpoints/index.md) — JWT authentication
- [API Overview](https://sourcey-gauzy.pages.dev/api/overview/index.md) — API reference
