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

# Nouvelle clé de site

> Remplacez la clé d'un site ; l'ancienne cesse aussitôt.



## OpenAPI

````yaml POST /v1/ai-rendering/sites/{id}/key
openapi: 3.1.0
info:
  title: querying.ai
  description: >-
    One API for every AI answer engine. Every task is asynchronous: submit, then
    collect the result via webhook or polling.
  version: 1.0.0
servers:
  - url: https://api.querying.ai
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/ai-rendering/sites/{id}/key:
    parameters:
      - name: id
        in: path
        required: true
        description: The site's id.
        schema:
          type: string
    post:
      tags:
        - AI Rendering
      summary: Get a new site key
      description: >-
        Returns a new site key once. The previous key stops at once; update the
        CDN's key with it.
      operationId: rotateAiRenderingSiteKey
      responses:
        '200':
          description: The site and its new key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AiRenderingSiteKeyResponse'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 'NOT_FOUND: no site of the account with that id.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AiRenderingSiteKeyResponse:
      type: object
      required:
        - success
        - site
        - key
      properties:
        success:
          type: boolean
        site:
          $ref: '#/components/schemas/AiRenderingSite'
        key:
          type: string
          description: >-
            The site key, rs_ and 64 hex characters. It is shown only in this
            response; querying.ai stores its hash.
    ErrorResponse:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ErrorDetail'
    AiRenderingSite:
      type: object
      required:
        - id
        - host
        - refreshDays
        - country
        - keyPrefix
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        host:
          type: string
          description: The site's host name, lower case, without a port.
        refreshDays:
          type: integer
          minimum: 1
          maximum: 28
          description: Days between renders of a published page. Default 28.
        country:
          type: string
          enum:
            - US
            - KR
          description: Where the site's pages are rendered from. Default US.
        keyPrefix:
          type: string
          description: >-
            The first 11 characters of the site key, which reads the site's copy
            list.
        pages:
          type: integer
          description: >-
            Published pages. Absent from a site that was just updated or given a
            new key.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Stable, safe to branch on. See the Errors guide for the full list.
        message:
          type: string
          description: For humans. May change.
        details:
          description: >-
            Context for the error. An array of `{field, message}` on most
            `VALIDATION_ERROR`s; an object elsewhere (for example `{id}` on
            `RESOURCE_NOT_FOUND`, `retryAfterSec` on 429 and 503 codes). Omitted
            when there is nothing to add.
          oneOf:
            - type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
            - type: object
              additionalProperties: true
        timestamp:
          type: string
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Your API key, sent as `Authorization: Bearer <key>`.'

````

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