Ghost Themes API

Upload, activate, and manage themes that control the front-end appearance of the Ghost publication.

OpenAPI Specification

ghost-themes-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Ghost Admin Authors Themes API
  description: The Ghost Admin API provides full read and write access to all content and configuration within a Ghost publication. It enables developers to create, update, and delete posts, pages, tags, members, tiers, newsletters, and offers programmatically. Authentication is handled via JSON Web Tokens generated from an Admin API key, integration tokens, or staff access tokens. The Admin API supports everything the Ghost Admin interface can do and more, making it suitable for building custom publishing workflows, content automation, member management systems, and advanced integrations.
  version: '5.0'
  contact:
    name: Ghost Foundation
    url: https://ghost.org/docs/admin-api/
  termsOfService: https://ghost.org/terms/
servers:
- url: https://{site}.ghost.io/ghost/api/admin
  description: Ghost Pro Hosted Site
  variables:
    site:
      default: your-site
      description: Your Ghost site subdomain
- url: '{protocol}://{domain}/ghost/api/admin'
  description: Self-Hosted Ghost Instance
  variables:
    protocol:
      default: https
      enum:
      - https
      - http
    domain:
      default: localhost:2368
      description: Your Ghost instance domain and port
security:
- adminApiToken: []
tags:
- name: Themes
  description: Upload, activate, and manage themes that control the front-end appearance of the Ghost publication.
paths:
  /themes/upload/:
    post:
      operationId: adminUploadTheme
      summary: Upload a theme
      description: Upload a new theme as a zip file to the Ghost publication.
      tags:
      - Themes
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
              - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The theme zip file to upload
      responses:
        '201':
          description: Theme uploaded successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  themes:
                    type: array
                    items:
                      $ref: '#/components/schemas/Theme'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/ValidationError'
  /themes/{name}/activate/:
    put:
      operationId: adminActivateTheme
      summary: Activate a theme
      description: Activate an installed theme by its name, making it the active front-end theme for the publication.
      tags:
      - Themes
      parameters:
      - name: name
        in: path
        required: true
        description: The name of the theme to activate
        schema:
          type: string
      responses:
        '200':
          description: Theme activated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  themes:
                    type: array
                    items:
                      $ref: '#/components/schemas/Theme'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Unauthorized:
      description: Authentication failed or token is missing or invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: The requested resource was not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: Request body validation failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  schemas:
    Theme:
      type: object
      description: A Ghost theme controlling the front-end appearance.
      properties:
        name:
          type: string
          description: Theme name
        package:
          type: object
          description: Theme package.json metadata
          properties:
            name:
              type: string
              description: Package name
            version:
              type: string
              description: Package version
        active:
          type: boolean
          description: Whether this is the currently active theme
    ErrorResponse:
      type: object
      description: Standard Ghost API error response
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
                description: Human-readable error message
              type:
                type: string
                description: Error type identifier
              context:
                type: string
                description: Additional error context
                nullable: true
  securitySchemes:
    adminApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JSON Web Token generated from an Admin API key. The key is split into an ID and secret at the colon separator. The ID is used as the kid header and the secret is used to sign the token with HS256.
externalDocs:
  description: Ghost Admin API Documentation
  url: https://ghost.org/docs/admin-api/