> ## Documentation Index
> Fetch the complete documentation index at: https://kv-server.techygrrrl.stream/llms.txt
> Use this file to discover all available pages before exploring further.

# Post set

> Sets the value of a key



## OpenAPI

````yaml post /set
openapi: 3.0.3
info:
  title: kv-server
  version: 0.0.0
servers:
  - url: https://{api_host}/api
    variables:
      api_host:
        default: YOUR-kv-server.vercel.app
security:
  - bearerAuth: []
paths:
  /set:
    post:
      description: Sets the value of a key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KvKeyValuePairRequest'
            example:
              key: my-data
              ttl_mins: 1
              value: '{"some-property":"some value that will expire in 1 minute"}'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KvKeyValuePairRequest'
              example:
                key: my-data
                value: '{"some-property":"some returned value"}'
        '400':
          description: Request failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: bad request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: unauthorized
components:
  schemas:
    KvKeyValuePairRequest:
      properties:
        key:
          type: string
        value:
          type: string
        ttl_mins:
          type: integer
      required:
        - key
        - value
    Error:
      required:
        - error
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````