---
title: "Get M2M Tokens"
method: GET
path: "/m2m_tokens"
tags: ["M2M Tokens"]
---

# Get M2M Tokens

`GET /m2m_tokens`

Fetches M2M tokens for a specific machine.

Only tokens created with the opaque token format are returned by this endpoint. JWT-format M2M tokens are stateless and are not stored.

This endpoint can be authenticated by either a Machine Secret Key or by a Clerk Secret Key.

- When fetching M2M tokens with a Machine Secret Key, only tokens associated with the authenticated machine can be retrieved.
- When fetching M2M tokens with a Clerk Secret Key, tokens for any machine in the instance can be retrieved.

## Query parameters

- `subject` string, required
- `revoked` boolean, nullable
- `expired` boolean, nullable
- `limit` number
- `offset` number, nullable

## Response `200`

200 OK

- object
  - `m2m_tokens` object[], required
    - `object` 'machine_to_machine_token', required
    - `id` string, required
    - `subject` string, required
    - `claims` unknown
    - `scopes` string[]
    - `revoked` boolean, required
    - `revocation_reason` string, nullable, required
    - `expired` boolean, required
    - `expiration` number, nullable, required — The timestamp for when the token will expire, in milliseconds
    - `last_used_at` number, nullable, required — The timestamp for when the token was last used, in milliseconds
    - `created_at` number, required — The timestamp for when the token was created, in milliseconds
    - `updated_at` number, required — The timestamp for when the token was last updated, in milliseconds
  - `total_count` number, required

## Other responses

- `400` — 400 Bad Request
- `403` — 403 Forbidden
- `404` — 404 Not Found

---

[API](https://skmtc.net/clerk/apis/clerk-backend-api.md) · [All operations](https://skmtc.net/clerk/apis/clerk-backend-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clerk/clerk-backend-api/revisions/cf036e7951d3/schema)
