LangWatch Api Keys API

The Api Keys API from LangWatch — 2 operation(s) for api keys.

Operations 3

GET /api/api-keys List API keys #
POST /api/api-keys Create an API key #
DELETE /api/api-keys/{id} Revoke an API key #

Documentation

Specifications

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/langwatch-api-keys-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

langwatch-api-keys-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: LangWatch Agents Api Keys API
  version: 1.0.0
  description: LangWatch openapi spec
servers:
- url: https://app.langwatch.ai
security:
- project_api_key: []
tags:
- name: Api Keys
paths:
  /api/api-keys:
    get:
      operationId: listApiKeys
      summary: List API keys
      description: List all API keys owned by the authenticated user in this organization. Requires organization:view permission.
      security:
      - admin_api_key: []
      responses:
        '200':
          description: List of API keys
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/ApiKeyInfo'
        '401':
          description: Invalid or missing API key token
        '403':
          description: Insufficient permissions (requires organization:view)
      tags:
      - Api Keys
    post:
      operationId: createApiKey
      summary: Create an API key
      description: Create a new API key. For service keys, pass keyType:"service". Optionally scope to specific projects via projectIds (ADMIN on each). Omit projectIds for full org access. The plaintext token is returned once — store it securely.
      security:
      - admin_api_key: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Human-readable name for this token
                description:
                  type: string
                  maxLength: 500
                  description: Optional description
                expiresAt:
                  type: string
                  format: date-time
                  description: Optional expiration date (ISO 8601)
                bindings:
                  type: array
                  minItems: 1
                  maxItems: 20
                  description: Role bindings that define what this token can access
                  items:
                    type: object
                    properties:
                      role:
                        type: string
                        enum:
                        - ADMIN
                        - MEMBER
                        - VIEWER
                        description: Role to grant
                      scopeType:
                        type: string
                        enum:
                        - ORGANIZATION
                        - TEAM
                        - PROJECT
                        description: Scope level
                      scopeId:
                        type: string
                        description: ID of the organization, team, or project
                    required:
                    - role
                    - scopeType
                    - scopeId
                keyType:
                  type: string
                  enum:
                  - personal
                  - service
                  default: personal
                  description: personal = tied to a user. service = not tied to any user, for automation.
                projectIds:
                  type: array
                  items:
                    type: string
                  maxItems: 50
                  description: 'For service keys with restricted scope: list of project IDs to grant ADMIN access to. Omit for full org access.'
              required:
              - name
              - bindings
      responses:
        '201':
          description: API key created. The token field contains the plaintext key — it is only shown once.
          content:
            application/json:
              schema:
                type: object
                properties:
                  token:
                    type: string
                    description: Plaintext API key token (sk-lw-...). Store securely — shown only once.
                  apiKey:
                    type: object
                    properties:
                      id:
                        type: string
                      name:
                        type: string
                      createdAt:
                        type: string
                        format: date-time
        '401':
          description: Invalid or missing API key token
        '403':
          description: Requested binding exceeds the creator's own permissions, or scope does not belong to this organization
        '422':
          description: Validation error (missing name, empty bindings, etc.)
      tags:
      - Api Keys
  /api/api-keys/{id}:
    delete:
      operationId: revokeApiKey
      summary: Revoke an API key
      description: Revoke (soft-delete) an API key. Revoked keys can no longer authenticate. Requires organization:manage permission.
      security:
      - admin_api_key: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
        description: API key ID
      responses:
        '200':
          description: API key revoked successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '401':
          description: Invalid or missing API key token
        '403':
          description: Not authorized to revoke this API key (owned by another user)
        '404':
          description: API key not found
        '409':
          description: API key is already revoked
      tags:
      - Api Keys
components:
  schemas:
    ApiKeyInfo:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        expiresAt:
          type: string
          format: date-time
          nullable: true
        lastUsedAt:
          type: string
          format: date-time
          nullable: true
        revokedAt:
          type: string
          format: date-time
          nullable: true
        roleBindings:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              role:
                type: string
                enum:
                - ADMIN
                - MEMBER
                - VIEWER
              scopeType:
                type: string
                enum:
                - ORGANIZATION
                - TEAM
                - PROJECT
              scopeId:
                type: string
  securitySchemes:
    project_api_key:
      type: apiKey
      in: header
      name: X-Auth-Token
      description: 'Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.'
    admin_api_key:
      type: http
      scheme: bearer
      description: 'Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.'