> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vatis.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload

> Upload a stream of bytes to a new stream

<Warning>
  Please note the body can be any binary data.
  Use the [Swagger UI](https://http-gateway.vatis.tech/swagger-ui/index.html) to test this endpoint.
</Warning>


## OpenAPI

````yaml post /http-gateway/api/v1/upload
openapi: 3.0.1
info:
  title: Vatis HTTP Gateway
  description: Vatis HTTP Gateway API
  version: '1.0'
servers:
  - url: https://http-gateway.vatis.tech
    description: Default server
security: []
paths:
  /http-gateway/api/v1/upload:
    post:
      summary: Upload
      description: Upload a stream of bytes to a new stream
      operationId: upload
      parameters:
        - name: id
          in: query
          description: Stream id. The stream created on this upload will bear this id
          schema:
            type: string
            format: uuid
        - name: name
          in: query
          description: Stream name
          schema:
            type: string
        - name: groupId
          in: query
          description: Stream group id
          schema:
            type: string
            format: uuid
        - name: streamConfigurationTemplateId
          in: query
          description: Stream configuration template id
          required: true
          schema:
            type: string
        - name: patches
          in: query
          description: >+
            Stream patches. A map of key-value pairs where all unknown query
            parameters will be interpreted as patches.


            Prefix keys with 'patches.' to explicitly mark the query parameter
            as patch (e.g. when it coincides with another parameter name).


            By default, a replace patch will be applied.


            To add, prefix the value with '+' (e.g. patches.key=+value).


            To remove, set the value to '-' (e.g. patches.key=-).


            To escape the special characters + and -, use '\\' (backslash)
            escape-character (e.g. 'patches.key=\\+value' will replace the key
            'key' with value '+value').


            To symbolize a path, use '.' as a separator (e.g.
            'patches.key.with.path' will be parsed to '/key/with/path').

          explode: true
          schema:
            type: object
          example:
            patches.key1: value-replace-explicit-patch
            key2: value-replace-implicit-patch
            patches.key3: +add-value
            patches.key-remove: '-'
            patches.key.with.path: value
        - name: X-Vat-Meta-Template-Patch
          in: header
          description: Stream configuration template JSON patches as described in RFC-6902
          schema:
            type: string
          example:
            - op: replace
              path: /json/path
              value: some_value
        - name: persist
          in: query
          description: Persist the sinks of the stream matched by the tags
          schema:
            type: boolean
        - name: persistTags
          in: query
          description: Persist tags to match the sinks of the stream
          schema:
            minItems: 1
            type: array
        - name: matchPersistTags
          in: query
          description: >-
            Tags matching strategy. 'ALL'/'ANY' of specified tags must be
            present on the sink to be marked as persistent
          schema:
            type: string
            enum:
              - ALL
              - ANY
        - name: webhook
          in: query
          description: >
            Define dynamic webhooks for this stream as query parameters.


            The general structure is
            "webhook[.RESOURCE[.STATE]]=http://my_domain/path".


            For example:


            - define a webhook for stream completion:
            "webhook.stream.completed=http://my_domain/success"


            - define a webhook for all stream events:
            "webhook.stream=http://my_domain/stream_event"


            - define the same webhook for stream completion and failure:
            "webhook.stream.completed=http://my_domain/path&webhook.stream.failed=http://my_domain/path"


            - define a webhook for all events: "webhook=http://my_domain/path"
          explode: true
          schema:
            type: object
          example:
            webhook.stream.completed: http://my_domain/success
            webhook.stream.failed: http://my_domain/fail
      requestBody:
        description: The stream of bytes or the multipart form-data to upload
        content:
          application/octet-stream:
            schema:
              type: string
              format: binary
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/MultipartUploadRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreamDto'
        default:
          description: Error while uploading the stream
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerToken: []
components:
  schemas:
    MultipartUploadRequest:
      required:
        - configuration
        - file
      type: object
      properties:
        configuration:
          $ref: '#/components/schemas/HttpStreamConfigurationDto'
        file:
          type: string
          description: Stream data
          format: binary
      description: Multipart form-data request
    StreamDto:
      type: object
      properties:
        streamId:
          type: string
          format: uuid
        name:
          type: string
        groupId:
          type: string
          format: uuid
        configuration:
          $ref: '#/components/schemas/StreamConfigurationDto'
        createdTimestamp:
          type: string
          format: date-time
        creatorId:
          type: string
        groupCreatorId:
          type: string
        state:
          type: string
          enum:
            - READY
            - COMPLETED
            - FAILED
            - EXPIRED
        stateDescription:
          type: string
        finalizedTimestamp:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
        title:
          type: string
        message:
          type: string
        internalErrorName:
          type: string
        nestedErrors:
          type: array
          items:
            type: object
    HttpStreamConfigurationDto:
      type: object
      properties:
        patches:
          type: object
          additionalProperties:
            type: object
        webhook:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
      description: >
        Define dynamic webhooks for this stream as query parameters.


        The general structure is
        "webhook[.RESOURCE[.STATE]]=http://my_domain/path".


        For example:


        - define a webhook for stream completion:
        "webhook.stream.completed=http://my_domain/success"


        - define a webhook for all stream events:
        "webhook.stream=http://my_domain/stream_event"


        - define the same webhook for stream completion and failure:
        "webhook.stream.completed=http://my_domain/path&webhook.stream.failed=http://my_domain/path"


        - define a webhook for all events: "webhook=http://my_domain/path"
      example:
        patches:
          languages: ro
        webhook:
          http://my_domain/path:
            - stream.completed
    StreamConfigurationDto:
      type: object
      properties:
        streamConfigurationTemplateId:
          type: string
        dataSource:
          $ref: '#/components/schemas/TopicDto'
        dataSinks:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/TopicDto'
        processors:
          type: array
          items:
            $ref: '#/components/schemas/ProcessorConfigurationDto'
        dynamicWebhookEndpoints:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEndpointDto'
    TopicDto:
      type: object
      properties:
        topic:
          type: string
        messageSchema:
          type: string
        connectionOptions:
          type: object
          additionalProperties:
            type: string
        headers:
          type: object
          additionalProperties:
            type: string
        messageHeaders:
          type: object
          additionalProperties:
            type: string
        subscriptions:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/SubscriptionDto'
    ProcessorConfigurationDto:
      type: object
      properties:
        id:
          type: string
        source:
          $ref: '#/components/schemas/SubscriptionDto'
        destination:
          $ref: '#/components/schemas/TopicDto'
        clusterDomainName:
          type: string
        podsDiscoveryClusterDomainName:
          type: string
        propertiesSchema:
          type: string
        properties:
          type: object
        egress:
          $ref: '#/components/schemas/ProcessorEgressConfigurationDto'
    WebhookEndpointDto:
      type: object
      properties:
        id:
          type: string
        url:
          type: string
        events:
          type: array
          items:
            type: string
        enabled:
          type: boolean
        description:
          type: string
    SubscriptionDto:
      type: object
      properties:
        subscription:
          type: string
        topic:
          type: string
        messageSchema:
          type: string
        connectionOptions:
          type: object
          additionalProperties:
            type: string
        headers:
          type: object
          additionalProperties:
            type: string
    ProcessorEgressConfigurationDto:
      type: object
      properties:
        persist:
          type: boolean
        sink:
          type: boolean
        tags:
          type: array
          items:
            type: string
  securitySchemes:
    bearerToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````