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

# List API Keys

> List every API key in your workspace.

List every API key in the authenticated workspace, ordered newest first. The
response is a **JSON array** (not an object). Revoked keys are included with
`revoked_at` set, so you can render a complete audit view. Raw token secrets are
never returned.

<RequestExample>
  ```bash cURL theme={null}
  curl https://api.byteport.com/v1/tokens \
    -H "Authorization: Bearer $BYTEPORT_API_KEY" \
    -H "User-Agent: my-app/1.0"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch("https://api.byteport.com/v1/tokens", {
    headers: {
      Authorization: `Bearer ${process.env.BYTEPORT_API_KEY}`,
      "User-Agent": "my-app/1.0",
    },
  });
  const keys = await res.json(); // an array
  ```

  ```python Python theme={null}
  import os, requests

  keys = requests.get(
      "https://api.byteport.com/v1/tokens",
      headers={
          "Authorization": f"Bearer {os.environ['BYTEPORT_API_KEY']}",
          "User-Agent": "my-app/1.0",
      },
  ).json()  # a list
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  [
    {
      "id":         "9b7e2c1a-4f3d-4a2b-8c1e-2d6f5a0b7c34",
      "name":       "production-pipeline",
      "created_at": "2026-05-14T17:02:11Z"
    },
    {
      "id":         "1c2d3e4f-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
      "name":       "ci-temporary",
      "created_at": "2026-04-02T09:18:44Z",
      "expires_at": "2026-07-01T00:00:00Z",
      "revoked_at": "2026-04-20T12:00:00Z"
    }
  ]
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/tokens
openapi: 3.1.0
info:
  title: Byteport API
  description: >-
    The Byteport API lets you move, share, and manage files across every storage
    location connected to your workspace through a single HTTP interface.
  version: 1.0.0
servers:
  - url: https://api.byteport.com
security:
  - bearerAuth: []
paths:
  /v1/tokens:
    get:
      summary: List API Keys
      description: >-
        List every API key in the authenticated workspace, ordered newest first.
        Revoked keys are included (with `revoked_at` set) so you keep a full
        audit trail. Raw token secrets are never returned. The response is a
        JSON array, not an object.
      responses:
        '200':
          description: The workspace's API keys, ordered by `created_at` descending.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiKey'
        '401':
          $ref: '#/components/responses/Error'
components:
  schemas:
    ApiKey:
      type: object
      description: >-
        An API key as exposed to callers. Never includes the raw token secret or
        its hash.
      properties:
        id:
          type: string
          description: >-
            Unique identifier for the key (a UUID). Use it as the `{id}` path
            segment for Retrieve, Update, and Delete.
          example: 9b7e2c1a-4f3d-4a2b-8c1e-2d6f5a0b7c34
        name:
          type: string
          description: The human-readable label set at creation or via Update.
          example: production-pipeline
        created_at:
          type: string
          format: date-time
          description: When the key was created (RFC 3339, UTC).
          example: '2026-05-14T17:02:11Z'
        expires_at:
          type: string
          format: date-time
          description: When the key expires. Omitted entirely if the key never expires.
          example: '2026-12-31T23:59:59Z'
        revoked_at:
          type: string
          format: date-time
          description: When the key was revoked. Omitted entirely while the key is active.
          example: '2026-04-20T12:00:00Z'
    Error:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: integer
        message:
          type: string
  responses:
    Error:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````