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

# Get a document upload URL

> Returns a one-time URL the browser uploads a visitor's document to.



## OpenAPI

````yaml /api-reference/openapi.json post /api/mcp/modules/documents/upload-url
openapi: 3.1.0
info:
  title: Waniwani API
  version: 1.0.0
  description: >-
    The HTTP routes the Waniwani SDK and chat widget call. Use them from any
    language. Server routes take a secret `wwk_` API key; chat routes take a
    channel's `wwp_` public key, which is meant to ship in a web page.
servers:
  - url: https://app.waniwani.ai
    description: US region
  - url: https://eu.app.waniwani.ai
    description: EU region
security: []
tags:
  - name: Server API
    description: Called from your server with a secret `wwk_` API key.
  - name: Chat API
    description: Called from a web page with a channel's `wwp_` public key.
paths:
  /api/mcp/modules/documents/upload-url:
    post:
      tags:
        - Chat API
      summary: Get a document upload URL
      description: Returns a one-time URL the browser uploads a visitor's document to.
      operationId: createDocumentUploadUrl
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                filename:
                  type: string
                  minLength: 1
                  maxLength: 255
                contentType:
                  type: string
                  enum:
                    - application/pdf
                    - image/png
                    - image/jpeg
                    - image/tiff
                    - image/bmp
                    - image/gif
                    - image/webp
                byteSize:
                  type: integer
                  minimum: 1
                  maximum: 52428800
                sessionId:
                  type: string
                  minLength: 1
              required:
                - filename
                - contentType
                - byteSize
      responses:
        '200':
          description: '200'
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      documentId:
                        type: string
                        format: uuid
                      uploadUrl:
                        type: string
                        format: uri
                      headers:
                        type: object
                        additionalProperties:
                          type: string
                      expiresAt:
                        type: string
                        format: date-time
                    required:
                      - documentId
                      - uploadUrl
                      - headers
                      - expiresAt
                  error:
                    type: string
                  code:
                    type: string
                required:
                  - success
                  - message
                  - data
      security:
        - publicKeyAuth: []
components:
  securitySchemes:
    publicKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: WaniwaniPublicKey
      description: >-
        Waniwani public key passed as `Authorization: Bearer wwp_<key>`. A
        channel's public key is meant to ship in a web page.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.