Capmo Uploads API

The Uploads API from Capmo — 3 operation(s) for uploads.

OpenAPI Specification

capmo-uploads-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Capmo REST Organisation Companies Uploads API
  description: External REST API Documentation for Capmo
  version: '1.0'
  contact: {}
servers:
- url: https://api.capmo.de
  description: Production
tags:
- name: Uploads
  description: ''
paths:
  /api/v1/upload/projects/{projectId}/document-files:
    post:
      description: This can be used to obtain an upload URL for a new project document.
      operationId: getDocumentUploadUrl
      parameters:
      - name: projectId
        required: true
        in: path
        schema:
          type: string
      - name: Request-Id
        in: header
        description: The HTTP `Request-Id` request header is an optional and unofficial HTTP header, used to trace individual HTTP requests from the client to the server and back again. It allows the client and server to correlate each HTTP request. If not provided by the client, the server should generate a unique request ID and include it in the response.
        schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WriteDocumentFileUploadDto'
      responses:
        '200':
          description: The upload URL for a new project document has been successfully obtained.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Success
                  data:
                    $ref: '#/components/schemas/ReadDocumentFileUploadDto'
        '400':
          description: Bad request, Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#bad-request
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: BAD_REQUEST
                        message:
                          type: string
                          example: Bad request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#unauthorized
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: UNAUTHORIZED
                        message:
                          type: string
                          example: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#forbidden
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: FORBIDDEN
                        message:
                          type: string
                          example: Forbidden
        '404':
          description: Object not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#not-found
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: NOT_FOUND
                        message:
                          type: string
                          example: Object not found
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#conflict
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: CONFLICT
                        message:
                          type: string
                          example: Conflict
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#internal-server-error
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: INTERNAL_SERVER_ERROR
                        message:
                          type: string
                          example: Internal server error
      security:
      - CapmoAuth: []
      summary: ''
      tags:
      - Uploads
  /api/v1/upload/plans:
    post:
      description: This can be used to obtain an upload URL for a new plan file.
      operationId: getPlanUploadUrl
      parameters:
      - name: Request-Id
        in: header
        description: The HTTP `Request-Id` request header is an optional and unofficial HTTP header, used to trace individual HTTP requests from the client to the server and back again. It allows the client and server to correlate each HTTP request. If not provided by the client, the server should generate a unique request ID and include it in the response.
        schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WritePlanFileUploadDto'
      responses:
        '200':
          description: The upload URL has been successfully obtained.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Success
                  data:
                    $ref: '#/components/schemas/ReadPlanFileUploadDto'
        '400':
          description: Bad request, Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#bad-request
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: BAD_REQUEST
                        message:
                          type: string
                          example: Bad request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#unauthorized
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: UNAUTHORIZED
                        message:
                          type: string
                          example: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#forbidden
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: FORBIDDEN
                        message:
                          type: string
                          example: Forbidden
        '404':
          description: Object not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#not-found
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: NOT_FOUND
                        message:
                          type: string
                          example: Object not found
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#conflict
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: CONFLICT
                        message:
                          type: string
                          example: Conflict
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#internal-server-error
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: INTERNAL_SERVER_ERROR
                        message:
                          type: string
                          example: Internal server error
      security:
      - CapmoAuth: []
      summary: ''
      tags:
      - Uploads
  /api/v1/upload/ticket-attachments:
    post:
      description: This can be used to obtain an upload URL for a new ticket attachment.
      operationId: getTicketAttachmentUploadUrl
      parameters:
      - name: Request-Id
        in: header
        description: The HTTP `Request-Id` request header is an optional and unofficial HTTP header, used to trace individual HTTP requests from the client to the server and back again. It allows the client and server to correlate each HTTP request. If not provided by the client, the server should generate a unique request ID and include it in the response.
        schema: {}
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WriteTicketAttachmentUploadDto'
      responses:
        '200':
          description: The upload URL has been successfully obtained.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Success
                  data:
                    $ref: '#/components/schemas/ReadTicketAttachmentUploadDto'
        '400':
          description: Bad request, Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#bad-request
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: BAD_REQUEST
                        message:
                          type: string
                          example: Bad request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#unauthorized
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: UNAUTHORIZED
                        message:
                          type: string
                          example: Unauthorized
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#forbidden
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: FORBIDDEN
                        message:
                          type: string
                          example: Forbidden
        '404':
          description: Object not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#not-found
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: NOT_FOUND
                        message:
                          type: string
                          example: Object not found
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#conflict
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: CONFLICT
                        message:
                          type: string
                          example: Conflict
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                    example: https://capmoapi.readme.io/reference/errors#internal-server-error
                  message:
                    type: string
                    example: An error occurred
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        code:
                          type: string
                          example: INTERNAL_SERVER_ERROR
                        message:
                          type: string
                          example: Internal server error
      security:
      - CapmoAuth: []
      summary: ''
      tags:
      - Uploads
components:
  schemas:
    WritePlanFileUploadDto:
      type: object
      properties:
        name:
          type: string
          example: A-2-EG2.pdf
          description: The name of the file, including the file extension.
      required:
      - name
    ReadPlanFileUploadDto:
      type: object
      properties:
        upload_url:
          type: string
          example: https://example.com/upload-url
          description: The upload URL for the file.
        data_path:
          type: string
          example: tmp/d53e8d26-ed1e-11ee-82f7-df9b7663c64f/0a963a56-d21f-40e7-bf1f-36c0f5b1cafb
          description: The unique identifier of the file.
        expires:
          type: number
          example: 3600
          description: The expiration time in seconds of the upload URL.
        fields:
          type: object
          description: Additional fields required for the upload.
          example:
            Content-Type: application/pdf
            bucket: <bucket-name>
            X-Amz-Algorithm: AWS4-HMAC-SHA256
            X-Amz-Credential: <string>
            X-Amz-Date: 20240429T034549Z
            X-Amz-Security-Token: <string>
            key: tmp/9357781c-05da-11ef-9539-7b47b1fda975/eae0751a-9e89-4ff3-98a9-d4cb31f2a792
            Policy: <string>
            X-Amz-Signature: <string>
      required:
      - upload_url
      - data_path
      - expires
      - fields
    ReadDocumentFileUploadDto:
      type: object
      properties:
        upload_url:
          type: string
          example: https://example.com/upload-url
          description: The upload URL for the file.
        data_path:
          type: string
          example: tmp/d53e8d26-ed1e-11ee-82f7-df9b7663c64f/0a963a56-d21f-40e7-bf1f-36c0f5b1cafb
          description: The unique identifier of the file.
        expires:
          type: number
          example: 3600
          description: The expiration time in seconds of the upload URL.
        fields:
          type: object
          description: Additional fields required for the upload.
          example:
            Content-Type: application/pdf
            bucket: <bucket-name>
            X-Amz-Algorithm: AWS4-HMAC-SHA256
            X-Amz-Credential: <string>
            X-Amz-Date: 20240429T034549Z
            X-Amz-Security-Token: <string>
            key: tmp/9357781c-05da-11ef-9539-7b47b1fda975/eae0751a-9e89-4ff3-98a9-d4cb31f2a792
            Policy: <string>
            X-Amz-Signature: <string>
      required:
      - upload_url
      - data_path
      - expires
      - fields
    ReadTicketAttachmentUploadDto:
      type: object
      properties:
        upload_url:
          type: string
          example: https://example.com/upload-url
          description: The upload URL for the file.
        data_path:
          type: string
          example: tmp/d53e8d26-ed1e-11ee-82f7-df9b7663c64f/0a963a56-d21f-40e7-bf1f-36c0f5b1cafb
          description: The unique identifier of the file.
        expires:
          type: number
          example: 3600
          description: The expiration time in seconds of the upload URL.
        fields:
          type: object
          description: Additional fields required for the upload.
          example:
            Content-Type: application/pdf
            bucket: <bucket-name>
            X-Amz-Algorithm: AWS4-HMAC-SHA256
            X-Amz-Credential: <string>
            X-Amz-Date: 20240429T034549Z
            X-Amz-Security-Token: <string>
            key: tmp/9357781c-05da-11ef-9539-7b47b1fda975/eae0751a-9e89-4ff3-98a9-d4cb31f2a792
            Policy: <string>
            X-Amz-Signature: <string>
      required:
      - upload_url
      - data_path
      - expires
      - fields
    WriteTicketAttachmentUploadDto:
      type: object
      properties:
        name:
          type: string
          example: A-2-EG2.pdf
          description: The name of the file, including the file extension.
      required:
      - name
    WriteDocumentFileUploadDto:
      type: object
      properties:
        mime_type:
          type: string
          nullable: true
          description: The mime type of the file.
          example: application/pdf
      required:
      - mime_type
  securitySchemes:
    CapmoAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'For authentication, use the custom prefix followed by a space and then your API key. Example: "Capmo YOUR_API_KEY".'
x-readme:
  headers:
  - key: Request-Id
    value: YOUR_REQUEST_ID