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

# Replace an API key

> Needs a key with the `admin` scope.



## OpenAPI

````yaml /openapi.json put /api/v1/api-keys/{id}/
openapi: 3.0.3
info:
  title: Go-Fetch API
  version: v1
servers:
  - url: https://go-fetch.io
security: []
tags:
  - name: Jobs
    description: >-
      A job is one scrape. Create it with a scraper type and its input, follow
      it until it is completed, failed, timed_out or cancelled, then page
      through its results.
  - name: Webhooks
    description: >-
      URLs we POST to when a job finishes, signed with your webhook secret in
      the X-Webhook-Signature header, and the log of every delivery.
  - name: Usage
    description: Billable usage, one record per charge.
  - name: Pricing
    description: List prices per platform and a cost estimate. No API key needed.
  - name: API keys
    description: >-
      Your organization's API keys. Creating, changing and rotating a key needs
      a key with the admin scope.
  - name: Organizations
    description: >-
      The organization your key belongs to: its environments, members, this
      month's usage and the audit log.
paths:
  /api/v1/api-keys/{id}/:
    put:
      tags:
        - API keys
      summary: Replace an API key
      description: Needs a key with the `admin` scope.
      operationId: api_keys_update
      parameters:
        - in: path
          name: id
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/APIKeyRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/APIKeyRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/APIKeyRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIKey'
          description: ''
      security:
        - ApiKeyAuth: []
components:
  schemas:
    APIKeyRequest:
      type: object
      properties:
        environment:
          type: string
          format: uuid
        name:
          type: string
          minLength: 1
          description: Friendly name for the API key
          maxLength: 255
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/ScopesEnum'
        rate_limit:
          type: integer
          maximum: 100000
          minimum: 1
          description: >-
            Requests per hour, from 1 to 100,000. A value outside that range is
            refused with a 400 that names `rate_limit`.
        is_active:
          type: boolean
        expires_at:
          type: string
          format: date-time
          nullable: true
      required:
        - environment
        - name
        - scopes
    APIKey:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        organization:
          type: string
          format: uuid
          readOnly: true
        organization_name:
          type: string
          readOnly: true
        environment:
          type: string
          format: uuid
        environment_name:
          type: string
          readOnly: true
        environment_slug:
          type: string
          readOnly: true
        name:
          type: string
          description: Friendly name for the API key
          maxLength: 255
        prefix:
          type: string
          readOnly: true
        scopes:
          type: array
          items:
            $ref: '#/components/schemas/ScopesEnum'
        rate_limit:
          type: integer
          maximum: 100000
          minimum: 1
          description: >-
            Requests per hour, from 1 to 100,000. A value outside that range is
            refused with a 400 that names `rate_limit`.
        is_active:
          type: boolean
        last_used_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - environment
        - environment_name
        - environment_slug
        - id
        - last_used_at
        - name
        - organization
        - organization_name
        - prefix
        - scopes
    ScopesEnum:
      enum:
        - read
        - write
        - admin
      type: string
      description: |-
        * `read` - read
        * `write` - write
        * `admin` - admin
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.