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

# Create a team-level API key



## OpenAPI

````yaml https://api.wirespeed.co/v1/openapi.json put /v1/team/api-keys
openapi: 3.0.0
info:
  title: Wirespeed API
  description: The public Wirespeed API. v1 is the first stable contract.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.wirespeed.co
security: []
tags: []
paths:
  /v1/team/api-keys:
    put:
      tags:
        - Team
      summary: Create a team-level API key
      operationId: TeamController_createTeamApiKey
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTeamApiKeyDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TeamApiKeyResponseDto'
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '401':
          description: ''
      security:
        - bearer: []
components:
  schemas:
    CreateTeamApiKeyDto:
      type: object
      properties:
        name:
          type: string
          description: Name for the team API key (1-100 characters)
        role:
          type: string
          enum:
            - ADMIN
            - ANALYST
            - VIEWER
          description: Role permissions to assign to the team API key
        expirationDays:
          type: number
          description: Number of days until the team API key expires
      required:
        - name
        - role
        - expirationDays
    TeamApiKeyResponseDto:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the API key
        teamId:
          type: string
          description: ID of the team this API key belongs to
        userId:
          type: string
          description: ID of the user who created this API key
        expiration:
          type: string
          description: Expiration date and time for the API key
        lastUsed:
          type: string
          nullable: true
          description: Timestamp when the API key was last used
        role:
          type: string
          enum:
            - ADMIN
            - ANALYST
            - VIEWER
          description: Role permissions assigned to this API key
        name:
          type: string
          description: Name assigned to the API key
        createdAt:
          type: string
          description: Timestamp when the API key was created
        token:
          type: string
          description: The generated team API key token (only returned once upon creation)
      required:
        - id
        - teamId
        - userId
        - expiration
        - role
        - name
        - createdAt
    HttpError:
      type: object
      properties:
        message:
          type: string
        statusCode:
          type: number
      required:
        - message
        - statusCode
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````