---
swagger: "2.0"
info:
  version: "7.2.1"
  title: "Activiti Cloud Starter :: Modeling ReST API"
  license:
    name: "© null-null null. All rights reserved"
host: "localhost"
basePath: "/"
tags:
- name: "models"
  description: "Retrieve and manage models"
- name: "projects"
  description: "Retrieve and manage project definitions"
paths:
  /v1/model-types:
    get:
      tags:
      - "models"
      summary: "List model types"
      description: "Get the list of available model types."
      operationId: "getModelTypesUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "maxItems"
        in: "query"
        required: false
        type: "integer"
        format: "int32"
      - name: "skipCount"
        in: "query"
        required: false
        type: "integer"
        format: "int32"
      - name: "sort"
        in: "query"
        required: false
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/ListResponseContent«ModelType»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/models:
    get:
      tags:
      - "models"
      summary: "List all the models that are not coupled to a project"
      description: "Get the models that has GLOBAL as scope. Minimal information for\
        \ each model is returned."
      operationId: "getGlobalModelsUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "includeOrphans"
        in: "query"
        description: "If true, then models with no relationship to any project are\
          \ retrieved regardless of their scope"
        required: false
        type: "boolean"
        default: false
      - name: "maxItems"
        in: "query"
        required: false
        type: "integer"
        format: "int32"
      - name: "skipCount"
        in: "query"
        required: false
        type: "integer"
        format: "int32"
      - name: "sort"
        in: "query"
        required: false
        type: "string"
      - name: "type"
        in: "query"
        description: "The type of the model to filter"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/ListResponseContent«Model»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    post:
      tags:
      - "models"
      summary: "Create new model that does note belong to a project"
      description: "Create a new model with no relationship to other projects"
      operationId: "createModelWithoutProjectUsingPOST"
      consumes:
      - "application/json"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - in: "body"
        name: "model"
        description: "The details of the model to create"
        required: true
        schema:
          $ref: "#/definitions/ModelReq"
      responses:
        "201":
          description: "Created"
          schema:
            $ref: "#/definitions/EntryResponseContent«Model»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/models/{modelId}:
    get:
      tags:
      - "models"
      summary: "Get metadata information for a model"
      operationId: "getModelUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "modelId"
        in: "path"
        description: "The id of the model to retrieve"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/EntryResponseContent«Model»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    put:
      tags:
      - "models"
      summary: "Update model metadata"
      description: "Update the details of a model."
      operationId: "updateModelUsingPUT"
      consumes:
      - "application/json"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - in: "body"
        name: "model"
        description: "The new values to update"
        required: true
        schema:
          $ref: "#/definitions/ModelReq"
      - name: "modelId"
        in: "path"
        description: "The id of the model to update"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/EntryResponseContent«Model»"
        "201":
          description: "Created"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    delete:
      tags:
      - "models"
      summary: "Delete model"
      operationId: "deleteModelUsingDELETE"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "modelId"
        in: "path"
        description: "The id of the model to delete"
        required: true
        type: "string"
      responses:
        "204":
          description: "No Content"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
  /v1/models/{modelId}/content:
    get:
      tags:
      - "models"
      summary: "Get the model content"
      description: "Retrieve the content of the model for the identifier <b>modelId</b>\
        \ with the content type corresponding to the model type (xml for process models\
        \ and json for the others).<br>For <b>Accept: image/svg+xml</b> request header,\
        \ the svg image corresponding to the model content will be retrieved."
      operationId: "getModelContentUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      - "image/svg+xml"
      parameters:
      - name: "modelId"
        in: "path"
        description: "The id of the model to get the content"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    put:
      tags:
      - "models"
      summary: "Update model content"
      description: "Update the content of the model from file."
      operationId: "updateModelContentUsingPUT"
      consumes:
      - "multipart/form-data"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "file"
        in: "formData"
        required: false
        type: "file"
      - name: "modelId"
        in: "path"
        description: "The id of the model to update"
        required: true
        type: "string"
      responses:
        "201":
          description: "Created"
        "204":
          description: "No Content"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/models/{modelId}/export:
    get:
      tags:
      - "models"
      summary: "Export a model definition as file"
      description: "Allows to download a file containing a model metadata along with\
        \ the model content."
      operationId: "exportModelUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "attachment"
        in: "query"
        description: "<b>true</b> value enables a web browser to download the file\
          \ as an attachment.<br> <b>false</b> means that a web browser may preview\
          \ the file in a new tab or window, but not download the file."
        required: false
        type: "boolean"
        default: true
      - name: "modelId"
        in: "path"
        description: "The id of the model to export"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/models/{modelId}/validate:
    post:
      tags:
      - "models"
      summary: "Validate a model content"
      description: "Allows to validate the model content without save it."
      operationId: "validateModelUsingPOST"
      consumes:
      - "multipart/form-data"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - in: "body"
        name: "file"
        description: "The file containing the model definition to validate"
        required: true
        schema:
          type: "string"
          format: "binary"
      - name: "modelId"
        in: "path"
        description: "The id of the model to validate the content for"
        required: true
        type: "string"
      - name: "projectId"
        in: "query"
        description: "The id of the project in whose context the model is going to\
          \ be validated"
        required: false
        type: "string"
      - name: "validateUsage"
        in: "query"
        description: "The model is going to be validated and checked used in other\
          \ model"
        required: false
        type: "boolean"
      responses:
        "201":
          description: "Created"
        "204":
          description: "No Content"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/models/{modelId}/validate/extensions:
    post:
      tags:
      - "models"
      summary: "Validate model extensions"
      description: "Allows to validate the model extensions without save them."
      operationId: "validateModelExtensionsUsingPOST"
      consumes:
      - "multipart/form-data"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - in: "body"
        name: "file"
        description: "The file containing the model extensions to validate"
        required: true
        schema:
          type: "string"
          format: "binary"
      - name: "modelId"
        in: "path"
        description: "The id of the model to validate the content for"
        required: true
        type: "string"
      - name: "projectId"
        in: "query"
        description: "The id of the project in whose context the model is going to\
          \ be validated"
        required: false
        type: "string"
      responses:
        "201":
          description: "Created"
        "204":
          description: "No Content"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/projects:
    get:
      tags:
      - "projects"
      summary: "List projects"
      description: "Get the list of available projects. Minimal information for each\
        \ project is returned."
      operationId: "getProjectsUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "maxItems"
        in: "query"
        required: false
        type: "integer"
        format: "int32"
      - name: "name"
        in: "query"
        description: "The name or part of the name to filter projects"
        required: false
        type: "string"
      - name: "skipCount"
        in: "query"
        required: false
        type: "integer"
        format: "int32"
      - name: "sort"
        in: "query"
        required: false
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/ListResponseContent«Project»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    post:
      tags:
      - "projects"
      summary: "Create new project"
      operationId: "createProjectUsingPOST"
      consumes:
      - "application/json"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - in: "body"
        name: "project"
        description: "The details of the project to create"
        required: true
        schema:
          $ref: "#/definitions/Project"
      responses:
        "201":
          description: "Created"
          schema:
            $ref: "#/definitions/EntryResponseContent«Project»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/projects/import:
    post:
      tags:
      - "projects"
      summary: "Import an project as zip file"
      description: "Allows a zip file to be uploaded containing an project definition\
        \ and any number of included models."
      operationId: "importProjectUsingPOST"
      consumes:
      - "multipart/form-data"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "name"
        in: "formData"
        required: false
        type: "string"
      - in: "body"
        name: "file"
        description: "The file containing the zipped project"
        required: true
        schema:
          type: "string"
          format: "binary"
      responses:
        "201":
          description: "Created"
          schema:
            $ref: "#/definitions/EntryResponseContent«Project»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/projects/{projectId}:
    get:
      tags:
      - "projects"
      summary: "Get project"
      operationId: "getProjectUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "projectId"
        in: "path"
        description: "The id of the project to retrieve"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/EntryResponseContent«Project»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    put:
      tags:
      - "projects"
      summary: "Update project details"
      operationId: "updateProjectUsingPUT"
      consumes:
      - "application/json"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - in: "body"
        name: "project"
        description: "The new values to update"
        required: true
        schema:
          $ref: "#/definitions/Project"
      - name: "projectId"
        in: "path"
        description: "The id of the project to update"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/EntryResponseContent«Project»"
        "201":
          description: "Created"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    delete:
      tags:
      - "projects"
      summary: "Delete project"
      operationId: "deleteProjectUsingDELETE"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "projectId"
        in: "path"
        description: "The id of the project to delete"
        required: true
        type: "string"
      responses:
        "204":
          description: "No Content"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
  /v1/projects/{projectId}/copy:
    post:
      tags:
      - "projects"
      summary: "Copy an project as a new project with chosen name"
      description: "This will create a new project with chosen name containing the\
        \ project folder and all related models.<br>"
      operationId: "copyProjectUsingPOST"
      consumes:
      - "application/json"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "name"
        in: "query"
        description: "The name of the project that will replace the original name\
          \ of the project"
        required: true
        type: "string"
      - name: "projectId"
        in: "path"
        description: "The id of the project to copy"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/EntryResponseContent«Project»"
        "201":
          description: "Created"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/projects/{projectId}/export:
    get:
      tags:
      - "projects"
      summary: "Export an project as zip file"
      description: "This will create and download the zip containing the project folder\
        \ and all related models.<br>"
      operationId: "exportProjectUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "attachment"
        in: "query"
        description: "<b>true</b> value enables a web browser to download the file\
          \ as an attachment.<br> <b>false</b> means that a web browser may preview\
          \ the file in a new tab or window, but not download the file."
        required: false
        type: "boolean"
        default: true
      - name: "projectId"
        in: "path"
        description: "The id of the project to export"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/projects/{projectId}/models:
    get:
      tags:
      - "models"
      summary: "List models for an project"
      description: "Get the models associated with an project. Minimal information\
        \ for each model is returned."
      operationId: "getModelsUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "maxItems"
        in: "query"
        required: false
        type: "integer"
        format: "int32"
      - name: "projectId"
        in: "path"
        description: "The id of the project to get the models for"
        required: true
        type: "string"
      - name: "skipCount"
        in: "query"
        required: false
        type: "integer"
        format: "int32"
      - name: "sort"
        in: "query"
        required: false
        type: "string"
      - name: "type"
        in: "query"
        description: "The type of the model to filter"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/ListResponseContent«Model»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    post:
      tags:
      - "models"
      summary: "Create new model belonging to an project"
      description: "Create a new model related to an existing project"
      operationId: "createModelUsingPOST"
      consumes:
      - "application/json"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - in: "body"
        name: "model"
        description: "The details of the model to create"
        required: true
        schema:
          $ref: "#/definitions/ModelReq"
      - name: "projectId"
        in: "path"
        description: "The id of the project to associate the new model with"
        required: true
        type: "string"
      responses:
        "201":
          description: "Created"
          schema:
            $ref: "#/definitions/EntryResponseContent«Model»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/projects/{projectId}/models/import:
    post:
      tags:
      - "models"
      summary: "Import a model from file"
      description: "Allows a file to be uploaded containing a model definition."
      operationId: "importModelUsingPOST"
      consumes:
      - "multipart/form-data"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "file"
        in: "formData"
        required: false
        type: "file"
      - name: "type"
        in: "formData"
        required: false
        type: "string"
      - name: "projectId"
        in: "path"
        description: "The id of the project to associate the new model with"
        required: true
        type: "string"
      responses:
        "201":
          description: "Created"
          schema:
            $ref: "#/definitions/EntryResponseContent«Model»"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
  /v1/projects/{projectId}/models/{modelId}:
    put:
      tags:
      - "models"
      summary: "Add or update the relationship between an existing model, and the\
        \ project"
      description: "Get the model associated with the project updated. Minimal information\
        \ for the model is returned."
      operationId: "putProjectModelRelationshipUsingPUT"
      consumes:
      - "application/json"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "force"
        in: "query"
        description: "If the scope of the model has restrictions on the number of\
          \ projects that a model can belong to, remove the other relationships of\
          \ the model with other projects"
        required: false
        type: "boolean"
        default: false
      - name: "modelId"
        in: "path"
        description: "The id of the model to associate the project with"
        required: true
        type: "string"
      - name: "projectId"
        in: "path"
        description: "The id of the project to associate the model with"
        required: true
        type: "string"
      - name: "scope"
        in: "query"
        description: "Scope to update the model if needed (optional)"
        required: false
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/EntryResponseContent«Model»"
        "201":
          description: "Created"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
    delete:
      tags:
      - "models"
      summary: "Delete the relationship between an existing model, and the project"
      description: "Get the model associated with the project updated. Minimal information\
        \ for the model is returned."
      operationId: "deleteProjectModelRelationshipUsingDELETE"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "modelId"
        in: "path"
        description: "The id of the model of the relationship to delete"
        required: true
        type: "string"
      - name: "projectId"
        in: "path"
        description: "The id of the project of the relationship to delete"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
          schema:
            $ref: "#/definitions/EntryResponseContent«Model»"
        "204":
          description: "No Content"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
  /v1/projects/{projectId}/validate:
    get:
      tags:
      - "projects"
      summary: "Validate an project by id"
      operationId: "validateProjectUsingGET"
      produces:
      - "application/hal+json"
      - "application/json"
      parameters:
      - name: "projectId"
        in: "path"
        description: "The id of the project to validate"
        required: true
        type: "string"
      responses:
        "200":
          description: "OK"
        "401":
          description: "Unauthorized"
        "403":
          description: "Forbidden"
        "404":
          description: "Not Found"
definitions:
  EntriesResponseContent«ModelType»:
    type: "object"
    properties:
      entries:
        type: "array"
        items:
          $ref: "#/definitions/EntryResponseContent«ModelType»"
      pagination:
        $ref: "#/definitions/PaginationMetadata"
    title: "EntriesResponseContent«ModelType»"
  EntriesResponseContent«Model»:
    type: "object"
    properties:
      entries:
        type: "array"
        items:
          $ref: "#/definitions/EntryResponseContent«Model»"
      pagination:
        $ref: "#/definitions/PaginationMetadata"
    title: "EntriesResponseContent«Model»"
  EntriesResponseContent«Project»:
    type: "object"
    properties:
      entries:
        type: "array"
        items:
          $ref: "#/definitions/EntryResponseContent«Project»"
      pagination:
        $ref: "#/definitions/PaginationMetadata"
    title: "EntriesResponseContent«Project»"
  EntryResponseContent«ModelType»:
    type: "object"
    properties:
      entry:
        $ref: "#/definitions/ModelType"
    title: "EntryResponseContent«ModelType»"
  EntryResponseContent«Model»:
    type: "object"
    properties:
      entry:
        $ref: "#/definitions/ModelRes"
    title: "EntryResponseContent«Model»"
  EntryResponseContent«Project»:
    type: "object"
    properties:
      entry:
        $ref: "#/definitions/Project"
    title: "EntryResponseContent«Project»"
  ListResponseContent«ModelType»:
    type: "object"
    properties:
      list:
        $ref: "#/definitions/EntriesResponseContent«ModelType»"
    title: "ListResponseContent«ModelType»"
  ListResponseContent«Model»:
    type: "object"
    properties:
      list:
        $ref: "#/definitions/EntriesResponseContent«Model»"
    title: "ListResponseContent«Model»"
  ListResponseContent«Project»:
    type: "object"
    properties:
      list:
        $ref: "#/definitions/EntriesResponseContent«Project»"
    title: "ListResponseContent«Project»"
  ModelReq:
    type: "object"
    properties:
      content:
        type: "string"
        format: "byte"
      contentType:
        type: "string"
      createdBy:
        type: "object"
      creationDate:
        type: "string"
        format: "date-time"
      extensions:
        type: "object"
      id:
        type: "string"
      lastModifiedBy:
        type: "object"
      lastModifiedDate:
        type: "string"
        format: "date-time"
      name:
        type: "string"
      scope:
        type: "string"
        enum:
        - "GLOBAL"
        - "PROJECT"
      template:
        type: "string"
      type:
        type: "string"
    title: "ModelReq"
  ModelRes:
    type: "object"
    properties:
      content:
        type: "string"
        format: "byte"
      contentType:
        type: "string"
      createdBy:
        type: "object"
      creationDate:
        type: "string"
        format: "date-time"
      extensions:
        type: "object"
      id:
        type: "string"
      lastModifiedBy:
        type: "object"
      lastModifiedDate:
        type: "string"
        format: "date-time"
      name:
        type: "string"
      projects:
        type: "array"
        uniqueItems: true
        items:
          $ref: "#/definitions/Project"
      scope:
        type: "string"
        enum:
        - "GLOBAL"
        - "PROJECT"
      template:
        type: "string"
      type:
        type: "string"
      version:
        type: "string"
    title: "ModelRes"
  ModelType:
    type: "object"
    properties:
      allowedContentFileExtension:
        type: "array"
        items:
          type: "string"
      contentFileExtension:
        type: "string"
      extensionsFileSuffix:
        type: "string"
      folderName:
        type: "string"
      name:
        type: "string"
    title: "ModelType"
  PaginationMetadata:
    type: "object"
    properties:
      count:
        type: "integer"
        format: "int64"
      hasMoreItems:
        type: "boolean"
      maxItems:
        type: "integer"
        format: "int64"
      skipCount:
        type: "integer"
        format: "int64"
      totalItems:
        type: "integer"
        format: "int64"
    title: "PaginationMetadata"
  Project:
    type: "object"
    properties:
      createdBy:
        type: "object"
      creationDate:
        type: "string"
        format: "date-time"
      description:
        type: "string"
      id:
        type: "string"
      lastModifiedBy:
        type: "object"
      lastModifiedDate:
        type: "string"
        format: "date-time"
      name:
        type: "string"
      version:
        type: "string"
    title: "Project"
