Skip to content
Navigation

Get a file upload form

POST
https://api.nicer.travel/assets/create-put-url

Returns a form to upload one file of the given asset type and media type straight to storage: the presigned POST (its url and the fields to send with the file, valid for an hour), the key the file will have and, for a public type, the URL it will be served at; the metadata sent comes back in the answer too. Itinerary types need a tripItineraryId the caller may edit. Any signed-in person may call it. Errors: 400 ERROR_ASSET_INVALID_TYPE for an asset type that cannot be uploaded this way; 400 ERROR_ASSET_INVALID_MEDIA_TYPE for a media type the asset type does not take.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Returns

200

OK

JSON
  • key
    string
    required

    The key the file will have in storage.

  • presignedPost
    object
    required

    The form to post the file with, valid for an hour.

    • url
      string
      required

      Where to post the form.

    • fields
      map of
      string
      required

      The form fields to send, as they are, before the file.

  • assetUrl
    optional
    string

    The URL the file will be served at, for a public asset type; absent for a private one.

  • fileName
    optional
    string

    metadata.fileName, when the request sent one.

400

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

401

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

403

Request failed. errorCode is stable; errorMessage is for humans.
JSON
  • errorCode
    string
    required
  • errorMessage
    string
    required

Type to search…

↑↓ navigate↵ selectEsc close