openapi: 3.1.1
info:
  title: Foleon API
  version: 1.0.0
  description: >
    The Foleon API enables you to quickly and easily develop functional
    applications or integrations. In fact, this is the same API that powers the
    Foleon platform itself.


    The API follows RESTful principles, so if you've worked with a RESTful API
    before, many of its concepts will be familiar to you. It leverages standard
    HTTP features, making it compatible with most HTTP clients. Most responses,
    including errors, are returned in JSON format.


    Designed for clarity and ease of use, the API adheres to standard HTTP
    response codes, providing detailed error messages when necessary.
  license:
    name: Proprietary
    url: https://www.foleon.com/general-conditions
servers:
  - url: https://api.foleon.com
    description: EU cluster
  - url: https://api.us.foleon.com
    description: US cluster
tags:
  - name: Authentication
    description: >-
      Authenticate your requests using your api credentials by creating a bearer
      token.
  - name: Docs
    description: >-
      All endpoints related to creating, retrieving or deleting Docs (editions),
      or updating their settings.
  - name: Projects
    description: All endpoints related to Projects (titles).
  - name: Users
    description: All endpoints related to Users.
  - name: Workspaces
    description: All endpoints related to Workspaces (accounts).
  - name: Personalization Categories
    description: All endpoints related to Personalization Categories.
  - name: Personalization Options
    description: All endpoints related to Personalization Options.
  - name: Personalization Properties
    description: All endpoints related to Personalization Properties.
  - name: Personalization Values
    description: All endpoints related to Personalization Values.
  - name: Personalization Tokens
    description: All endpoints related to Personalization Tokens.
  - name: Editing Content
    description: All endpoints related to editing the content of you Foleon Docs.
  - name: Exporting Gzipped Docs
    description: Export tar.gz webpackages to host Foleon Docs on your own server.
  - name: Foleon Analytics
    description: All endpoints related to Foleons native analytics.
  - name: Media Library
    description: All endpoints related to managing media in Foleon's media library.
paths:
  /oauth:
    post:
      tags:
        - Authentication
      summary: Obtain an OAuth token
      description: ''
      operationId: obtainOAuthToken
      security: []
      requestBody:
        description: Request payload for obtaining an OAuth token.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OauthRequestSchema'
      responses:
        '200':
          description: JSON response for an Oauth token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OauthResponseSchema'
        '400':
          $ref: '#/components/responses/BadRequestError'
  /v2/magazine/edition/{doc_id}:
    get:
      tags:
        - Docs
      summary: Retrieve a Doc
      description: Get a Doc resource by it's ID.
      operationId: getDocById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/DocIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/DocResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    patch:
      tags:
        - Docs
      summary: Update a Doc
      description: >-
        Update a Doc's properties and settings, such as the remarketing code, or
        utm code.
      operationId: patchDocById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/DocIdParameter'
      requestBody:
        description: >
          Updated Doc attributes in JSON. Only the listed attributes can be
          updated. 

          **Not** all of them have to be included in the request body.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocUpdateRequestSchema'
      responses:
        '200':
          $ref: '#/components/responses/DocResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Docs
      summary: Delete a Doc
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a Doc is
        permanent and cannot be undone. Using this endpoint is risky. Consider
        unpublishing your Doc instead.
      operationId: deleteDocById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/DocIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v2/magazine/edition:
    get:
      tags:
        - Docs
      summary: List Docs
      description: >-
        Query all jobs available in your scope to return a list of Docs. Use
        bracket notation in the parameters to filter and order the data.
      operationId: listDocs
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListDocResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Docs
      summary: Create a Doc
      description: Create a new Doc in an existing project (title).
      operationId: createDoc
      security:
        - BearerAuth: []
      requestBody:
        description: >-
          Add a name and a project ID (title), optionally add various other
          settings such as a template ID.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateDocRequestSchema'
      responses:
        '201':
          description: Successfully created the Doc
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v3/magazine/edition/{doc_id}/copy:
    post:
      tags:
        - Docs
      summary: Copy a Doc
      description: Copy a Doc into an existing project (title)
      operationId: copyDoc
      security:
        - BearerAuth: []
      requestBody:
        description: Provide the resource ID for the project (title) to copy the Doc into.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CopyDocRequestSchema'
      parameters:
        - $ref: '#/components/parameters/DocIdParameter'
      responses:
        '201':
          $ref: '#/components/responses/DocResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /magazine/edition/{doc_id}/publish:
    post:
      tags:
        - Docs
      summary: Publish a Doc
      description: Publish or Re-Publish a Doc.
      operationId: publishDoc
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/DocIdParameter'
      responses:
        '201':
          description: Successfully (Re-)Published the doc.
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v2/magazine/title/{project_id}:
    get:
      tags:
        - Projects
      summary: Retrieve a Project
      description: Get a Project resource by it's ID.
      operationId: getProjectById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/ProjectIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/ProjectResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    patch:
      tags:
        - Projects
      summary: Update a Project
      description: Update a project's settings, such as your CRM set up, or your hostname.
      operationId: patchProjectById
      security:
        - BearerAuth: []
      requestBody:
        description: >
          Updated Project attributes in JSON. Only the listed attributes can be
          updated. 

          **Not** all of them have to be included in the request body.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectUpdateRequestSchema'
      parameters:
        - $ref: '#/components/parameters/ProjectIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/ProjectResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Projects
      summary: Delete a Project
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a Project is
        permanent and cannot be undone. Using this endpoint is risky.
      operationId: deleteProjectById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/ProjectIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v2/magazine/title:
    get:
      tags:
        - Projects
      summary: List Projects
      description: >-
        Query all projects available in your scope to return a list of Projects.
        Use bracket notation in the parameters to filter and order the data.
      operationId: listProjects
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListProjectResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Projects
      summary: Create a Project
      description: >-
        Create a new project, select a workspace (account) to put the project
        into by providing the workspace id.
      operationId: createProject
      security:
        - BearerAuth: []
      requestBody:
        description: Add a name and a workspace ID (account)
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProjectRequestSchema'
      responses:
        '201':
          $ref: '#/components/responses/ProjectResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v2/user/{user_id}:
    get:
      tags:
        - Users
      summary: Retrieve a User
      description: Get a User resource by it's ID.
      operationId: getUserById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/UserIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/UserResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    patch:
      tags:
        - Users
      summary: Update a User
      description: Update a User's settings.
      operationId: patchUserById
      security:
        - BearerAuth: []
      requestBody:
        description: >
          Updated User attributes in JSON. Only the listed attributes can be
          updated. 

          **Not** all of them have to be included in the request body.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserUpdateRequestSchema'
      parameters:
        - $ref: '#/components/parameters/UserIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/UserResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Users
      summary: Delete a User
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a User is
        permanent and cannot be undone. Using this endpoint is risky.
      operationId: deleteUserById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/UserIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v2/user:
    get:
      tags:
        - Users
      summary: List Users
      description: >-
        Query all Users available in your scope to return a list of Users. Use
        bracket notation in the parameters to filter and order the data.
      operationId: listUsers
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListUserResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Users
      summary: Create a User
      description: >-
        Create a new User, select a Workspace (account) for the User by
        providing the Workspace ID.
      operationId: createUser
      security:
        - BearerAuth: []
      requestBody:
        description: Add a name and a workspace ID (account)
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserRequestSchema'
      responses:
        '201':
          $ref: '#/components/responses/UserResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v2/account/{workspace_id}:
    get:
      tags:
        - Workspaces
      summary: Retrieve a Workspace
      description: Get a Workspace resource by it's ID.
      operationId: getWorkspaceById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/WorkspaceIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/WorkspaceResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    patch:
      tags:
        - Workspaces
      summary: Update a Workspace
      description: Update a Workspace's settings.
      operationId: patchWorkspaceById
      security:
        - BearerAuth: []
      requestBody:
        description: >
          Updated Workspace attributes in JSON. Only the listed attributes can
          be updated. 

          **Not** all of them have to be included in the request body.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkspaceUpdateRequestSchema'
      parameters:
        - $ref: '#/components/parameters/WorkspaceIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/WorkspaceResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Workspaces
      summary: Delete a Workspace
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a Workspace is
        permanent and cannot be undone. Using this endpoint is risky.
      operationId: DeleteWorkspaceById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/WorkspaceIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v2/account:
    get:
      tags:
        - Workspaces
      summary: List Workspaces
      description: >-
        Query all Workspaces available in your scope to return a list of
        Workspaces. Use bracket notation in the parameters to filter and order
        the data.
      operationId: listWorkspaces
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListWorkspaceResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Workspaces
      summary: Create a Workspace
      description: Create a new Workspace.
      operationId: createWorkspace
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateWorkspaceRequestSchema'
  /personalization/category/{category_id}:
    get:
      tags:
        - Personalization Categories
      summary: Retrieve a Personalization Category
      description: Get a Personalization Category resource by it's ID.
      operationId: getPersonalizationCategoryById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationCategoryIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/PersonalizationCategoryResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    patch:
      tags:
        - Personalization Categories
      summary: Update a Personalization Category
      description: Update a Personalization Category's settings.
      operationId: patchPersonalizationCategoryById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationCategoryIdParameter'
      requestBody:
        description: >
          Updated Personalization Category attributes in JSON. Only the listed
          attributes can be updated. 

          **Not** all of them have to be included in the request body.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonalizationCategoryUpdateRequestSchema'
      responses:
        '200':
          $ref: '#/components/responses/PersonalizationCategoryResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Personalization Categories
      summary: Delete a Personalization Category
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a
        Personalization Category is permanent and cannot be undone. Using this
        endpoint is risky.
      operationId: deletePersonalizationCategoryById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationCategoryIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/category:
    get:
      tags:
        - Personalization Categories
      summary: List Personalization Categories
      description: >-
        Query all Personalization Categories available in your scope to return a
        list of Personalization Categories. Use bracket notation in the
        parameters to filter and order the data.
      operationId: listPersonalizationCategories
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListPersonalizationCategoryResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Personalization Categories
      summary: Create a Personalization Category
      description: Create a new Personalization Category.
      operationId: CreatePersonalizationCategory
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePersonalizationCategoryRequestSchema'
      responses:
        '201':
          $ref: '#/components/responses/PersonalizationCategoryResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/property/option/{option_id}:
    get:
      tags:
        - Personalization Options
      summary: Retrieve a Personalization Option
      description: Get a Personalization Option resource by it's ID.
      operationId: getPersonalizationOptionById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationOptionIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/PersonalizationOptionResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    patch:
      tags:
        - Personalization Options
      summary: Update a Personalization Option
      description: Update a Personalization Option's settings.
      operationId: patchPersonalizationOptionById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationOptionIdParameter'
      requestBody:
        description: >
          Updated Personalization Option attributes in JSON. Only the listed
          attributes can be updated. 

          **Not** all of them have to be included in the request body.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonalizationOptionUpdateRequestSchema'
      responses:
        '200':
          $ref: '#/components/responses/PersonalizationOptionResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Personalization Options
      summary: Delete a Personalization Option
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a
        Personalization Option is permanent and cannot be undone. Using this
        endpoint is risky.
      operationId: deletePersonalizationOptionById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationOptionIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/property/option:
    get:
      tags:
        - Personalization Options
      summary: List Personalization Options
      description: >-
        Query all Personalization Options available in your scope to return a
        list of Personalization Options. Use bracket notation in the parameters
        to filter and order the data.
      operationId: listPersonalizationOptions
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListPersonalizationOptionResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Personalization Options
      summary: Create a Personalization Option
      description: Create a new Personalization Option.
      operationId: CreatePersonalizationOption
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePersonalizationOptionRequestSchema'
      responses:
        '201':
          $ref: '#/components/responses/PersonalizationOptionResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/property/{property_id}:
    get:
      tags:
        - Personalization Properties
      summary: Retrieve a Personalization Property
      description: Get a Personalization Property resource by it's ID.
      operationId: getPersonalizationPropertyById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationPropertyIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/PersonalizationPropertyResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    patch:
      tags:
        - Personalization Properties
      summary: Update a Personalization Property
      description: Update a Personalization Property's settings.
      operationId: patchPersonalizationPropertyById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationPropertyIdParameter'
      requestBody:
        description: >
          Updated Personalization Property attributes in JSON. Only the listed
          attributes can be updated. 

          **Not** all of them have to be included in the request body.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PersonalizationPropertyUpdateRequestSchema'
      responses:
        '200':
          $ref: '#/components/responses/PersonalizationPropertyResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Personalization Properties
      summary: Delete a Personalization Property
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a
        Personalization Property is permanent and cannot be undone. Using this
        endpoint is risky.
      operationId: deletePersonalizationPropertyById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationPropertyIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/property:
    get:
      tags:
        - Personalization Properties
      summary: List Personalization Properties
      description: >-
        Query all Personalization Properties available in your scope to return a
        list of Personalization Properties. Use bracket notation in the
        parameters to filter and order the data.
      operationId: listPersonalizationProperties
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListPersonalizationPropertyResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Personalization Properties
      summary: Create a Personalization Property
      description: Create a new Personalization Property.
      operationId: CreatePersonalizationProperty
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePersonalizationPropertyRequestSchema'
      responses:
        '201':
          $ref: '#/components/responses/PersonalizationPropertyResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/token/{token_id}:
    get:
      tags:
        - Personalization Tokens
      summary: Retrieve a Personalization Token
      description: Get a Personalization Token resource by it's ID.
      operationId: getPersonalizationTokenById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationTokenIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/PersonalizationTokenResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Personalization Tokens
      summary: Delete a Personalization Token
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a
        Personalization Token is permanent and cannot be undone. Using this
        endpoint is risky.
      operationId: deletePersonalizationTokenById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationTokenIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/token:
    get:
      tags:
        - Personalization Tokens
      summary: List Personalization Tokens
      description: >-
        Query all Personalization Tokens available in your scope to return a
        list of Personalization Tokens. Use bracket notation in the parameters
        to filter and order the data.
      operationId: listPersonalizationTokens
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListPersonalizationTokenResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Personalization Tokens
      summary: Create a Personalization Token
      description: Create a new Personalization Token.
      operationId: CreatePersonalizationToken
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePersonalizationTokenRequestSchema'
      responses:
        '201':
          $ref: '#/components/responses/PersonalizationTokenResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/token/value/{value_id}:
    get:
      tags:
        - Personalization Values
      summary: Retrieve a Personalization Value
      description: Get a Personalization Value resource by it's ID.
      operationId: getPersonalizationValueById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationValueIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/PersonalizationValueResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    delete:
      tags:
        - Personalization Values
      summary: Delete a Personalization Value
      description: >
        <span style="color:red;"><b>WARNING:</b></span> Deleting a
        Personalization Value is permanent and cannot be undone. Using this
        endpoint is risky.
      operationId: deletePersonalizationValueById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PersonalizationValueIdParameter'
      responses:
        '204':
          description: Deletion was successful
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /personalization/token/value:
    get:
      tags:
        - Personalization Values
      summary: List Personalization Values
      description: >-
        Query all Personalization values available in your scope to return a
        list of Personalization Values. Use bracket notation in the parameters
        to filter and order the data.
      operationId: listPersonalizationValues
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterFieldParameter'
        - $ref: '#/components/parameters/FilterTypeParameter'
        - $ref: '#/components/parameters/FilterValueParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListPersonalizationValueResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
    post:
      tags:
        - Personalization Values
      summary: Create a Personalisation Value
      description: Create a new Personalization Value.
      operationId: CreatePersonalizationValue
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePersonalizationValueRequestSchema'
      responses:
        '201':
          $ref: '#/components/responses/PersonalizationValueResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /content/draft/{page_content_uuid}/mutate:
    post:
      tags:
        - Editing Content
      summary: Edit the content-tree of a Page
      description: >
        Apply changes to the content of a page using <strong>Immer-style
        patches</strong>,  which represent updates based on immutable state
        mutation logic.  These patches follow a format similar to <code>JSON
        Patch</code> but use  <strong>array-based paths</strong> (e.g.,
        <code>["table", 0, "row"]</code>)  instead of string pointers.
      operationId: mutateContent
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PageContentUUIDParameter'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MutationRequestSchema'
      responses:
        '200':
          description: Mutation applied successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '409':
          description: Mutation resulted in a conflict and could not be applied
  /content/draft/type/PAGE/reference/{page_id}:
    get:
      tags:
        - Editing Content
      summary: Get the content-tree of a Page
      description: |
        Returns the content-tree of a page in json format.     
      operationId: getPageContent
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/PageId'
      responses:
        '200':
          $ref: '#/components/responses/PageContentResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /magazine/edition/{doc_id}/tar:
    post:
      tags:
        - Exporting Gzipped Docs
      summary: Create a Gzip archive for a Doc
      description: >-
        Triggers a new export for a Gzipped Doc. It can take up to 30 minutes
        for the export to complete.
      operationId: createGzippedDoc
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/DocIdParameter'
      responses:
        '200':
          description: Export triggered successfully
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /v2/document:
    get:
      tags:
        - Exporting Gzipped Docs
      summary: Get download links for a Doc's Gzipped archives
      description: >-
        Returns all the download links to your Gzipped docs. Get the latest
        export by sorting on `created_on` and selecting
        `result["_embedded"]["document"][0]["_links"]["path"]["href"]`
      operationId: getGzippedDocs
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/FilterAccountFieldGzippedDoc'
        - $ref: '#/components/parameters/FilterAccountTypeGzippedDoc'
        - $ref: '#/components/parameters/FilterAccountValueGzippedDoc'
        - $ref: '#/components/parameters/FilterPropertiesFieldGzippedDoc'
        - $ref: '#/components/parameters/FilterPropertiesTypeGzippedDoc'
        - $ref: '#/components/parameters/FilterPropertiesValueGzippedDoc'
        - $ref: '#/components/parameters/FilterFiletypeFieldGzippedDoc'
        - $ref: '#/components/parameters/FilterFiletypeTypeGzippedDoc'
        - $ref: '#/components/parameters/FilterFiletypeValueGzippedDoc'
        - $ref: '#/components/parameters/OrderByTypeParameter'
        - $ref: '#/components/parameters/OrderByFieldParameter'
        - $ref: '#/components/parameters/OrderByDirectionParameter'
      responses:
        '200':
          $ref: '#/components/responses/ListGzippedDocsResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /analytics:
    post:
      tags:
        - Foleon Analytics
      operationId: getAnalytics
      summary: Get analytics data based on a query
      description: >
        Fetches detailed analytics data. The request body specifies the
        dimensions, measures, time dimensions, and filters for the query.


        **Note:** Always include `pageviews.account_id` in filters for better
        performance, as data is chunked on workspace/account_id.
      security:
        - bearerAuth: []
      requestBody:
        description: Analytics query parameters
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AnalyticsQueryRequestSchema'
            example:
              query:
                total: true
                dimensions:
                  - pageviews.account_id
                  - pageviews.foleon_doc_id
                  - pageviews.foleon_doc_name
                  - projects.id
                  - projects.name
                timeDimensions:
                  - granularity: day
                    dimension: pageviews.timestamp
                    dateRange:
                      - '2025-07-01'
                      - '2025-08-01'
                measures:
                  - pageviews.unique_clients
                  - pageviews.unique_visits
                  - pageviews.total_visits
                  - pageviews.bounced
                limit: 5000
                filters:
                  - member: pageviews.account_id
                    operator: equals
                    values:
                      - 48900
                  - member: pageviews.foleon_doc_id
                    operator: equals
                    values:
                      - 324375
      responses:
        '200':
          $ref: '#/components/responses/AnalyticsQueryResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /topiary/{topiary_id}:
    get:
      tags:
        - Media Library
      summary: Retrieve a Topiary Folder
      description: Get a Topiary Folder resource by it's ID.
      operationId: getTopiaryeById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/TopiaryIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/TopiaryResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
  /topiary/file:
    post:
      tags:
        - Media Library
      summary: Upload file(s)
      description: Uploads files to a specified folder or account.
      operationId: uploadFile
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: array
                  items:
                    type: string
                    format: binary
                  description: >
                    A file to upload. The multipart form-data will include the
                    filename in Content-Disposition,

                    and the MIME type as Content-Type. Repeat this field to
                    upload multiple files.


                    Generate a multipart form that looks like this:


                    ```

                    Content-Disposition: form-data; name="file";
                    filename="example.png"

                    Content-Type: image/png


                    <file bytes here>

                    ```
                topiary_id:
                  type: string
                  description: >-
                    Folder ID where the file(s) will be uploaded. Use "0" for
                    root folder.
                account_id:
                  type: string
                  description: Account ID, required if uploading to root folder.
              required:
                - file
                - topiary_id
            encoding:
              file:
                style: form
                explode: true
      responses:
        '200':
          description: File(s) uploaded successfully
        '415':
          description: Unsupported Media Type
  /image/{image_id}:
    get:
      tags:
        - Media Library
      summary: Get an Image
      description: Get an Image from the Media Library by it's ID
      operationId: getImageById
      security:
        - BearerAuth: []
      parameters:
        - $ref: '#/components/parameters/ImageIdParameter'
      responses:
        '200':
          $ref: '#/components/responses/ImageResponse'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
components:
  schemas:
    OauthRequestSchema:
      type: object
      properties:
        grant_type:
          description: The `grant_type` will always be `"client_credentials"`
          type: string
          enum:
            - client_credentials
        client_id:
          type: string
          description: Your API key
          example: xxxxx000x0
        client_secret:
          type: string
          description: Your API secret
          example: X0xXx0X0xxX0XxXx0X0Xxx0xXx0xX0Xx0XxX0xX0xxX0XxXx0X0Xxx0xXx0xX0
    OauthResponseSchema:
      type: object
      properties:
        access_token:
          type: string
          example: x0xx00x00xxx00x00x0xxx000000000000x000xx
        expires_in:
          type: integer
          example: 3600
        token_type:
          type: string
          example: Bearer
        scope:
          type:
            - string
            - 'null'
          example: null
    FilterFieldParameterSchema:
      type: string
      example: id
    FilterTypeParameterSchema:
      type: string
      enum:
        - eq
        - neq
        - lt
        - lte
        - gt
        - gte
        - isnull
        - isnotnull
    FilterValueParameterSchema:
      type:
        - string
        - integer
      example: 123456789
    OrderByFieldParameterSchema:
      type: string
      example: created_on
    OrderByTypeParameterSchema:
      type: string
      enum:
        - field
    OrderByDirectionParameterSchema:
      type: string
      enum:
        - desc
        - asc
    DocResponseSchema:
      type: object
      properties:
        name:
          type: string
        identifier:
          type: string
        uid:
          type: string
        published_on:
          type:
            - string
            - 'null'
          format: date-time
        affected_on:
          type: string
          format: date-time
        first_published_on:
          type:
            - string
            - 'null'
          format: date-time
        status:
          $ref: '#/components/schemas/DocStatusSchema'
        is_visible:
          type: boolean
        options:
          type: object
          properties:
            anonymize_ip:
              type: boolean
            authentication:
              type: object
              properties:
                method:
                  type: string
            cookie_check_message:
              type: object
              properties:
                link:
                  type: string
                linktext:
                  type: string
                title:
                  type: string
                description:
                  type: string
            has_cookie_check:
              type: boolean
            custom_url_target_blank:
              type: boolean
            has_custom_url:
              type: boolean
            custom_url:
              type: string
            disable_cdn:
              type: boolean
            enable_comments:
              type: boolean
            gtm_code:
              type: string
            has_accessibility_button:
              type: boolean
            has_cobranding:
              type: boolean
            has_private_preview:
              type: boolean
            has_depth_indicator:
              type: boolean
            has_disabled_navigation:
              type: boolean
            has_editions_hidden:
              type: boolean
            page_overview_type:
              type: string
            has_nofollow:
              type: boolean
            page_arrows_placement:
              type: string
            has_page_buttons:
              type: boolean
            has_page_menu_button:
              type: boolean
            has_page_numbers:
              type: boolean
            has_personalization:
              type: boolean
            has_search:
              type: boolean
            has_sneak_preview:
              type: boolean
            sneak_preview_type:
              type: string
            has_social:
              type: boolean
            has_tracking_disabled:
              type: boolean
            enable_foleon_tracking:
              type: boolean
            header_code:
              type: string
            locale:
              type: string
            utm_code:
              type:
                - string
                - 'null'
        level:
          type: string
        category:
          type: string
        screenshot_store:
          type: string
        is_default:
          type: boolean
        id:
          type: integer
        created_on:
          type: string
          format: date-time
        modified_on:
          type: string
          format: date-time
        comments:
          type: object
          additionalProperties: true
        _embedded:
          type: object
          properties:
            title:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      type: object
                      properties:
                        href:
                          type: string
                          example: https://api.foleon.com/v2/magazine/title/{id}
            pages:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      type: object
                      properties:
                        href:
                          type: string
                          example: >-
                            https://api.foleon.com/v2/magazine/page?filter%5B0%5D%5Bfield%5D=edition&filter%5B0%5D%5Btype%5D=eq&filter%5B0%5D%5Bvalue%5D={id}}
            overlays:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      type: object
                      properties:
                        href:
                          type: string
                          example: >-
                            https://api.foleon.com/v2/doc/overlay?filter%5B0%5D%5Bfield%5D=edition&filter%5B0%5D%5Btype%5D=eq&filter%5B0%5D%5Bvalue%5D={id}}
            theme:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      type: object
                      properties:
                        href:
                          type: string
                          example: https://api.foleon.com/v2/doc/theme/{id}}
            jobs:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      type: object
                      properties:
                        href:
                          type: string
                          example: >-
                            https://api.foleon.com/v2/job?filter%5B0%5D%5Bfield%5D=edition&filter%5B0%5D%5Btype%5D=eq&filter%5B0%5D%5Bvalue%5D={id}}
            screenshot:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    original:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
                    desktop:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
                    google:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
                    twitter:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
                    facebook:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
                    instagram:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
                    pinterest:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
                    linkedin:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
                    full:
                      $ref: '#/components/schemas/AssetsApiHrefSchema'
    DocUpdateRequestSchema:
      type: object
      example:
        name: My new Doc name
        options:
          type: object
          properties:
            header_code:
              type: string
              example: <script>console.log('Hello from Foleon!')</script>
            utm_code:
              type: string
              example: '?utm_source=Foleon'
      properties:
        name:
          type: string
        identifier:
          type: string
        options:
          type: object
          properties:
            gtm_code:
              type: string
            header_code:
              type: string
            anonymize_ip:
              type: boolean
            authentication:
              type:
                - array
                - 'null'
            cookie_check_show_settings:
              type: boolean
            cookie_check_message:
              type: object
              properties:
                title:
                  type: string
                description:
                  type: string
                link:
                  type: string
                linktext:
                  type: string
            cookie_check_show_reject_all:
              type: boolean
            has_cookie_check:
              type: boolean
            custom_url_target_blank:
              type: boolean
            has_custom_url:
              type: boolean
            custom_url:
              type: string
            disable_cdn:
              type: boolean
            has_accessibility_button:
              type: boolean
            has_cobranding:
              type: boolean
            has_private_preview:
              type: boolean
            has_depth_indicator:
              type: boolean
            has_disabled_navigation:
              type: boolean
            has_editions_hidden:
              type: boolean
            page_overview_type:
              type: string
            has_nofollow:
              type: boolean
            page_arrows_placement:
              type: string
            has_page_buttons:
              type: boolean
            has_page_menu_button:
              type: boolean
            has_page_numbers:
              type: boolean
            has_personalization:
              type: boolean
            has_search:
              type: boolean
            has_sneak_preview:
              type: boolean
            sneak_preview_type:
              type: string
            has_social:
              type: boolean
            has_tracking_disabled:
              type: boolean
            enable_foleon_tracking:
              type: boolean
            locale:
              type: string
            utm_code:
              type: string
    ListDocResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                edition:
                  type: array
                  items:
                    $ref: '#/components/schemas/DocResponseSchema'
    CreateDocRequestSchema:
      type: object
      required:
        - name
        - title
      properties:
        name:
          type: string
          example: My new Doc!
        title:
          type: object
          description: The resource ID of the target project
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
        category:
          type: string
          enum:
            - annual_report
            - branded_content
            - brochure
            - case_study
            - customer_magazine
            - ebook
            - event_magazine
            - manual
            - member_magazine
            - newsletter
            - pitch_deck
            - presentation
            - proposal
            - product_catalog
            - report
            - staff_magazine
            - white_paper
            - other
    CopyDocRequestSchema:
      type: object
      required:
        - title
      properties:
        title:
          type: object
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
    ProjectResponseSchema:
      type: object
      properties:
        name:
          type: string
        identifier:
          type: string
        hostname:
          type:
            - string
            - 'null'
          format: hostname
        ua_code:
          type:
            - string
            - 'null'
          example: UA-xxxxxx-yy
        marketo_code:
          type: object
          properties:
            munchkin_id:
              type: string
            is_enabled:
              type: boolean
        hubspot_code:
          type: object
          properties:
            hub_id:
              type: string
            hublet:
              type:
                - string
                - 'null'
            is_enabled:
              type: boolean
        pardot_code:
          type: object
          properties:
            piCid:
              type: string
            piAid:
              type: string
        ga4_config:
          type: object
          properties:
            has_enabled:
              type: boolean
            has_events_enabled:
              type: boolean
            has_views_enabled:
              type: boolean
            measurement_id:
              type:
                - string
                - 'null'
        eloqua_code:
          type: object
          properties:
            site_id:
              type: string
            custom_tracker_subdomain:
              type: string
        security_profile:
          type:
            - string
            - 'null'
        website:
          type:
            - string
            - 'null'
        license:
          type: integer
        has_secure_socket_layer:
          type: boolean
        affected_on:
          type: string
          format: date-time
        options:
          type: array
        certificate:
          type:
            - string
            - 'null'
        certificate_chain:
          type:
            - string
            - 'null'
        certificate_key:
          type:
            - string
            - 'null'
        automated_certificate:
          type: boolean
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        created_on:
          type: string
          format: date-time
        modified_on:
          type: string
          format: date-time
        logo:
          type:
            - string
            - 'null'
          format: uri
        icon:
          type:
            - string
            - 'null'
          format: uri
        splash:
          type:
            - string
            - 'null'
          format: uri
        rules:
          type: object
        _embedded:
          type: object
          properties:
            account:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            editions:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
            published:
              type: object
              properties:
                href:
                  type: string
                  format: uri
        _computed:
          type: object
          properties:
            background_color:
              type: string
              example: rgba(0,0,0,0)
            editions_count:
              type: integer
            editions_published_count:
              type: integer
    ProjectUpdateRequestSchema:
      type: object
      properties:
        name:
          type: string
        identifier:
          type: string
        has_secure_socket_layer:
          type: boolean
        ua_code:
          type: string
          example: UA-xxxxxx-yy
        security_profile:
          type:
            - string
            - 'null'
          enum:
            - null
            - medium_2019
            - high_2019
        website:
          type: string
        ga4_config:
          type: object
          description: Google Analytics 4 tracking object represents the configuration.
          additionalProperties: false
          properties:
            measurement_id:
              description: Google measurement ID.
              type:
                - string
                - 'null'
              pattern: ^(G)-[a-zA-Z0-9-]+$
              maxLength: 255
            has_views_enabled:
              description: Enable detect and track page views.
              type: boolean
            has_events_enabled:
              description: Enable detect and track events.
              type: boolean
            has_enabled:
              type: boolean
        pardot_code:
          type: object
          description: >-
            Pardot tracking object represents the configuration for the client
            IDs.
          additionalProperties: false
          required:
            - piCid
            - piAid
          properties:
            piCid:
              description: Client tracking ID.
              type: string
            piAid:
              description: Account tracking ID.
              type: string
        eloqua_code:
          type: object
          description: >-
            Pardot tracking object represents the configuration for the client
            IDs.
          additionalProperties: false
          required:
            - piCid
            - piAid
          properties:
            piCid:
              description: Client tracking ID.
              type: string
            piAid:
              description: Account tracking ID.
              type: string
        hubspot_code:
          type: object
          description: HubSpot tracking object represents the configuration.
          additionalProperties: false
          required:
            - hub_id
            - hublet
            - is_enabled
          properties:
            hub_id:
              description: HubSpot tracking ID.
              type: string
            hublet:
              description: HubSpot account region.
              type: string
            is_enabled:
              description: Enables tracking.
              type: boolean
    ListProjectResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                title:
                  type: array
                  items:
                    $ref: '#/components/schemas/ProjectResponseSchema'
    CreateProjectRequestSchema:
      type: object
      required:
        - name
        - account
      properties:
        name:
          type: string
          example: My new Project!
        account:
          type: object
          description: The resource ID of the target workspace
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
    UserResponseSchema:
      type: object
      properties:
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
          format: email
        phone:
          type:
            - string
            - 'null'
        activated_on:
          type: string
          format: date-time
        verified_on:
          type:
            - string
            - 'null'
          format: date-time
        activity_on:
          type:
            - string
            - 'null'
          format: date-time
        status:
          type: string
        options:
          type: object
          properties:
            tour:
              type: object
              properties:
                dashboard.content:
                  type: boolean
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        created_on:
          type: string
          format: date-time
        modified_on:
          type:
            - string
            - 'null'
          format: date-time
        country:
          type:
            - string
            - 'null'
        _embedded:
          type: object
          properties:
            memberships:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            roles:
              type: object
              properties:
                name:
                  type: string
                description:
                  type: string
                is_license:
                  type: boolean
                priority:
                  type: integer
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                grants:
                  type: object
                account:
                  type:
                    - integer
                    - 'null'
                users:
                  type: object
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            account:
              type: object
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
        _computed:
          type: object
          properties:
            email:
              type: string
              format: email
            has_password:
              type: boolean
            num_accounts:
              type: integer
    UserUpdateRequestSchema:
      type: object
      additionalProperties: false
      properties:
        first_name:
          type: string
          maxLength: 255
          description: First name of the user.
        last_name:
          type: string
          maxLength: 255
          description: Last name of the user.
        email:
          type: string
          format: email
          description: Email address of the user.
        phone:
          type: string
          description: Phone number of the user.
        options:
          type:
            - array
            - 'null'
          description: Additional options.
          items:
            type: string
        account:
          type: string
          description: Account associated with the user.
        roles:
          type:
            - array
            - 'null'
          description: List of roles assigned to the user.
          items:
            type: string
    ListUserResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                user:
                  type: array
                  items:
                    $ref: '#/components/schemas/UserResponseSchema'
    CreateUserRequestSchema:
      type: object
      additionalProperties: false
      required:
        - first_name
        - last_name
        - email
        - phone
        - account
      properties:
        first_name:
          type: string
          maxLength: 255
          description: First name of the user.
        last_name:
          type: string
          maxLength: 255
          description: Last name of the user.
        email:
          type: string
          format: email
          description: Email address of the user.
        phone:
          type: string
          description: Phone number of the user.
        options:
          type:
            - array
            - 'null'
          description: Additional options.
          items:
            type: string
        account:
          type: string
          description: Account associated with the user.
        roles:
          type:
            - array
            - 'null'
          description: List of roles assigned to the user.
          items:
            type: string
    WorkspaceResponseSchema:
      type: object
      properties:
        name:
          type: string
        identifier:
          type: string
        status:
          type: string
        is_trial:
          type: boolean
        industry:
          type: string
        is_company:
          type: boolean
        meta:
          type: object
          properties:
            num_accounts:
              type: integer
            num_users:
              type: integer
            num_titles:
              type: integer
            num_titles_published:
              type: integer
            num_editions:
              type: integer
            num_editions_published:
              type: integer
            num_presets:
              type: integer
            num_templates:
              type: integer
            computed_on:
              type: string
              format: date-time
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        created_on:
          type: string
          format: date-time
        modified_on:
          type:
            - string
            - 'null'
          format: date-time
        clients:
          type: object
        partners:
          type: object
        billing_country:
          type:
            - string
            - 'null'
        _embedded:
          type: object
          properties:
            parent:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            children:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            memberships:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            titles:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            grants:
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            country:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
        _computed:
          type: object
          properties:
            num_accounts:
              type: integer
            num_users:
              type: integer
            num_titles:
              type: integer
            num_titles_published:
              type: integer
            num_editions:
              type: integer
            num_editions_published:
              type: integer
            num_presets:
              type: integer
            num_templates:
              type: integer
            computed_on:
              type: string
              format: date-time
            label:
              type: string
            can_access_parent:
              type: boolean
            parent_account_name:
              type: string
    WorkspaceUpdateRequestSchema:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          maxLength: 50
        identifier:
          type: string
          maxLength: 50
        status:
          type: string
        industry:
          type: string
          maxLength: 255
        is_trial:
          type:
            - boolean
            - 'null'
        is_internal:
          type:
            - boolean
            - 'null'
        country:
          type: string
        billing_country:
          type: string
        parent:
          type:
            - string
            - 'null'
        purged_on:
          type:
            - string
            - 'null'
          format: date-time
    ListWorkspaceResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                account:
                  type: array
                  items:
                    $ref: '#/components/schemas/WorkspaceResponseSchema'
    CreateWorkspaceRequestSchema:
      type: object
      additionalProperties: false
      required:
        - name
        - identifier
        - status
        - industry
        - is_trial
        - is_internal
        - country
        - billing_country
      properties:
        name:
          type: string
          maxLength: 50
          description: Name of the Workspace.
        identifier:
          type: string
          maxLength: 50
          description: Unique identifier for the Workspace.
        status:
          type: string
          description: Status of the Workspace.
        industry:
          type: string
          maxLength: 255
          description: Industry associated with the Workspace.
        is_trial:
          type:
            - boolean
            - 'null'
          description: Indicates if the Workspace is a trial.
        is_internal:
          type:
            - boolean
            - 'null'
          description: Indicates if the Workspace is internal.
        country:
          type: string
          description: Country associated with the Workspace.
        billing_country:
          type: string
          description: Billing country associated with the Workspace.
        parent:
          type:
            - string
            - 'null'
          description: Parent Account reference.
        purged_on:
          type:
            - string
            - 'null'
          format: date-time
          description: Date when the Workspace was purged.
    PersonalizationCategoryResponseSchema:
      type: object
      properties:
        name:
          type: string
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        created_on:
          type: string
          format: date-time
        modified_on:
          type:
            - string
            - 'null'
          format: date-time
        status:
          type: string
        account:
          $ref: '#/components/schemas/ResourceIdSchema'
          nullable: true
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
    PersonalizationCategoryUpdateRequestSchema:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 200
          pattern: ^[A-Za-z\s]+$
          description: Name of the personalization category.
    ListPersonalizationCategoryResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                category:
                  type: array
                  items:
                    $ref: '#/components/schemas/PersonalizationCategoryResponseSchema'
    CreatePersonalizationCategoryRequestSchema:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 200
          pattern: ^[A-Za-z\s]+$
          description: Name of the personalization category.
    PersonalizationOptionResponseSchema:
      type: object
      properties:
        _embedded:
          type: object
          properties:
            property:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
        created_on:
          type: string
          format: date-time
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        modified_on:
          type: string
          format: date-time
        name:
          type: string
        status:
          type:
            - string
            - 'null'
        values:
          type: object
    PersonalizationOptionUpdateRequestSchema:
      type: object
      additionalProperties: false
      required:
        - name
      properties:
        name:
          type: string
          maxLength: 200
          pattern: ^[A-Za-z\d\s]+$
          description: >-
            The value of the personalization property option, e.g. 'e-commerce'
            for the 'industry' property.
    ListPersonalizationOptionResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                option:
                  type: array
                  items:
                    $ref: '#/components/schemas/PersonalizationOptionResponseSchema'
    CreatePersonalizationOptionRequestSchema:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          maxLength: 200
          pattern: ^[A-Za-z\d\s]+$
          description: >-
            The value of the personalization property option, e.g. 'e-commerce'
            for the 'industry' property.
        property:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
    PersonalizationPropertyResponseSchema:
      type: object
      properties:
        _embedded:
          type: object
          properties:
            account:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            category:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
        created_on:
          type: string
          format: date-time
        default:
          type: string
        external_mapping:
          type:
            - string
            - 'null'
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        identifier:
          type: string
        modified_on:
          type:
            - string
            - 'null'
          format: date-time
        name:
          type: string
        options:
          type: object
        status:
          type: string
          enum:
            - active
            - archived
        type:
          type: string
          enum:
            - text
            - dropdown_select
    PersonalizationPropertyUpdateRequestSchema:
      type: object
      additionalProperties: false
      properties:
        name:
          type: string
          maxLength: 200
          pattern: ^[A-Za-z\s]+$
          description: Name of the personalization property.
        category:
          type: string
          description: Reference to a Personalization Category.
        default:
          type: string
          maxLength: 200
          description: Default value for the personalization property.
        status:
          type: string
          enum:
            - active
            - archived
          description: Status of the personalization property.
        external_mapping:
          type: array
          items:
            type: object
          description: External mapping structure for personalization property.
    ListPersonalizationPropertyResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                property:
                  type: array
                  items:
                    $ref: '#/components/schemas/PersonalizationPropertyResponseSchema'
    CreatePersonalizationPropertyRequestSchema:
      type: object
      required:
        - account
        - category
        - identifier
        - name
        - type
        - status
      properties:
        account:
          type: object
          properties:
            id:
              type: integer
        category:
          type: object
          properties:
            id:
              type: integer
        default:
          type: string
        identifier:
          type: string
        name:
          type: string
        type:
          type: string
          enum:
            - dropdown_select
            - text
        status:
          type: string
          enum:
            - active
    PersonalizationTokenResponseSchema:
      type: object
      properties:
        token:
          type: string
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        created_on:
          type: string
          format: date-time
        modified_on:
          type:
            - string
            - 'null'
          format: date-time
        status:
          type:
            - string
            - 'null'
        values:
          type: object
        _embedded:
          type: object
          properties:
            edition:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            account:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ResourceIdSchema'
    ListPersonalizationTokenResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                token:
                  type: array
                  items:
                    $ref: '#/components/schemas/PersonalizationTokenResponseSchema'
    CreatePersonalizationTokenRequestSchema:
      required:
        - edition
      properties:
        edition:
          type: object
          description: Reference to a Magazine Edition.
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
        account:
          type: object
          description: Reference to an Account.
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
    PersonalizationValueResponseSchema:
      type: object
      properties:
        token:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
        property:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
        value:
          type: string
    ListPersonalizationValueResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                token:
                  type: array
                  items:
                    $ref: '#/components/schemas/PersonalizationValueResponseSchema'
    CreatePersonalizationValueRequestSchema:
      required:
        - property
        - token
        - value
      properties:
        property:
          type: object
          description: Reference to a Personalization Property
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
        token:
          type: object
          description: Reference to a Personalization Token
          required:
            - id
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
        value:
          type: string
          description: The string value that is applied to the token's property
    MutationRequestSchema:
      type: object
      required:
        - patches
        - description
      properties:
        patches:
          type: array
          description: An array of immer-style patches
          items:
            type: object
            required:
              - op
              - path
              - value
            properties:
              op:
                type: string
                enum:
                  - add
                  - remove
                  - replace
                description: The patch operation
              path:
                type: array
                description: An array-based path to the field to mutate
                items:
                  oneOf:
                    - type: string
                    - type: integer
              value:
                type: object
                description: The value to be applied by the patch
                additionalProperties: true
        description:
          type: string
          description: A human-readable explanation of the mutation operation
    ListResponseSchema:
      type: object
      properties:
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
            first:
              $ref: '#/components/schemas/ApiHrefSchema'
            last:
              $ref: '#/components/schemas/ApiHrefSchema'
        page_count:
          type: integer
        page_size:
          type: integer
        total_items:
          type: integer
        page:
          type: integer
        count:
          type: integer
        total:
          type: integer
    ApiHrefSchema:
      type: object
      properties:
        href:
          type: string
          example: https://api.foleon.com/...
          format: uri
    AssetsApiHrefSchema:
      type: object
      properties:
        href:
          type: string
          example: >-
            https://assets.foleon.com/eu-central-1/de-screenshots-0x0xx0/{id}/X0xXXXXxX0XXx0X0_o.png
          format: uri
    ResourceIdSchema:
      type: integer
      example: 123456789
    DocStatusSchema:
      type: string
      enum:
        - draft
        - published
    UUIDSchema:
      type: string
      format: uuid
    PageContentResponseSchema:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/UUIDSchema'
        accountId:
          $ref: '#/components/schemas/ResourceIdSchema'
        refId:
          $ref: '#/components/schemas/ResourceIdSchema'
        createdAt:
          type: string
          format: date-time
        type:
          type: string
          enum:
            - PAGE
        foleonDocId:
          $ref: '#/components/schemas/ResourceIdSchema'
        content:
          type: object
          additionalProperties:
            type: object
            additionalProperties:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/UUIDSchema'
                refs:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        $ref: '#/components/schemas/UUIDSchema'
                      identity:
                        type: string
                value:
                  type: string
                parent:
                  type: object
                  properties:
                    id:
                      $ref: '#/components/schemas/UUIDSchema'
                    identity:
                      type: string
                styles:
                  type: object
                  additionalProperties:
                    type: object
                    additionalProperties: {}
                identity:
                  type: string
          example:
            row:
              497f6eca-6276-4993-bfeb-53cbbbba6f08:
                id: 497f6eca-6276-4993-bfeb-53cbbbba6f08
                refs: []
                value: ''
                parent:
                  id: some-other-uuid
                  identity: block
                styles: {}
                identity: row
              b0f56c35-aaa0-40c1-a6d3-9f01ee1e2b1c:
                id: b0f56c35-aaa0-40c1-a6d3-9f01ee1e2b1c
                refs: []
                value: ''
                parent:
                  id: another-parent
                  identity: block
                styles: {}
                identity: row
            column:
              c6e9f7a9-8327-4cf7-946b-58b1e0d3172f:
                id: c6e9f7a9-8327-4cf7-946b-58b1e0d3172f
                refs: []
                value: ''
                parent:
                  id: third-parent
                  identity: block
                styles: {}
                identity: column
    GzippedDocResponseSchema:
      type: object
      properties:
        name:
          type: string
        filename:
          type: string
        filesize:
          type: integer
        properties:
          type: object
          properties:
            edition:
              $ref: '#/components/schemas/ResourceIdSchema'
        upload_store:
          type: string
        metadata:
          type: array
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        created_on:
          type: string
          format: date-time
        modified_on:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        topiary:
          type: object
          properties:
            id:
              $ref: '#/components/schemas/ResourceIdSchema'
            _links:
              type: object
              properties:
                self:
                  $ref: '#/components/schemas/ApiHrefSchema'
        _embedded:
          type: object
          properties:
            account:
              type: object
              properties:
                id:
                  $ref: '#/components/schemas/ResourceIdSchema'
                _links:
                  type: object
                  properties:
                    self:
                      $ref: '#/components/schemas/ApiHrefSchema'
            _links:
              type: object
              properties:
                path:
                  $ref: '#/components/schemas/ApiHrefSchema'
    ListGzippedDocsResponseSchema:
      allOf:
        - $ref: '#/components/schemas/ListResponseSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                document:
                  type: array
                  items:
                    $ref: '#/components/schemas/GzippedDocResponseSchema'
    AnalyticsFilterSchema:
      type: object
      required:
        - member
        - operator
        - values
      properties:
        member:
          type: string
          description: >-
            The dimension or measure member to filter on (e.g.,
            `pageviews.account_id`).
        operator:
          type: string
          enum:
            - equals
            - notEquals
            - contains
            - notContains
            - startsWith
            - endsWith
            - gt
            - gte
            - lt
            - lte
            - in
            - notIn
            - set
            - notSet
          description: The filter operator.
        values:
          type: array
          items:
            type: string
          description: The values to filter by.
    AnalyticsTimeDimensionSchema:
      type: object
      required:
        - granularity
        - dimension
        - dateRange
      properties:
        granularity:
          type: string
          enum:
            - day
            - week
            - month
            - year
          description: The aggregation period (e.g., `day`).
        dimension:
          type: string
          description: The time dimension member (e.g., `pageviews.timestamp`).
        dateRange:
          type: array
          items:
            type: string
            format: date
          minItems: 2
          maxItems: 2
          description: >-
            The start and end dates for the query (e.g., `["2025-07-01",
            "2025-08-01"]`).
    AnalyticsQueryBodySchema:
      type: object
      required:
        - dimensions
        - timeDimensions
        - measures
      properties:
        total:
          type: boolean
          description: Whether to include a total count.
        dimensions:
          type: array
          items:
            type: string
          description: >-
            A list of dimensions to group the data by (e.g.,
            `pageviews.account_id`).
        timeDimensions:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsTimeDimensionSchema'
          description: A list of time dimensions for date-based slicing.
        measures:
          type: array
          items:
            type: string
          description: >-
            A list of measures (metrics) to calculate (e.g.,
            `pageviews.unique_clients`).
        limit:
          type: integer
          description: The maximum number of results to return.
          default: 5000
        filters:
          type: array
          items:
            $ref: '#/components/schemas/AnalyticsFilterSchema'
          description: A list of filters to apply to the data.
    AnalyticsQueryRequestSchema:
      type: object
      required:
        - query
      properties:
        query:
          $ref: '#/components/schemas/AnalyticsQueryBodySchema'
          description: The main analytics query object.
    AnalyticsQueryResponseSchema:
      type: object
      properties:
        query:
          type: object
          description: >-
            The final query object used by the server (may include
            defaults/modifications).
        data:
          type: array
          description: The resulting analytics data rows.
        lastRefreshTime:
          type: string
          format: date-time
          description: Timestamp of the last data refresh.
        annotation:
          type: object
          description: Metadata and annotations about the dimensions and measures.
        total:
          type: integer
          description: The total number of rows.
    TopiaryChildSchema:
      type: object
      properties:
        id: '#/components/schemas/ResourceIdSchema'
        name:
          type: string
          example: My nested Media Library Folder
        created_on:
          type: string
          format: date-time
        modified_on:
          type: string
          format: date-time
          nullable: true
        shared_on:
          type: string
          format: date-time
          nullable: true
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
    TopiaryParent:
      type: object
      properties:
        id:
          type: integer
          example: 0
        name:
          type: string
          example: root
    TopiaryChildImageSchema:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        name:
          type: string
          example: My image.png
        alt:
          type: string
          nullable: true
          example: null
        is_ai_generated:
          type: boolean
        filetype:
          type: string
          example: image/png
        filesize:
          type: integer
          example: 3013
        properties:
          type: object
          properties:
            width:
              type: integer
              example: 204
            height:
              type: integer
              example: 169
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
            image:
              $ref: '#/components/schemas/AssetsApiHrefSchema'
            thumbnail:
              $ref: '#/components/schemas/AssetsApiHrefSchema'
    TopiaryResponseSchema:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/ResourceIdSchema'
        name:
          type: string
          example: My Media Library Folder
        created_on:
          type: string
          format: date-time
        modified_on:
          type: string
          format: date-time
          nullable: true
          example: null
        shared_on:
          type: string
          format: date-time
          nullable: true
          example: null
        _links:
          type: object
          properties:
            self:
              $ref: '#/components/schemas/ApiHrefSchema'
        _embedded:
          type: object
          properties:
            children:
              type: array
              items:
                $ref: '#/components/schemas/TopiaryChildSchema'
            parent:
              $ref: '#/components/schemas/TopiaryParent'
            images:
              type: array
              items:
                $ref: '#/components/schemas/TopiaryChildImageSchema'
            documents:
              type: array
            videos:
              type: array
    ImageResponseSchema:
      allOf:
        - $ref: '#/components/schemas/TopiaryChildImageSchema'
        - type: object
          properties:
            _embedded:
              type: object
              properties:
                topiary:
                  type: object
                  properties:
                    id:
                      $ref: '#/components/schemas/ResourceIdSchema'
                    _links:
                      type: object
                      properties:
                        self:
                          $ref: '#/components/schemas/ApiHrefSchema'
  parameters:
    FilterFieldParameter:
      name: filter[0][field]
      description: The field to filter on
      in: query
      schema:
        $ref: '#/components/schemas/FilterFieldParameterSchema'
    FilterTypeParameter:
      name: filter[0][type]
      description: The type of filtering operation
      in: query
      schema:
        $ref: '#/components/schemas/FilterTypeParameterSchema'
    FilterValueParameter:
      name: filter[0][value]
      description: The value to filter on
      in: query
      schema:
        $ref: '#/components/schemas/FilterValueParameterSchema'
    OrderByFieldParameter:
      name: order-by[0][field]
      description: The field to sort by
      in: query
      schema:
        $ref: '#/components/schemas/OrderByFieldParameterSchema'
    OrderByTypeParameter:
      name: order-by[0][type]
      description: a fixed value
      in: query
      schema:
        $ref: '#/components/schemas/OrderByTypeParameterSchema'
    OrderByDirectionParameter:
      name: order-by[0][direction]
      description: Descending or ascending.
      in: query
      schema:
        $ref: '#/components/schemas/OrderByDirectionParameterSchema'
    DocIdParameter:
      name: doc_id
      in: path
      description: The resource ID of the Doc
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    ProjectIdParameter:
      name: project_id
      in: path
      description: The resource ID of the Project
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    UserIdParameter:
      name: user_id
      in: path
      description: The resource ID of the User
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    WorkspaceIdParameter:
      name: workspace_id
      in: path
      description: The resource ID of the Workspace
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    PageId:
      name: page_id
      in: path
      description: The resource ID of the Page
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    PersonalizationCategoryIdParameter:
      name: category_id
      in: path
      description: The resource ID of the Personalization Category
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    PersonalizationOptionIdParameter:
      name: option_id
      in: path
      description: The resource ID of the Personalization Option
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    PersonalizationPropertyIdParameter:
      name: property_id
      in: path
      description: The resource ID of the Personalization Property
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    PersonalizationTokenIdParameter:
      name: token_id
      in: path
      description: The resource ID of the Personalization Token
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    PersonalizationValueIdParameter:
      name: value_id
      in: path
      description: The resource ID of the Personalization Value
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    TopiaryIdParameter:
      name: topiary_id
      in: path
      description: The resource ID of the Topiary Folder
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    ImageIdParameter:
      name: image_id
      in: path
      description: The resource ID of the Image
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    VideoIdParameter:
      name: video_id
      in: path
      description: The resource ID of the Video
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    FilterAccountFieldGzippedDoc:
      name: filter[0][field]
      in: query
      required: true
      schema:
        type: string
        enum:
          - account
      example: account
    FilterAccountTypeGzippedDoc:
      name: filter[0][type]
      in: query
      required: true
      schema:
        type: string
        enum:
          - eq
      example: eq
    FilterAccountValueGzippedDoc:
      name: filter[0][value]
      in: query
      required: true
      schema:
        $ref: '#/components/schemas/ResourceIdSchema'
    FilterPropertiesFieldGzippedDoc:
      name: filter[1][field]
      in: query
      required: true
      schema:
        type: string
        enum:
          - properties
      example: properties
    FilterPropertiesTypeGzippedDoc:
      name: filter[1][type]
      in: query
      required: true
      schema:
        type: string
        enum:
          - eq
      example: eq
    FilterPropertiesValueGzippedDoc:
      name: filter[1][value]
      in: query
      required: true
      schema:
        type: string
        description: JSON string with edition filter
      example: '{"edition":"abc123"}'
    FilterFiletypeFieldGzippedDoc:
      name: filter[2][field]
      in: query
      required: true
      schema:
        type: string
        enum:
          - filetype
      example: filetype
    FilterFiletypeTypeGzippedDoc:
      name: filter[2][type]
      in: query
      required: true
      schema:
        type: string
        enum:
          - eq
      example: eq
    FilterFiletypeValueGzippedDoc:
      name: filter[2][value]
      in: query
      required: true
      schema:
        type: string
      example: application/gzip
    PageContentUUIDParameter:
      name: page_content_uuid
      in: path
      description: The Universally Unique Identifier of an element
      required: true
      schema:
        $ref: '#/components/schemas/UUIDSchema'
  responses:
    UnauthorizedError:
      description: Unauthorized - Invalid or missing API key
    BadRequestError:
      description: Bad Request - Invalid input
    DocResponse:
      description: JSON response for a Doc resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/DocResponseSchema'
    ListDocResponse:
      description: >-
        JSON response for a list of Docs. Additionally, it contains handy query
        information and href links to help navigate pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListDocResponseSchema'
    ProjectResponse:
      description: JSON response for a Project resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProjectResponseSchema'
    ListProjectResponse:
      description: >-
        JSON response for a list of Projects. Additionally, it contains handy
        query information and href links to help navigate pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListProjectResponseSchema'
    UserResponse:
      description: JSON response for a User resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UserResponseSchema'
    ListUserResponse:
      description: >-
        JSON response for a list of Users. Additionally, it contains handy query
        information and href links to help navigate pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListUserResponseSchema'
    WorkspaceResponse:
      description: JSON response for a Workspace resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/WorkspaceResponseSchema'
    ListWorkspaceResponse:
      description: >-
        JSON response for a list of Workspaces. Additionally, it contains handy
        query information and href links to help navigate pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListWorkspaceResponseSchema'
    PersonalizationCategoryResponse:
      description: JSON response for a Personalization Category resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PersonalizationCategoryResponseSchema'
    ListPersonalizationCategoryResponse:
      description: >-
        JSON response for a list of Personalization Categories. Additionally, it
        contains handy query information and href links to help navigate
        pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListPersonalizationCategoryResponseSchema'
    PersonalizationOptionResponse:
      description: JSON response for a Personalization Option resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PersonalizationOptionResponseSchema'
    ListPersonalizationOptionResponse:
      description: >-
        JSON response for a list of Personalization Options. Additionally, it
        contains handy query information and href links to help navigate
        pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListPersonalizationOptionResponseSchema'
    PersonalizationPropertyResponse:
      description: JSON response for a Personalization Property resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PersonalizationPropertyResponseSchema'
    ListPersonalizationPropertyResponse:
      description: >-
        JSON response for a list of Personalization Properties. Additionally, it
        contains handy query information and href links to help navigate
        pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListPersonalizationPropertyResponseSchema'
    PersonalizationTokenResponse:
      description: JSON response for a Personalization Token resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PersonalizationTokenResponseSchema'
    ListPersonalizationTokenResponse:
      description: >-
        JSON response for a list of Personalization Tokens. Additionally, it
        contains handy query information and href links to help navigate
        pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListPersonalizationTokenResponseSchema'
    PersonalizationValueResponse:
      description: JSON response for a Personalization Value resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PersonalizationValueResponseSchema'
    ListPersonalizationValueResponse:
      description: >-
        JSON response for a list of Personalization Values. Additionally it
        contains handy query information and href links to help navigate
        pagination.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListPersonalizationValueResponseSchema'
    PageContentResponse:
      description: >-
        JSON response containing the content-tree and other content metadata of
        a Page.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PageContentResponseSchema'
    ListGzippedDocsResponse:
      description: JSON response for a list of Download links for Gzipped Docs.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ListGzippedDocsResponseSchema'
    AnalyticsQueryResponse:
      description: JSON response for retrieving Foleon Analytics
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AnalyticsQueryResponseSchema'
          example:
            query:
              dimensions:
                - pageviews.account_id
                - pageviews.parent_account_id
                - pageviews.foleon_doc_id
                - pageviews.foleon_doc_name
                - projects.id
                - projects.name
              filters:
                - member: pageviews.account_id
                  values:
                    - '1'
                  operator: equals
              timezone: UTC
              limit: 5000
              total: true
              timeDimensions:
                - granularity: day
                  dateRange:
                    - '2025-07-01T00:00:00.000'
                    - '2025-08-01T23:59:59.999'
                  dimension: pageviews.timestamp
              measures:
                - pageviews.unique_clients
                - pageviews.unique_visits
                - pageviews.total_visits
                - pageviews.bounced
              rowLimit: 5000
            data: []
            lastRefreshTime: '2025-07-15T12:24:11.163Z'
            annotation: {}
            dataSource: default
            dbType: bigquery
            extDbType: cubestore
            external: false
            slowQuery: false
            total: 0
    TopiaryResponse:
      description: JSON response for a topiary object (a media library folder)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TopiaryResponseSchema'
    ImageResponse:
      description: JSON response for an Image object in the Media Library
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ImageResponseSchema'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
