---
title: "Create Job"
method: POST
path: "/api/jobs"
tags: ["jobs"]
---

# Create Job

`POST /api/jobs`

## Request

- Base URL: `https://api.flagpost.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.flagpost.ai/api/jobs`
- Auth: HTTP bearer

Create a new background job.

Returns immediately with job ID. Poll GET /api/jobs/{job_id} for status.

Args:
    job_data: Job type and payload
    ctx: Advisor context with RLS-scoped Supabase client

Returns:
    Created job with status 'pending'

## Request body

- JobCreate: Model for creating a new job.
  - `job_type` 'report_generation' | 'custom_report_analysis' | 'report_section_generation' | 'zip_extraction' | 'reminder_processing' | 'document_processing' | 'rag_engine_upload' | 'file_search_index' | 'manifest_generation' | 'vdr_classification' | 'insight_extraction' | 'red_flag_extraction' | 'advisor_insight_fill' | 'research_generation' | 'summary_generation' | 'insight_answer' | 'request_matching' | 'adjustment_generation' | 'adjustment_quantification' | 'data_cleaning' | 'coa_remapping' | 'anonymization_scan' | 'anonymization_run' | 'markdown_extraction' | 'document_indexing' | 'table_extraction' | 'markdown_batch_poll' | 'inbound_email', required: Job type enum - must match database enum job_type.
  - `payload` object

## Response `200`

Successful Response

- JobResponse: API response model for job status.
  - `id` string, uuid, required
  - `status` 'pending' | 'processing' | 'completed' | 'failed', required: Job status enum - must match database enum job_status.
  - `job_type` 'report_generation' | 'custom_report_analysis' | 'report_section_generation' | 'zip_extraction' | 'reminder_processing' | 'document_processing' | 'rag_engine_upload' | 'file_search_index' | 'manifest_generation' | 'vdr_classification' | 'insight_extraction' | 'red_flag_extraction' | 'advisor_insight_fill' | 'research_generation' | 'summary_generation' | 'insight_answer' | 'request_matching' | 'adjustment_generation' | 'adjustment_quantification' | 'data_cleaning' | 'coa_remapping' | 'anonymization_scan' | 'anonymization_run' | 'markdown_extraction' | 'document_indexing' | 'table_extraction' | 'markdown_batch_poll' | 'inbound_email', required: Job type enum - must match database enum job_type.
  - `payload` object
  - `result` object, nullable
  - `error` string, nullable
  - `created_at` string, date-time, required
  - `started_at` string, date-time, nullable
  - `completed_at` string, date-time, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/flagpost/apis/flagpost-api.md) - [All operations](https://skmtc.dev/flagpost/apis/flagpost-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flagpost/apis/flagpost-api/revisions/0308cef485ca?raw)
