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

# Presigned URL

> This endpoint generates presigned URLs for uploading audio files to S3. It provides the necessary credentials and upload parameters to securely upload files directly to AWS S3.


<Warning>This API is deprecated. Please use the new [EkaScribe Protocol APIs](/ekascribe/api-reference/sessions/overview) (Create Session → Upload Audio → End Session) or the [SDKs](/ekascribe/quickstart) instead.</Warning>

### Parameters

| Parameter | Type   | Required | Description                   |
| --------- | ------ | -------- | ----------------------------- |
| `txn_id`  | string | Yes      | Session ID for file upload    |
| `action`  | string | No       | Upload action: `ekascribe-v2` |

### Response

```json theme={null}
{
    "uploadData": {
        "url": "https://m-prod-ekascribe-batch.s3.amazonaws.com/",
        "fields": {
            "x-amz-meta-mode": "dictation",
            "x-amz-meta-uhid": "unique_patient_id",
            "x-amz-meta-hfid": "unique_health_facility_id",
            "key": "EC_173210496011417/txn_301/20250617_105524/${filename}",
            "x-amz-algorithm": "AWS4-HMAC-SHA256",
            "x-amz-credential": "...",
            "x-amz-date": "...",
            "policy": "...",
            "x-amz-signature": "..."
        }
    },
    "folderPath": "EC_173210496011417/txn_301/20250617_105524/",
    "txn_id": "txn_301"
}
```

## HTTP Status Codes

| Code | Description                          |
| ---- | ------------------------------------ |
| 200  | Presigned URL generated successfully |
| 204  | File uploaded successfully           |
| 403  | Upload failed (expired policy)       |

***


## OpenAPI

````yaml POST /v1/file-upload
openapi: 3.0.1
info:
  title: EkaScribe Voice API v2
  version: '2024-12-01T12:09:09Z'
  description: >-
    EkaScribe Voice-to-Prescription API for medical transcription and structured
    data generation
servers:
  - url: https://api.eka.care
    description: Production server
  - url: https://api.dev.eka.care
    description: Development server
security: []
paths:
  /v1/file-upload:
    post:
      summary: File Upload
      description: >
        This endpoint generates presigned URLs for uploading audio files to S3.
        It provides the necessary credentials and upload parameters to securely
        upload files directly to AWS S3.
      parameters:
        - name: txn_id
          in: query
          required: true
          description: Session ID for file upload
          schema:
            type: string
            example: txn_301
        - name: action
          in: query
          required: false
          description: Upload action type
          schema:
            type: string
            enum:
              - ekascribe-v2
            default: ekascribe-v2
            example: ekascribe-v2
      responses:
        '200':
          description: Presigned URL generated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  uploadData:
                    type: object
                    description: Contains the S3 upload URL and required form fields
                    properties:
                      url:
                        type: string
                        description: S3 bucket URL for uploading the file
                        example: https://m-prod-ekascribe-batch.s3.amazonaws.com/
                      fields:
                        type: object
                        description: Required form fields for S3 upload
                        properties:
                          x-amz-meta-mode:
                            type: string
                            example: dictation
                          key:
                            type: string
                            description: S3 key path with ${filename} placeholder
                            example: >-
                              EC_173210496011417/txn_301/20250617_105524/${filename}
                          x-amz-algorithm:
                            type: string
                            example: AWS4-HMAC-SHA256
                          x-amz-credential:
                            type: string
                            example: >-
                              ASIAYES5P2B2ZIB4II4R/20250617/ap-south-1/s3/aws4_request
                          x-amz-date:
                            type: string
                            example: 20250617T105524Z
                          x-amz-security-token:
                            type: string
                            description: AWS security token for authentication
                          policy:
                            type: string
                            description: Base64 encoded policy document
                          x-amz-signature:
                            type: string
                            description: AWS signature for the request
                        additionalProperties: true
                  folderPath:
                    type: string
                    description: The folder path where files will be stored in S3
                    example: EC_173210496011417/txn_301/20250617_105524/
                  txn_id:
                    type: string
                    description: Transaction ID to be used for subsequent operations
                    example: txn_301
        '400':
          description: Bad Request - Invalid request parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code
        '401':
          description: Unauthorized - Invalid or missing authentication token
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized
                  message:
                    type: string
                    example: Invalid or missing authentication token
        '403':
          description: Upload failed (expired policy)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message
                  code:
                    type: string
                    description: Error code
      security:
        - auth: []
components:
  securitySchemes:
    auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your auth token.

````