Loops Themes API

View email themes

OpenAPI Specification

loops-so-themes-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Loops OpenAPI Spec API key Themes API
  description: This is the OpenAPI Spec for the [Loops API](https://loops.so/docs/api).
  version: 1.8.0
servers:
- url: https://app.loops.so/api/v1
tags:
- name: Themes
  description: View email themes
paths:
  /themes/{themeId}:
    parameters:
    - name: themeId
      in: path
      required: true
      description: The ID of the theme.
      schema:
        type: string
    get:
      tags:
      - Themes
      summary: Get a theme
      description: Retrieve a single theme by ID.
      responses:
        '200':
          description: Successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThemeResponse'
        '400':
          description: Invalid `themeId`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThemeFailureResponse'
        '401':
          description: Invalid API key or content API not enabled for this team.
        '404':
          description: Theme not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThemeFailureResponse'
        '405':
          description: Wrong HTTP request method.
      security:
      - apiKey: []
  /themes:
    get:
      tags:
      - Themes
      summary: List themes
      description: Retrieve a paginated list of email themes, most recently created first.
      parameters:
      - name: perPage
        in: query
        required: false
        description: How many results to return in each request. Must be between 10 and 50. Default is 20.
        schema:
          type: string
      - name: cursor
        in: query
        required: false
        description: A cursor to return a specific page of results. Cursors can be found from the `pagination.nextCursor` value in each response.
        schema:
          type: string
      responses:
        '200':
          description: Successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListThemesResponse'
        '400':
          description: Invalid `perPage` value.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ThemeFailureResponse'
        '401':
          description: Invalid API key or content API not enabled for this team.
        '405':
          description: Wrong HTTP request method.
      security:
      - apiKey: []
components:
  schemas:
    ListThemesResponse:
      type: object
      properties:
        success:
          type: boolean
          examples:
          - true
        pagination:
          type: object
          properties:
            totalResults:
              type: number
            returnedResults:
              type: number
            perPage:
              type: number
            totalPages:
              type: number
            nextCursor:
              type:
              - string
              - 'null'
            nextPage:
              type:
              - string
              - 'null'
        data:
          type: array
          items:
            $ref: '#/components/schemas/Theme'
      required:
      - success
      - pagination
      - data
    ThemeStyles:
      type: object
      description: Flat map of style attributes, matching the attribute names accepted by the LMX `<Style />` tag. All attributes are returned with the values stored on the theme.
      properties:
        backgroundColor:
          type: string
        backgroundXPadding:
          type: number
        backgroundYPadding:
          type: number
        bodyColor:
          type: string
        bodyXPadding:
          type: number
        bodyYPadding:
          type: number
        bodyFontFamily:
          type: string
        bodyFontCategory:
          type: string
        borderColor:
          type: string
        borderWidth:
          type: number
        borderRadius:
          type: number
        buttonBodyColor:
          type: string
        buttonBodyXPadding:
          type: number
        buttonBodyYPadding:
          type: number
        buttonBorderColor:
          type: string
        buttonBorderWidth:
          type: number
        buttonBorderRadius:
          type: number
        buttonTextColor:
          type: string
        buttonTextFormat:
          type: number
        buttonTextFontSize:
          type: number
        dividerColor:
          type: string
        dividerBorderWidth:
          type: number
        textBaseColor:
          type: string
        textBaseFontSize:
          type: number
        textBaseLineHeight:
          type: number
        textBaseLetterSpacing:
          type: number
        textLinkColor:
          type: string
        heading1Color:
          type: string
        heading1FontSize:
          type: number
        heading1LineHeight:
          type: number
        heading1LetterSpacing:
          type: number
        heading2Color:
          type: string
        heading2FontSize:
          type: number
        heading2LineHeight:
          type: number
        heading2LetterSpacing:
          type: number
        heading3Color:
          type: string
        heading3FontSize:
          type: number
        heading3LineHeight:
          type: number
        heading3LetterSpacing:
          type: number
    Theme:
      type: object
      properties:
        themeId:
          type: string
        name:
          type: string
        styles:
          $ref: '#/components/schemas/ThemeStyles'
        isDefault:
          type: boolean
          description: Whether this theme is the team's default.
        createdAt:
          type: string
          description: ISO 8601 timestamp.
        updatedAt:
          type: string
          description: ISO 8601 timestamp.
      required:
      - themeId
      - name
      - styles
      - isDefault
      - createdAt
      - updatedAt
    ThemeFailureResponse:
      type: object
      properties:
        success:
          type: boolean
          examples:
          - false
        message:
          type: string
      required:
      - success
      - message
    ThemeResponse:
      type: object
      properties:
        success:
          type: boolean
          examples:
          - true
        themeId:
          type: string
        name:
          type: string
        styles:
          $ref: '#/components/schemas/ThemeStyles'
        isDefault:
          type: boolean
          description: Whether this theme is the team's default.
        createdAt:
          type: string
          description: ISO 8601 timestamp.
        updatedAt:
          type: string
          description: ISO 8601 timestamp.
      required:
      - success
      - themeId
      - name
      - styles
      - isDefault
      - createdAt
      - updatedAt
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer