Linea Docs

API Keys

Create and manage Linea API keys for programmatic workspace access.

API Keys

Linea API keys grant programmatic access to the API scoped to a workspace. They are passed as Bearer tokens in the Authorization header, just like session tokens.

All endpoints scoped to: /v1/workspaces/:workspaceId/api-keys

Endpoints

POST /v1/workspaces/:wId/api-keys

Create a new API key. The full key value is returned once at creation time and is never retrievable again.

Body

{ "name": "CI/CD Pipeline" }

Response 201

{
  "id": "uuid",
  "name": "CI/CD Pipeline",
  "key": "lnk_live_...",
  "workspaceId": "uuid",
  "createdBy": "uuid",
  "createdAt": "2025-01-01T00:00:00Z"
}

Copy the key value immediately: subsequent GET requests will never include it.


GET /v1/workspaces/:wId/api-keys

List all API keys for the workspace. The key field is never returned.

Response 200

[
  {
    "id": "uuid",
    "name": "CI/CD Pipeline",
    "workspaceId": "uuid",
    "createdBy": "uuid",
    "createdAt": "2025-01-01T00:00:00Z"
  }
]

DELETE /v1/workspaces/:wId/api-keys/:id

Revoke an API key immediately. Any in-flight requests using this key will start failing.

Response 204


Usage

GET /v1/workspaces/your-workspace-id/spaces HTTP/1.1
Authorization: Bearer lnk_live_...

API Key Object

{
  "id": "uuid",
  "workspaceId": "uuid",
  "name": "CI/CD Pipeline",
  "createdBy": "uuid",
  "createdAt": "2025-01-01T00:00:00Z"
}

On this page