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: 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 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 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 ThemeStyles: type: object description: Flat map of style attributes, matching the attribute names accepted by the LMX `