Browse documentation
API referencePOST/v1/batch/jobs50 credits / job + 5 / summary

Create batch job

POST /v1/batch/jobs

Each line in the uploaded JSONL file should contain one valid daily-summary request object. Intraday and News mode lines can independently request up to seven days of context.

When to use it

Use this endpoint for bulk summary workloads that should run asynchronously.

Authentication and billing

  • Requires X-API-Key or api_key.
  • Credit cost: 50 credits / job + 5 / summary. Job creation bills 50 credits when accepted. Each successfully processed portfolio summary bills 5 credits.
  • See pricing for plan allowances and full billing details.

Request

Body: Multipart file upload with a .jsonl file, optional display name, and optional JSON metadata string. Each JSONL line includes custom_id, one of portfolio, symbols, or items, and an optional mode. Intraday and News mode lines may set their own context_window_days from 1 to 7, using Asia/Kolkata calendar days inclusive of today.

FieldLocationRequiredNotes
filebodyYesRequired .jsonl multipart upload. Each line must contain a valid daily-summary request and custom_id. For intraday_movements and news_context, each line may set context_window_days from 1 to 7; the default is 1.
display_namebodyNoOptional human-readable batch name.
metadatabodyNoOptional JSON object serialized as a multipart string for client-defined job metadata.
X-Alpha-Content-RetentionheaderNoOptional. Set none to opt out of retained request content when your account policy permits it.
api_keyqueryNoOptional alternative to the X-API-Key header. Prefer the header for server-side applications.

Response

Returns a batch job id, status, timestamps, and request counts.

Successful Responseapplication/json
{
  "created_at": 1709230500,
  "display_name": "portfolio_batch.jsonl",
  "id": "batch_a1b2c3d4e5f6g7h8",
  "in_progress_at": 1709230505,
  "metadata": {
    "user_id": "usr_123"
  },
  "object": "batch",
  "request_counts": {
    "completed": 2,
    "failed": 0,
    "total": 5
  },
  "status": "in_progress"
}

Request pattern

bash
curl "https://developers.manasija.in/v1/batch/jobs" \
  -H "X-API-Key: $DRISHTI_API_KEY" \
  -F "[email protected]" \
  -F "display_name=Quarterly run"

JavaScript / TypeScript SDK

ts
const job = await client.postBatchJobsFile({
  file: fileBlob,
  filename: "batch.jsonl",
  display_name: "Quarterly run",
})

Python SDK

python
job = client.post_batch_jobs_file(
    file_name="batch.jsonl",
    file_bytes=file_bytes,
    display_name="Quarterly run",
)

Interactive reference

Use the Scalar API client for executable requests, schemas, and the full OpenAPI contract.