Upstash RedisCommand API

Per-database Redis command execution

OpenAPI Specification

upstash-rediscommand-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Upstash APIs Kafka RedisCommand API
  version: 2.0.0
  summary: Developer (management) API and Redis REST API for Upstash.
  description: "Upstash exposes two distinct HTTP API surfaces:\n\n1. The Developer (Management) API at https://api.upstash.com/v2 — used\n   to programmatically create and administer Upstash Redis, Kafka, and\n   Vector databases, teams, and account-level resources. Authentication\n   is HTTP Basic using account email + API key.\n\n2. The per-database Redis REST API at https://{endpoint}.upstash.io —\n   used to execute Redis commands over HTTPS from edge and serverless\n   runtimes. Authentication is a Bearer token scoped to the database\n   (or via ?_token=... query parameter).\n\nEndpoint surface confirmed against https://upstash.com/docs/devops/developer-api\nand https://upstash.com/docs/redis/features/restapi.\n"
  contact:
    name: Upstash Docs
    url: https://upstash.com/docs
  license:
    name: Proprietary
    url: https://upstash.com/static/docs/terms.pdf
servers:
- url: https://api.upstash.com/v2
  description: Upstash Developer (management) API
- url: https://{endpoint}.upstash.io
  description: Per-database Redis REST API endpoint
  variables:
    endpoint:
      default: example-12345
      description: Database-specific endpoint hostname from the Upstash console
tags:
- name: RedisCommand
  description: Per-database Redis command execution
paths:
  /pipeline:
    post:
      tags:
      - RedisCommand
      summary: Execute a Redis pipeline
      description: 'Execute multiple Redis commands in a single round trip against the

        per-database Redis REST API. Request body is a JSON array of

        commands, where each command is itself an array starting with the

        command name.

        '
      operationId: redisPipeline
      security:
      - bearerAuth: []
      servers:
      - url: https://{endpoint}.upstash.io
        variables:
          endpoint:
            default: example-12345
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: array
                items:
                  type: string
      responses:
        '200':
          description: Pipeline results
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RedisCommandResult'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /multi-exec:
    post:
      tags:
      - RedisCommand
      summary: Execute Redis commands atomically
      description: Execute a batch of Redis commands as an atomic MULTI/EXEC transaction.
      operationId: redisMultiExec
      security:
      - bearerAuth: []
      servers:
      - url: https://{endpoint}.upstash.io
        variables:
          endpoint:
            default: example-12345
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                type: array
                items:
                  type: string
      responses:
        '200':
          description: Transaction results
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RedisCommandResult'
  /publish/{channel}/{message}:
    post:
      tags:
      - RedisCommand
      summary: Publish a message to a pub/sub channel
      operationId: redisPublish
      security:
      - bearerAuth: []
      servers:
      - url: https://{endpoint}.upstash.io
        variables:
          endpoint:
            default: example-12345
      parameters:
      - name: channel
        in: path
        required: true
        schema:
          type: string
      - name: message
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Number of clients that received the message
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    type: integer
components:
  responses:
    Unauthorized:
      description: Missing or invalid credentials
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
    RedisCommandResult:
      type: object
      properties:
        result:
          description: Result value (type depends on command)
        error:
          type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic auth with Upstash account email and API key.
    bearerAuth:
      type: http
      scheme: bearer
      description: Database-scoped bearer token issued from the Upstash console.