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

# Create upload

> CreateUploadSession

 Creates a new upload session.



## OpenAPI

````yaml post /streaming/uploads/v1
openapi: 3.0.3
info:
  title: Studio API - Motto
  version: 0.0.0
servers:
  - url: https://api.mottostreaming.com
    description: Production server
security:
  - BearerAuth: []
tags:
  - name: AccountService
    description: Account management service
  - name: ActionConfigurationService
    description: Action configuration service definition
  - name: ActionSecretService
    description: Action type service definition
  - name: ActionService
    description: Action service definition
  - name: ActionTypeService
    description: Action type service definition
  - name: ActivityService
    description: Activity service definition
  - name: AdService
    description: Ad management service.
  - name: AnnotationService
    description: Annotation service definition
  - name: AnnotationSetService
    description: Annotation service definition
  - name: AnnotationTypeService
    description: Annotation service definition
  - name: AssetService
    description: Asset management service.
  - name: AuthService
    description: Auth service definition
  - name: BannerService
    description: Banner service definition
  - name: BannerV2Service_v2
    description: Banner service definition
  - name: CleengService
    description: CleengService service definition
  - name: ClipService
    description: ClipService is the service that handles Clip operations.
  - name: ConfigurationService
    description: >-
      Configuration management service. These configurations allow modifying the
      behavior of streams, uploads, simulcasts, etc.
  - name: ContentTypeService
    description: ContentType service definition
  - name: CreativeWorkService
    description: CreativeWork service definition
  - name: EntitlementService
    description: Entitlement service definition
  - name: EntityService
    description: Entity service definition
  - name: EventService
    description: Event service definition
  - name: FileService
    description: OTT files management.
  - name: IngestService
    description: Ingest management service.
  - name: IngestService_v2
    description: Ingest management service.
  - name: LiveStreamService
    description: LiveStream management service.
  - name: LiveStreamService_v2
    description: LiveStream management service.
  - name: OfferService
    description: Offer service definition
  - name: OrganizationService
    description: Organization management service.
  - name: PageService
    description: Page service definition
  - name: PlatformService
    description: Platform service definition
  - name: PlaylistService
    description: Playlist management service.
  - name: ProjectService
    description: Project management service.
  - name: SimulcastService
    description: Simulcast management service.
  - name: SlugService
    description: Slug service definition
  - name: SpiideoService
    description: SpiideoService service definition
  - name: StandingService
    description: Standing service definition
  - name: StitcherService
    description: StitcherService is the service that handles stitching operations.
  - name: StripeService
    description: StripeService service definition
  - name: SubscriptionService
    description: Subscription service definition
  - name: SubtitleService
    description: SubtitleService is the service that handles Subtitle operations.
  - name: TransactionService
    description: Transaction service definition
  - name: UploadService
    description: Upload management service.
  - name: UsageService
    description: The UsageService provides methods to retrieve usage data for SKUs.
  - name: UserService
    description: User management service
  - name: VODService
    description: VODService is the service that handles VOD operations.
  - name: VODService_v2
    description: VODService is the service that handles VOD operations.
  - name: VideoProtectionService
    description: VideoProtection management service.
  - name: VideoProtectionService_v2
    description: VideoProtection management service.
  - name: VideoService
    description: Video management service.
paths:
  /streaming/uploads/v1:
    post:
      tags:
        - UploadService
      description: |-
        CreateUploadSession

         Creates a new upload session.
      operationId: UploadService_CreateUploadSession
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/motto.streaming.upload.v1.CreateUploadSessionRequest
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/motto.streaming.upload.v1.CreateUploadSessionResponse
        default:
          description: Default error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/google.rpc.Status'
components:
  schemas:
    motto.streaming.upload.v1.CreateUploadSessionRequest:
      required:
        - project_id
        - region
        - object_name
        - content_type
        - ttl
        - size_bytes
        - access_control_mode
      type: object
      properties:
        project_id:
          type: string
          description: |-
            The ID of the project to create the upload session for.
             It must be a valid project ID. The final destination of the file will be
             determined by the project's region.
        region:
          enum:
            - REGION_UNSPECIFIED
            - REGION_AF
            - REGION_AS
            - REGION_EU
            - REGION_NA
            - REGION_OC
            - REGION_SA
          type: string
          description: |-
            The region to create the upload session for.
             It's recommended to use the region closest to the who will be reading the
             file. The final destination of the file will be determined by the project's
             region and will be stored in the region specified here.
          format: enum
        object_name:
          type: string
          description: |-
            The name of the object to create the upload session for.
             It's recommended to use the name of the file being uploaded.
        content_type:
          type: string
          description: |-
            The content type of the file being uploaded.
             For example, "image/png".
        ttl:
          pattern: ^-?(?:0|[1-9][0-9]{0,11})(?:\.[0-9]{1,9})?s$
          type: string
          description: |-
            The duration of the upload session.
             The upload session will expire after this duration. It's recommended to
             keep this duration as short as possible and no longer than 24 hours.
             It's useful when the session signed URL is shared with the client.
        size_bytes:
          type: string
          description: |-
            The size of the file being uploaded.
             It's useful when the session signed URL is shared with the client,
             so the client won't be able to upload a file larger than the size specified
             here.
        access_control_mode:
          enum:
            - ACCESS_CONTROL_MODE_UNSPECIFIED
            - ACCESS_CONTROL_MODE_PUBLICREAD
            - ACCESS_CONTROL_MODE_SIGNEDREAD
          type: string
          description: |-
            The access control mode of the file being uploaded.
             It's useful when the session signed URL is shared with the client,
             so the client won't be able to download the file after it's uploaded.
          format: enum
        resumable:
          type: boolean
          description: |-
            Whether the upload session is resumable.
             If set to true, the client can resume the upload session if it's interrupted.
             It's useful when the client is uploading a large file and the upload session
             is interrupted.
    motto.streaming.upload.v1.CreateUploadSessionResponse:
      type: object
      properties:
        upload_session:
          allOf:
            - $ref: '#/components/schemas/motto.streaming.upload.v1.UploadSession'
          description: Provides information about the upload session.
        signed_url:
          type: string
          description: |-
            The signed URL to upload the file to.

             The client should use this URL to upload the file via `PUT` request.
             `Content-Type` header should be set to the value specified when creating
             the upload session. The being uploaded `Content-Length` should be equal or
             less than the size specified when creating the upload session.

             The client should use `Blob` or `Binary` payload type for the request body and
             only send the file content. For example, formData is not supported because it
             will add additional metadata to the request body and increase the size of the
             request body which will cause the upload to fail because the size of the
             body will be larger than the size specified when creating the upload session.

             Chunked uploads are supported for large files.
    google.rpc.Status:
      type: object
      properties:
        code:
          type: integer
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          format: int32
        message:
          type: string
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
        details:
          type: array
          items:
            $ref: '#/components/schemas/google.protobuf.Any'
          description: >-
            A list of messages that carry the error details.  There is a common
            set of message types for APIs to use.
      description: >-
        The `Status` type defines a logical error model that is suitable for
        different programming environments, including REST APIs and RPC APIs. It
        is used by [gRPC](https://github.com/grpc). Each `Status` message
        contains three pieces of data: error code, error message, and error
        details. You can find out more about this error model and how to work
        with it in the [API Design
        Guide](https://cloud.google.com/apis/design/errors).
    motto.streaming.upload.v1.UploadSession:
      type: object
      properties:
        id:
          readOnly: true
          type: string
          description: A unique identifier for the upload session.
        project_id:
          readOnly: true
          type: string
          description: The project ID of the upload session.
        reserved_asset_id:
          readOnly: true
          type: string
          description: |-
            The reserved asset ID of the upload session.
             This is the asset ID that will be assigned to the asset once the upload
             session is completed.
        object_name:
          readOnly: true
          type: string
          description: |-
            Object name of the upload session.
             This is the object name that will be assigned to the asset once the upload
             session is completed. It's typically the name of the file.
        content_type:
          readOnly: true
          type: string
          description: |-
            The content type of the upload session.
             For example, "image/jpeg".
        size_bytes:
          readOnly: true
          type: string
          description: The size of the upload session in bytes.
        access_control_mode:
          readOnly: true
          enum:
            - ACCESS_CONTROL_MODE_UNSPECIFIED
            - ACCESS_CONTROL_MODE_PUBLICREAD
            - ACCESS_CONTROL_MODE_SIGNEDREAD
          type: string
          description: |-
            The access control mode of the file being uploaded.
             It's useful when the session signed URL is shared with the client,
             so the client won't be able to download the file after it's uploaded.
          format: enum
        expire_time:
          readOnly: true
          type: string
          description: The expiration time of the upload session.
          format: date-time
        create_time:
          readOnly: true
          type: string
          description: The creation time of the upload session.
          format: date-time
    google.protobuf.Any:
      type: object
      properties:
        '@type':
          type: string
          description: The type of the serialized message.
      additionalProperties: true
      description: >-
        Contains an arbitrary serialized message along with a @type that
        describes the type of the serialized message.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````