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

# Update user subscription



## OpenAPI

````yaml /openapi.json post /admin/users/{userId}/subscription
openapi: 3.0.0
info:
  title: Uptime Monitor API
  description: >-
    API documentation for the Uptime Monitor application. This API allows users
    to create and manage website monitors, perform checks, and view statistics.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.justanotheruptime.com
security: []
tags:
  - name: auth
    description: Authentication endpoints
  - name: projects
    description: Project management endpoints
  - name: monitors
    description: Monitor management endpoints
  - name: checks
    description: Check-related endpoints
  - name: statistics
    description: Monitor statistics endpoints
paths:
  /admin/users/{userId}/subscription:
    post:
      tags:
        - Admin
      summary: Update user subscription
      operationId: AdminController_updateUserSubscription
      parameters:
        - name: userId
          required: true
          in: path
          description: ID of the user to update
          schema:
            type: string
      requestBody:
        required: true
        description: New subscription details
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscriptionDto'
      responses:
        '200':
          description: User subscription updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserDto'
        '404':
          description: User not found
      security:
        - bearer: []
components:
  schemas:
    UpdateSubscriptionDto:
      type: object
      properties:
        subscription:
          type: string
          enum:
            - free
            - pro
          example: pro
      required:
        - subscription
    UserDto:
      type: object
      properties:
        id:
          type: string
          example: 123e4567-e89b-12d3-a456-426614174000
        email:
          type: string
          example: user@example.com
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        roles:
          example:
            - user
            - admin
          type: array
          items:
            type: string
        subscription:
          type: string
          enum:
            - free
            - pro
          example: pro
        subscriptionStatus:
          type: string
          example: active
        createdAt:
          format: date-time
          type: string
          example: '2025-01-01T00:00:00.000Z'
      required:
        - id
        - email
        - firstName
        - lastName
        - roles
        - subscription
        - subscriptionStatus
        - createdAt
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````