Skip to content
Navigation

Create a private downloadable document

POST
https://api.nicer.travel/agent/documents

Renders the given content as a PDF, Markdown, text or CSV file in the caller's private document storage and returns its name, key and media type. Only the caller can open it, through POST /agent/documents/download. Any signed-in person may call it.

Authorization

  • bearerAuth
    HTTP Bearer (JWT)
    required

    Authorization: Bearer <token>

Request body JSON required

  • name
    string
    required
    maxLength: 120 · minLength: 1
  • content
    string
    required
    maxLength: 100000 · minLength: 1
  • format
    pdf
    or
    markdown
    or
    text
    or
    csv
    required

Returns

200

OK

JSON
  • documents
    array of
    object
    required
    • name
      string
      required
      maxLength: 160 · minLength: 1
    • mediaType
      string
      ·
      one of 8 values
      required
      Allowed values: application/pdf, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain, text/markdown, text/csv, text/html, image/png, image/jpeg
    • key
      string
      required
      maxLength: 512 · minLength: 1 · pattern: ^agentAttachment\/[^/]+\/[^/]+\/[^/]+$

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