---
title: "Upload Text"
method: POST
path: "/v2/texts"
tags: ["Text Emotion API"]
---

# Upload Text

`POST /v2/texts`

## Request

- Base URL: `https://api.imentiv.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.imentiv.ai/v2/texts`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
  - OAuth 2
    - Authorization code: `https://api.imentiv.ai/oauth/authorize`
    - Token URL: `https://api.imentiv.ai/oauth/token` scopes: `media.write`

Analyze emotions and sentiment from text content.

Submit text directly, provide a cloud storage URL, or upload a text file (.txt, .srt, .pdf).

**Input Modes (provide exactly one):**
- **text**: Raw text content for direct analysis
- **text_url**: URL to a text file from Dropbox, Google Drive, AWS S3, or any public URL
- **text_file**: Direct file upload (.txt, .srt, .pdf)

**How It Works:**
1. Submit your text (or file URL / file upload) and receive an immediate response with a text ID
2. For file URLs/uploads: the file is downloaded/read, text extracted, and word count calculated
3. Text is queued for processing (typically completes within seconds)
4. Optionally receive a webhook notification via `callback_url` when complete
5. Retrieve results using the text ID

**Supported File Formats (for text_url and text_file):**
- `.txt` — Plain text files
- `.srt` — Subtitle files (timestamps are stripped, only text is extracted)
- `.pdf` — PDF documents (text extracted from all pages)

**Credit Usage:**
Billed on success; the amount is recorded after the run and is not quoted
on this request. Each text analysis is billed at least 2 credits. A 402 is
returned before processing starts when admission is refused.

## Request body `multipart/form-data`

- BodyUploadTextV2TextsPost
  - `title` string, nullable: A descriptive title for your text (e.g., 'Customer Feedback' or 'Meeting Notes').
  - `text` string, nullable: The raw text content to be analyzed for emotions. Provide exactly one of 'text', 'text_url', or 'text_file'.
  - `text_url` string, nullable: Cloud storage URL to a text file (.txt, .srt, .pdf). Supported: Dropbox, Google Drive, AWS S3, or direct public URLs. Provide exactly one of 'text', 'text_url', or 'text_file'.
  - `text_file` string, binary: Upload a text file (.txt, .srt, .pdf) directly. Provide exactly one of 'text', 'text_url', or 'text_file'.
  - `callback_url` string: Your webhook URL to receive a notification when analysis completes. Must be an https URL on a publicly reachable host.

## Response `200`

Successful Response

- TextEmotionResponseV2: V2 response model for text emotion detection. Supports direct text submission and cloud URL file uploads. Direct text submission with mandatory title field. Attributes: id (str): Unique ID of the text. title (str): Title of the text. status (str): Processing status (queue, processing, done, etc.). word_count (int): Number of words in the text. user_id (str): ID of the user who submitted the text. created_at (Optional[str]): Timestamp when text was created. media_source (Optional[str]): Cloud platform source (dropbox, google_drive, aws_s3, public_url). media_source_url (Optional[str]): Original cloud storage URL provided by user.
  - `id` string, required
  - `title` string, required
  - `status` string, required
  - `word_count` integer, required
  - `user_id` string, required
  - `created_at` string, nullable
  - `media_source` string, nullable
  - `media_source_url` string, nullable

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-22** `536bf48bb9fb`: 3 info
  - the endpoint scheme security `ApiKeyAuth` was added to the API
  - the endpoint scheme security `BearerAuth` was added to the API
  - the endpoint scheme security `OAuth2Delegated` was added to the API
- **2026-09-08** `b10651168511`: 1 info
  - the `text_file` request property type was generalized from no type to `string`, and format from no format to `binary`

[Operation history](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/changes/v2/texts/post.md)

---

[API](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai.md) - [All operations](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/llms.txt) - [OpenAPI document](https://skmtc.dev/imentiv/apis/welcome-to-imentiv-ai/revisions/bc15cec7e794?raw)
