ข้ามไปยังเนื้อหา
TH
รับคีย์ API
เรียกดูเอกสาร

เอกสารอ้างอิง API

API ประมวลผล Bulk

สร้างและควบคุมงาน YouTube จากนั้นรับช่วงรายการ และส่วนผลลัพธ์ของพวกเขา

ในหน้านี้

พื้นที่ทดลอง API

เลือกแหล่งและคัดลอกฉบับที่เสร็จสมบูรณ์ Python หรือ Bash การทํางาน, การร้องขอเดียว, หรือการตอบสนองตัวอย่าง รหัสการแสดงตัวอย่างสนามเด็กเล่น; มันไม่ส่งงาน การไหลของงานที่สมบูรณ์ สามารถจัดการการอัปโหลด, การตรวจสอบสถานะและการกู้ค่าของทุกส่วนผลลัพธ์

พารามิเตอร์ต้นทาง

สร้าง Bulk การกระจัดงาน

ภายใน UTF-8 แฟ้มหนึ่ง YouTube ID ต่อบรรทัด, ถึง 2 กิบ ต้องการนําเข้าข้อมูล.

ทิ้งช่องว่างไว้เพื่อลอง 'en-orig' จากนั้น en และกลับมาหนึ่งร่อง หรือป้อนรหัสหนึ่งหรือขึ้น 10 รหัสที่แตกต่างกันโดยเครื่องหมายจุลภาค

แทร็กคําบรรยายภาพ auto

การส่งผล

ทิ้งนี่ไว้เพื่อรับผล FlashData API.

Bulk ทําเว็บฮุกให้สมบูรณ์การแจ้งเตือนและการตรวจสอบอย่างชัดเจน
POSThttps://api.flashdata.dev/v2/bulk-jobs
Python 3 · standard library
import gzip
import json
import os
from pathlib import Path
import random
import re
import shutil
import time
import urllib.error
import urllib.parse
import urllib.request

api_key = "YOUR_API_KEY"
api_url = "https://api.flashdata.dev/v2"
input_file = Path("video-ids.txt")
output_dir = Path("bulk-results")
bulk_id = ""  # Paste a saved Bulk ID to monitor/retrieve it without submitting again.
poll_timeout_seconds = 1800
payload = {
    "source": "youtube_captions",
    "options": {
        "auto": False,
    },
}

class NoRedirect(urllib.request.HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        return None

opener = urllib.request.build_opener(NoRedirect())
os.umask(0o077)

def api(path, method="GET", body=None):
    data = None if body is None else json.dumps(body).encode("utf-8")
    headers = {"X-API-Key": api_key, "Content-Type": "application/json"}
    for attempt in range(5):
        try:
            request = urllib.request.Request(api_url + path, data=data, headers=headers, method=method)
            with opener.open(request, timeout=60) as response:
                return json.load(response)
        except urllib.error.HTTPError as error:
            if method != "GET" or error.code not in (429, 502, 503, 504) or attempt == 4:
                raise
            retry_after = error.headers.get("Retry-After", "")
            delay = min(120, int(retry_after)) if retry_after.isdigit() else 2 ** attempt
            time.sleep(delay + random.random())

def result_location(path):
    request = urllib.request.Request(api_url + path, headers={"X-API-Key": api_key})
    try:
        with opener.open(request, timeout=60):
            raise RuntimeError("Expected a 302 result redirect")
    except urllib.error.HTTPError as error:
        if error.code != 302:
            raise
        location = error.headers.get("Location", "")
    parsed = urllib.parse.urlsplit(location)
    if parsed.scheme != urllib.parse.urlsplit(api_url).scheme or not parsed.hostname or parsed.username or parsed.password:
        raise RuntimeError("Invalid signed storage URL")
    return location

if not bulk_id:
    if not input_file.is_file() or not 1 <= input_file.stat().st_size <= 2147483648:
        raise ValueError("Use a nonempty UTF-8 ID file up to 2 GiB")
    created = api("/bulk-jobs", "POST", payload)
    bulk_id = created["job"]["id"]
    if not re.fullmatch(r"bulk_[A-Za-z0-9_-]{8,}", bulk_id):
        raise RuntimeError("Invalid Bulk ID")
    work = output_dir / bulk_id
    work.mkdir(parents=True, exist_ok=True)
    (work / "created.json").write_text(json.dumps(created, indent=2))
    print("Saved Bulk ID:", bulk_id, flush=True)
    upload = created["upload"]
    upload_url = urllib.parse.urlsplit(upload["href"])
    if upload["method"] != "PUT" or upload_url.scheme != urllib.parse.urlsplit(api_url).scheme or not upload_url.hostname or upload_url.username or upload_url.password:
        raise RuntimeError("Invalid signed upload URL")
    with input_file.open("rb") as file:
        request = urllib.request.Request(upload["href"], data=file, method="PUT", headers={
            "Content-Type": upload["contentType"], "Content-Length": str(input_file.stat().st_size)
        })
        with opener.open(request, timeout=120) as response:
            response.read()
    api("/bulk-jobs/" + bulk_id + "/start", "POST")

if not re.fullmatch(r"bulk_[A-Za-z0-9_-]{8,}", bulk_id):
    raise ValueError("Invalid Bulk ID")
work = output_dir / bulk_id
work.mkdir(parents=True, exist_ok=True)
deadline = time.monotonic() + poll_timeout_seconds
while True:
    job = api("/bulk-jobs/" + bulk_id)["job"]
    (work / "status.json").write_text(json.dumps(job, indent=2))
    print(job["status"], job["input"], job["counts"], flush=True)
    if job["status"] == "completed":
        break
    if job["status"] in ("paused", "failed", "cancelled", "awaiting_upload"):
        raise RuntimeError(json.dumps({"id": bulk_id, "status": job["status"], "pauseReason": job.get("pauseReason"), "error": job.get("error")}))
    if time.monotonic() >= deadline:
        raise TimeoutError("Job still running. Set bulk_id to " + bulk_id + " and rerun to continue monitoring.")
    time.sleep(10 + random.random())

manifest_url = result_location("/bulk-jobs/" + bulk_id + "/results")
with opener.open(manifest_url, timeout=60) as response:  # No API key sent to storage.
    manifest = json.load(response)
(work / "manifest.json").write_text(json.dumps(manifest, indent=2))
for part in manifest["parts"]:
    number = part["number"]
    if type(number) is not int or number < 1:
        raise RuntimeError("Invalid part number")
    path = "/bulk-jobs/" + bulk_id + "/results/" + str(number)
    if part["href"] != api_url + path:
        raise RuntimeError("Unexpected part API URL")
    storage_url = result_location(path)
    compressed = work / ("part-" + str(number) + ".jsonl.gz")
    with opener.open(storage_url, timeout=120) as response, compressed.open("wb") as file:
        shutil.copyfileobj(response, file, 1024 * 1024)
    with compressed.open("rb") as file:
        gzipped = file.read(2) == b"\x1f\x8b"
    reader = gzip.open(compressed, "rb") if gzipped else compressed.open("rb")
    with reader, (work / ("part-" + str(number) + ".jsonl")).open("wb") as file:
        shutil.copyfileobj(reader, file, 1024 * 1024)
print("Saved manifest and decoded NDJSON parts in", work)
สร้าง, อัปโหลด, เริ่ม, ดูและดึงทุกส่วนX-API-Key ยืนยัน

จุดสิ้นสุด

ทุก endpoint ใช้ https://api.flashdata.dev/v2 สร้างงาน → อัปโหลดไฟล์ ID วิดีโอ → เริ่มงาน → ติดตามสถานะ → ดึง manifest และผลลัพธ์ทุกส่วน

วิธีการพาธการกระทํา
POST/v2/bulk-jobsสร้างรายการ Bulk งาน
POST/v2/bulk-jobs/{bulkId}/startอัปโหลดแล้วเริ่ม
GET/v2/bulk-jobs/{bulkId}รับสถานะงาน
GET/v2/bulk-jobsรายการงาน
POST/v2/bulk-jobs/{bulkId}/pauseหยุดงานชั่วคราว
PATCH/v2/bulk-jobs/{bulkId}ปรับปรุงตัวเลือกของงานพิมพ์
POST/v2/bulk-jobs/{bulkId}/resumeทํางานต่อ
DELETE/v2/bulk-jobs/{bulkId}ยกเลิกงาน
GET/v2/bulk-jobs/{bulkId}/resultsจง ให้ ผล ปรากฏ ออก มา
GET/v2/bulk-jobs/{bulkId}/results/{partNumber}ดาวน์โหลดส่วนผลลัพธ์

การตรวจสอบสิทธิ์และป้อนข้อมูล

ตั้งค่า FLASHDATA_API_KEY เข้าสู่กุญแจพร้อมเข้าถึงแหล่งที่เลือก ใช้คีย์และบัญชีเดิมสําหรับการสร้างสรรค์ ควบคุมและผลลัพธ์ ประมวลผลใช้ค่าสมดุลของบัญชี และปกติต่อแหล่งข้อมูล YouTube Download ต้องการสิทธิ์เจ้าของและ options.storage.

สร้างโฟลเดอร์ที่ทํางานอยู่ชื่อ build-api/ และประมวลผลตัวอย่างเหล่านี้จากมัน สนามเด็กเล่นสมบูรณ์ Python การ ไหล ของ งาน ใช้ Python 3.10+ ไลบรารีมาตรฐาน; ส่วนบุคคล Python ตัวอย่างจุดปลายด้านล่าง ต้องการการร้องขอ cURL ตัวอย่างที่ใช้ Bash, cURL 7.76+, jq และ gzip เลือกภาษาหนึ่งสําหรับแต่ละการกระทํา ดังนั้นคุณจึงไม่ต้องสร้างหรือเริ่มทํางานซ้ํากัน

การนําเข้าคือ UTF-8 แฟ้มที่มีหนึ่งแฟ้ม 11- ช่างทําเล็บ YouTube ID ต่อบรรทัด, ถึง 2 กิบ ใช้ IDsไม่ ไม่ URLs. ลบรายการที่ซ้ํากัน IDs ก่อนทําการอัปโหลด; ทําซ้ํา IDs แยกกันดําเนินการ

แหล่งตัวเลือกที่ใช้ร่วมกัน
youtube_metadatainclude_formats, include_chapters
youtube_transcriptภาษา, อัตโนมัติ
youtube_captionsภาษา, อัตโนมัติ
youtube_trainabilityตัวเลือกต่าง ๆ
youtube_downloadตัวเลือกเล่นสื่อและปลายทางจัดเก็บข้อมูล
Python การติดต่อ
python -m pip install requests

สร้างช่องข้อมูลที่ร้องขอ

ช่องข้อมูลชนิดวิธีใช้
sourcestringต้องการ แหล่งที่มาสําหรับทุกนําเข้า ID
optionsobjectตัวเลือกของแหล่งใช้งานร่วมกัน แหล่งข้อมูลอาจจะตั้งค่า result_storage; YouTube Download ต้องการจัดเก็บข้อมูล
callback_urlstringเลือกใช้สาธารณะ HTTPS การเรียกเสร็จสิ้น หลัง จาก ที่ ได้ รับ การ ส่ง ออก อย่าง เป็น ทาง การ แล้ว.

สร้างรายการ Bulk งาน

สร้างงาน, อัปโหลด UTF-8 แฟ้มข้อความที่มีหนึ่งแฟ้ม 11- ช่างทําเล็บ YouTube วิดีโอ ID ต่อบรรทัด upload.hrefงั้นโทรเริ่มเลย การ สร้าง งาน เพียง อย่าง เดียว ไม่ ได้ เริ่ม กระบวนการ.

ตัวอย่างนี้เขียน video-ids.txt และช่วยรักษา 201 ใบเสร็จข้อมูล bulk-created.json. เก็บใบเสร็จไว้ส่วนตัว และใช้ job.id ใหม่ สําหรับการร้องขอภายหลัง การสร้างงานทิ้งมันไว้ awaiting_uploadสืบค้นเมื่อ URL หมดอายุหลังจาก 15 ไม่กี่นาที

จุดสิ้นสุด
POST https://api.flashdata.dev/v2/bulk-jobs
X-API-Key: YOUR_API_KEY

บันทึก bulk_create.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

bulk_create.py
import json
import os
from pathlib import Path

import requests

os.umask(0o077)
Path("video-ids.txt").write_bytes(b"jNQXAC9IVRw\ndQw4w9WgXcQ\n")
response = requests.post(
    "https://api.flashdata.dev/v2/bulk-jobs",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    json={"source": "youtube_metadata", "options": {"include_formats": False}},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
receipt = response.json()
Path("bulk-created.json").write_text(json.dumps(receipt, indent=2), encoding="utf-8")
print(json.dumps(receipt["job"], indent=2))
ประมวลผลจากจุลภาค/
python bulk_create.py

การ ตอบ รับ และ การ ขอ ให้ เชมา

HTTP สถานะหมายความว่า
201Bulk งานที่สร้างจาก 15- อัปโหลดไปโดยตรงนาที URL
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
422การร้องขอการตรวจสอบสิทธิ์ล้มเหลว
503ไม่สามารถเชื่อมโยงหรือแคตตาล็อกที่ต้องการได้ชั่วคราว
เนื้อหาคำขอ
{
  "$ref": "#/components/schemas/CreateBulkJobRequest"
}
201 · application/json
{
  "$ref": "#/components/schemas/BulkJobCreated"
}

อัปโหลดแล้วเริ่ม

เริ่มประมวลผลการอัปโหลด UTF-8 วิดีโอ ID แฟ้ม, ถึง 2 กิบ (ค.ศ.2147483648 ไบต์) ให้แฟ้มไม่เปลี่ยนแปลงหลังจากเริ่มการทํางานแล้ว

อันดับแรก PUT video-ids.txt ที่ใบเสร็จ upload.href ด้วย upload.contentType# หากไม่มี X-API-Key. ตัวอย่างเริ่มต้นหลังจากการอัปโหลดประสบความสําเร็จเท่านั้น เก็บการอัปโหลดไว้ไม่เปลี่ยนแปลงภายหลัง

พารามิเตอร์ตําแหน่งเงื่อนไข
bulkIdpathจำเป็น · {"type":"string","pattern":"^bulk_[A-Za-z0-9_-]{8,}$"}
จุดสิ้นสุด
POST https://api.flashdata.dev/v2/bulk-jobs/{bulkId}/start
X-API-Key: YOUR_API_KEY

บันทึก bulk_start.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

bulk_start.py
import json
import os
from pathlib import Path

import requests

receipt = json.loads(Path("bulk-created.json").read_text(encoding="utf-8"))
upload = receipt["upload"]
if upload["method"] != "PUT" or not upload["href"].startswith("https://"):
    raise ValueError("Expected an HTTPS PUT upload URL")
# Stream the file to storage without the FlashData key.
with open("video-ids.txt", "rb") as file:
    response = requests.put(
        upload["href"], data=file,
        headers={"Content-Type": upload["contentType"]},
        timeout=300, allow_redirects=False,
    )
    response.raise_for_status()
    if not 200 <= response.status_code < 300:
        raise RuntimeError("Upload did not complete; do not start the job yet")

bulk_id = receipt["job"]["id"]
response = requests.post(
    f"https://api.flashdata.dev/v2/bulk-jobs/{bulk_id}/start",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(json.dumps(response.json()["job"], indent=2))
ประมวลผลจากจุลภาค/
python bulk_start.py

การตอบโต้

HTTP สถานะหมายความว่า
200Bulk งานเริ่มหรือสถานะที่ปรากฏอยู่ปัจจุบัน
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
404ไม่พบทรัพยากรหรือไม่ได้เป็นเจ้าของโดยผู้เรียก
409ความขัดแย้งของสถานะทรัพยากรหรือความไม่เข้มงวด
422การร้องขอการตรวจสอบสิทธิ์ล้มเหลว
503ไม่สามารถเชื่อมโยงหรือแคตตาล็อกที่ต้องการได้ชั่วคราว
200 · application/json
{
  "$ref": "#/components/schemas/BulkJobResponse"
}

รับสถานะงาน

อ่าน job.statusการป้อนข้อมูล การนับ pauseReason และความผิดพลาด ตรวจสอบซ้ําเหมือนเดิม ID โดยมีความล่าช้า; เสร็จสิ้นหมายถึงการตีพิมพ์รายการไม่ได้ว่าทุกวิดีโอประสบความสําเร็จ

พารามิเตอร์ตําแหน่งเงื่อนไข
bulkIdpathจำเป็น · {"type":"string","pattern":"^bulk_[A-Za-z0-9_-]{8,}$"}
จุดสิ้นสุด
GET https://api.flashdata.dev/v2/bulk-jobs/{bulkId}
X-API-Key: YOUR_API_KEY

บันทึก bulk_status.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

bulk_status.py
import json
import os
from pathlib import Path

import requests

bulk_id = json.loads(Path("bulk-created.json").read_text(encoding="utf-8"))["job"]["id"]
response = requests.get(
    f"https://api.flashdata.dev/v2/bulk-jobs/{bulk_id}",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
Path("bulk-job.json").write_text(json.dumps(response.json(), indent=2), encoding="utf-8")
print(json.dumps(response.json()["job"], indent=2))
ประมวลผลจากจุลภาค/
python bulk_status.py

การตอบโต้

HTTP สถานะหมายความว่า
200Bulk สถานะงาน
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
404ไม่พบทรัพยากรหรือไม่ได้เป็นเจ้าของโดยผู้เรียก
200 · application/json
{
  "$ref": "#/components/schemas/BulkJobResponse"
}

รายการงาน

การ ตอบ รับ มี ข้อมูล และ การ เขียน ภาพ. ผ่าน pagination.nextCursor เป็นพารามิเตอร์คําร้องขอถัดไปสําหรับค้นหาเคอร์เซอร์ null. ใช้ลิมิตจาก 1 ถึง 502; ค่าปริยายคือ 20.

พารามิเตอร์ตําแหน่งเงื่อนไข
cursorqueryไม่บังคับ · {"type":"string","maxLength":512}
limitqueryไม่บังคับ · {"type":"integer","minimum":1,"maximum":50,"default":20}
จุดสิ้นสุด
GET https://api.flashdata.dev/v2/bulk-jobs
X-API-Key: YOUR_API_KEY

บันทึก list_bulk_jobs.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

list_bulk_jobs.py
import json
import os
from pathlib import Path

import requests

response = requests.get(
    "https://api.flashdata.dev/v2/bulk-jobs?limit=20",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
ประมวลผลจากจุลภาค/
python list_bulk_jobs.py

การตอบโต้

HTTP สถานะหมายความว่า
200Bulk หน้างาน
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
200 · application/json
{
  "$ref": "#/components/schemas/BulkJobPage"
}

หยุดงานชั่วคราว

หยุดการส่งใหม่และบรรจุแพ็คเกจผลลัพธ์ การ มี งาน อยู่ ดําเนิน ต่อ ไป โดย มี ค่า ตั้ง และ ค่า ใช้ จ่าย เดิม. ทํางานต่อเมื่อพร้อม

พารามิเตอร์ตําแหน่งเงื่อนไข
bulkIdpathจำเป็น · {"type":"string","pattern":"^bulk_[A-Za-z0-9_-]{8,}$"}
จุดสิ้นสุด
POST https://api.flashdata.dev/v2/bulk-jobs/{bulkId}/pause
X-API-Key: YOUR_API_KEY

บันทึก pause_bulk_job.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

pause_bulk_job.py
import json
import os
from pathlib import Path

import requests

bulk_id = json.loads(Path("bulk-created.json").read_text(encoding="utf-8"))["job"]["id"]
response = requests.post(
    f"https://api.flashdata.dev/v2/bulk-jobs/{bulk_id}/pause",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
ประมวลผลจากจุลภาค/
python pause_bulk_job.py

การตอบโต้

HTTP สถานะหมายความว่า
200หยุดงานจํานวนมากหรือสถานะที่โดดเด่นในปัจจุบันของมัน
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
404ไม่พบทรัพยากรหรือไม่ได้เป็นเจ้าของโดยผู้เรียก
200 · application/json
{
  "$ref": "#/components/schemas/BulkJobResponse"
}

ปรับปรุงตัวเลือกของงานพิมพ์

ปรับปรุงตัวเลือกต่างๆ ระหว่างรอการอัปโหลด หรือขณะที่หยุดชั่วคราว ก่อนที่จะมีการอ่านค่าทั้งหมด การ มี งาน อยู่ ก็ คง ไว้ ซึ่ง สภาพ การณ์ ของ พวก เขา. หาก poping ยังคงอยู่ระหว่างดําเนินการรอและ request การตอบสนอง 409 หลังจากอ่านค่านําเข้าทั้งหมดแล้ว จะมีเพียงเอกสารรับรองการส่งเท่านั้นที่สามารถปรับปรุงได้ ตั้งค่า callback_url ถึง null เพื่อเอามันออก

ตัวอย่างนี้จะทําการลบการเรียกให้เสร็จสิ้น เพื่อเปลี่ยนตัวเลือกของแหล่ง ให้ส่งออบเจกต์ทางเลือกแทน หยุดชั่วคราวก่อนและรอให้หยุดการทํางานชั่วคราว; 409 หมายถึง ยังไม่สามารถปรับใช้การปรับปรุงได้ การ มี งาน เด็ก อยู่ ก็ ยัง คง เป็น งาน ที่ ต้อง ใช้ ความ พยายาม.

พารามิเตอร์ตําแหน่งเงื่อนไข
bulkIdpathจำเป็น · {"type":"string","pattern":"^bulk_[A-Za-z0-9_-]{8,}$"}
จุดสิ้นสุด
PATCH https://api.flashdata.dev/v2/bulk-jobs/{bulkId}
X-API-Key: YOUR_API_KEY

บันทึก update_bulk_job.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

update_bulk_job.py
import json
import os
from pathlib import Path

import requests

bulk_id = json.loads(Path("bulk-created.json").read_text(encoding="utf-8"))["job"]["id"]
response = requests.patch(
    f"https://api.flashdata.dev/v2/bulk-jobs/{bulk_id}",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    json={"callback_url": None},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
ประมวลผลจากจุลภาค/
python update_bulk_job.py

การ ตอบ รับ และ การ ขอ ให้ เชมา

HTTP สถานะหมายความว่า
200ปรับปรุงสถานะงานพิมพ์
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
404ไม่พบทรัพยากรหรือไม่ได้เป็นเจ้าของโดยผู้เรียก
409ความขัดแย้งของสถานะทรัพยากรหรือความไม่เข้มงวด
422การร้องขอการตรวจสอบสิทธิ์ล้มเหลว
เนื้อหาคำขอ
{
  "$ref": "#/components/schemas/UpdateBulkJobRequest"
}
200 · application/json
{
  "$ref": "#/components/schemas/BulkJobResponse"
}

ทํางานต่อ

แก้ไข pauseReason อย่างแรก เช่น เพิ่มเครดิต หรือ ปรับปรุงเอกสารการจัดเก็บ แล้วกลับมาใช้เดิม Bulk ID.

พารามิเตอร์ตําแหน่งเงื่อนไข
bulkIdpathจำเป็น · {"type":"string","pattern":"^bulk_[A-Za-z0-9_-]{8,}$"}
จุดสิ้นสุด
POST https://api.flashdata.dev/v2/bulk-jobs/{bulkId}/resume
X-API-Key: YOUR_API_KEY

บันทึก resume_bulk_job.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

resume_bulk_job.py
import json
import os
from pathlib import Path

import requests

bulk_id = json.loads(Path("bulk-created.json").read_text(encoding="utf-8"))["job"]["id"]
response = requests.post(
    f"https://api.flashdata.dev/v2/bulk-jobs/{bulk_id}/resume",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
ประมวลผลจากจุลภาค/
python resume_bulk_job.py

การตอบโต้

HTTP สถานะหมายความว่า
200สถานะงานส่วนใหญ่ในปัจจุบัน
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
404ไม่พบทรัพยากรหรือไม่ได้เป็นเจ้าของโดยผู้เรียก
200 · application/json
{
  "$ref": "#/components/schemas/BulkJobResponse"
}

ยกเลิกงาน

หยุดการยอมจํานนใหม่ งานที่มีอยู่ยังคงสามารถ finish และเข้าข่ายปกติได้ งานที่ถูกยกเลิกไม่ได้ตีพิมพ์รายการสุดท้าย

พารามิเตอร์ตําแหน่งเงื่อนไข
bulkIdpathจำเป็น · {"type":"string","pattern":"^bulk_[A-Za-z0-9_-]{8,}$"}
จุดสิ้นสุด
DELETE https://api.flashdata.dev/v2/bulk-jobs/{bulkId}
X-API-Key: YOUR_API_KEY

บันทึก cancel_bulk_job.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

cancel_bulk_job.py
import json
import os
from pathlib import Path

import requests

bulk_id = json.loads(Path("bulk-created.json").read_text(encoding="utf-8"))["job"]["id"]
response = requests.delete(
    f"https://api.flashdata.dev/v2/bulk-jobs/{bulk_id}",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
print(json.dumps(response.json(), indent=2))
ประมวลผลจากจุลภาค/
python cancel_bulk_job.py

การตอบโต้

HTTP สถานะหมายความว่า
200สถานะงานส่วนใหญ่ในปัจจุบัน
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
404ไม่พบทรัพยากรหรือไม่ได้เป็นเจ้าของโดยผู้เรียก
200 · application/json
{
  "$ref": "#/components/schemas/BulkJobResponse"
}

จง ให้ ผล ปรากฏ ออก มา

ติดตามเส้นทางที่จะดาวน์โหลด JSON แสดงและใช้ที่อยู่เชื่อมโยงของมันเพื่อเรียกเอาแฟ้มผลลัพธ์ ดึงข้อมูลที่ลงนามในคลัง URLs # หากไม่มีเธอ # API กุญแจ ยัง คง มี ผล งาน อยู่ สําหรับ 24 หนึ่งชั่วโมงหลังจากทั้งหมด Bulk งานเสร็จสมบูรณ์แล้ว

ได้รับการยืนยันแล้ว API ร้องขอกลับ 302 ด้วยส่วนหัวตําแหน่ง ดึงที่ HTTPS คลังสื่อ URL ในการร้องขอแยกโดยไม่มี X-API-Key. ตัวอย่างบันทึก manifest.json A 409 หมายความว่าผลไม่พร้อม 410 หมายความว่าพวกเขาหมดอายุแล้ว

พารามิเตอร์ตําแหน่งเงื่อนไข
bulkIdpathจำเป็น · {"type":"string","pattern":"^bulk_[A-Za-z0-9_-]{8,}$"}
จุดสิ้นสุด
GET https://api.flashdata.dev/v2/bulk-jobs/{bulkId}/results
X-API-Key: YOUR_API_KEY

บันทึก bulk_manifest.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

bulk_manifest.py
import json
import os
from pathlib import Path

import requests

bulk_id = json.loads(Path("bulk-created.json").read_text(encoding="utf-8"))["job"]["id"]
response = requests.get(
    f"https://api.flashdata.dev/v2/bulk-jobs/{bulk_id}/results",
    headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
    timeout=30, allow_redirects=False,
)
response.raise_for_status()
if response.status_code != 302:
    raise RuntimeError(f"Expected a manifest redirect, got {response.status_code}")
url = response.headers["Location"]
if not url.startswith("https://"):
    raise ValueError("Expected an HTTPS storage URL")

manifest = requests.get(url, timeout=120)  # No FlashData API key.
manifest.raise_for_status()
Path("manifest.json").write_text(json.dumps(manifest.json(), indent=2), encoding="utf-8")
print(json.dumps(manifest.json(), indent=2))
ประมวลผลจากจุลภาค/
python bulk_manifest.py

การตอบโต้

HTTP สถานะหมายความว่า
200JSON แสดงผลดาวน์โหลดหลังจากทําการเปลี่ยนปลายทางแล้ว
302ส่งตัวไปยังความเป็นส่วนตัวที่มีอายุสั้น R2 URL; API ไม่ต้องทําการส่งต่อเอกสาร · Location
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
404ไม่พบทรัพยากรหรือไม่ได้เป็นเจ้าของโดยผู้เรียก
409ความขัดแย้งของสถานะทรัพยากรหรือความไม่เข้มงวด
410ผลที่ได้หมดอายุแล้ว
200 · application/json
{
  "type": "object",
  "additionalProperties": true
}

ดาวน์โหลดส่วนผลลัพธ์

ใช้แต่ละรายการ parts[].number จาก manifest.json. จุดปลายแต่ละจุดจะคืนค่ากลับมาเป็น a 302 ถึง gzip NDJSON แฟ้ม; ดาวน์โหลดโดยไม่มี API กุญแจ, การย่อยสลาย, แล้ววิเคราะห์หนึ่ง JSON วัตถุต่อเส้น เข้าร่วมทําดัชนีที่เป็นศูนย์ ตัวอย่างการเก็บชิ้นส่วนทั้งหมดและรักษาทั้งสองส่วนndjson.gz และแฟ้มข้อมูล .njson

พารามิเตอร์ตําแหน่งเงื่อนไข
bulkIdpathจำเป็น · {"type":"string","pattern":"^bulk_[A-Za-z0-9_-]{8,}$"}
partNumberpathจำเป็น · {"type":"integer","minimum":0}
จุดสิ้นสุด
GET https://api.flashdata.dev/v2/bulk-jobs/{bulkId}/results/{partNumber}
X-API-Key: YOUR_API_KEY

บันทึก bulk_parts.py ในถาดขนาดใหญ่/ ด้านข้าง bulk-created.json. คัดลอกสคริปต์ที่สมบูรณ์แล้วเรียกใช้คําสั่งด้านล่าง

bulk_parts.py
import json
import os
from pathlib import Path

import requests
import gzip
import shutil

bulk_id = json.loads(Path("bulk-created.json").read_text(encoding="utf-8"))["job"]["id"]
manifest = json.loads(Path("manifest.json").read_text(encoding="utf-8"))
for part in manifest["parts"]:
    number = part["number"]
    response = requests.get(
        f"https://api.flashdata.dev/v2/bulk-jobs/{bulk_id}/results/{number}",
        headers={"X-API-Key": os.environ["FLASHDATA_API_KEY"]},
        timeout=30, allow_redirects=False,
    )
    response.raise_for_status()
    if response.status_code != 302:
        raise RuntimeError(f"Expected a part redirect, got {response.status_code}")
    url = response.headers["Location"]
    if not url.startswith("https://"):
        raise ValueError("Expected an HTTPS storage URL")

    # Save the original gzip bytes; do not decompress twice.
    with requests.get(url, stream=True, timeout=120) as download:
        download.raise_for_status()
        with open(f"part-{number}.ndjson.gz", "wb") as file:
            download.raw.decode_content = False
            shutil.copyfileobj(download.raw, file)
    with gzip.open(f"part-{number}.ndjson.gz", "rt", encoding="utf-8") as rows:
        with open(f"part-{number}.ndjson", "w", encoding="utf-8") as file:
            for line in rows:
                file.write(line)
                print(json.dumps(json.loads(line)))
ประมวลผลจากจุลภาค/
python bulk_parts.py

การตอบโต้

HTTP สถานะหมายความว่า
200การบีบอัดข้อมูลแบบ Gzip NDJSON ดาวน์โหลดหลังจากเปลี่ยนปลายทางแล้ว
302ส่งตัวไปยังความเป็นส่วนตัวที่มีอายุสั้น R2 URL; API ไม่ต้องทําการส่งต่อเอกสาร · Location
401ต้องการการตรวจสอบสิทธิ์หรือไม่?
404ไม่พบทรัพยากรหรือไม่ได้เป็นเจ้าของโดยผู้เรียก
409ความขัดแย้งของสถานะทรัพยากรหรือความไม่เข้มงวด
410ผลที่ได้หมดอายุแล้ว
200 · application/x-ndjson
{
  "type": "string"
}

งาน รายงาน และ การ ยับยั้ง

ยัง คง มี ผล งาน อยู่ สําหรับ 24 หนึ่งชั่วโมงหลังจากทั้งหมด Bulk งานเสร็จสมบูรณ์แล้ว บันทึกพวกเขาก่อน expiresAt มีเดียในจุดหมายปลายทางของคุณ ทําตามนโยบายของถัง งานที่ทําเสร็จแล้ว รวมถึงวิดีโอที่ล้มเหลวด้วย counts.invalid บันทึกถูกปฏิเสธสายเข้า

สถานะการกระทําถัดไป
awaiting_uploadอัพโหลดไฟล์แล้วโทรออก
runningการสํารวจเดียวกัน ID กับการถอนตัว input.complete แสดงให้เห็นว่าการสแกนเสร็จสิ้นหรือไม่
pausedอ่าน pauseReason แก้ไขแล้วทําต่อ
finalizingจง รอ ให้ มี การ จัด พิมพ์ ออก มา เป็น ชุด ๆ.
completedดาวน์โหลดรายการและทุกส่วน แสดงสถานะและข้อผิดพลาดของแต่ละแถว
failed / cancelledตรวจพบข้อผิดพลาดและบันทึกสถานะ ไม่ มี การ จัด พิมพ์ รายการ สุด ท้าย.

การส่งแบบเก็บ

ใช้สนามเด็กเล่นเพื่อปรับแต่งผู้ให้บริการและแสดงตัวอย่างช่องข้อมูลที่ร้องขอมา ใบรับรองการจัดเก็บของลูกค้าอยู่ในวัตถุที่ถูกเลือก X-API-Key การตรวจสอบสิทธิ์เท่านั้น FlashData API ขอล่ะ

แหล่งสร้างช่องข้อมูลที่ร้องขอส่งแล้ว
ข้อมูลกํากับภาพ, สําเนา, คําบรรยาย, เช็คใบอนุญาตoptions.result_storageทางเลือก สําเนา NDJSON ชิ้นส่วนผลลัพธ์และใบรายการสําหรับถังของคุณ
youtube_downloadoptions.storageต้องการ ส่งสื่อไปที่ถังของคุณ result_storage ถึง browser_delivery ไม่ได้รับการยอมรับ

ค้นหาแฟ้มส่ง

รายการข้อมูลถูกเขียนล่าสุดและรายการกุญแจออบเจ็กต์ ขนาด และ SHA-256 เช็คคัม มันแตกต่างจาก FlashData แสดงรายการที่ API ค่าเศษเสี้ยว YYYYMDD ในพาธข้อมูลที่ใช้ UTC Bulk วันที่สร้าง; ในสื่อต่าง ๆ มันใช้วันที่อัปโหลดจาก UTC ของแต่ละวิดีโอ Bulk การส่งข้อมูล OSS ต้องการข้อมูล aliyuncs.com จุดปลาย

สื่อส่วนตัว file_url ค่าที่ต้องการที่เก็บของคุณ SDK หรือการลงนาม URL จากผู้จัดหา A FlashData กุญแจไม่อนุญาตให้เข้าถึงถัง ตัวเลือกของข้อมูลกํากับภาพแบบสหายจะถูกจัดเก็บไว้ด้านข้างสื่อ การส่งข้อมูลปรากฏใน delivery.retryCount

การจัดวางวัตถุข้อมูล
<prefix>/<source>/<bulkId>/results/part-NNNNNNNN.jsonl.gz
<prefix>/<source>/<bulkId>/manifest.json

รับเว็บฮุกที่เสร็จสมบูรณ์

เปิดเผยต่อสาธารณชน HTTPS callback_url ทางเลือกนอกกรอบ Bulk ส่งเสร็จสมบูรณ์หลังจากการลงแจ้งรายการแล้วเท่านั้น ซึ่งจะไม่ส่งเหตุการณ์หนึ่งแบบ (per- vitroo) และไม่มีเหตุการณ์ที่เสร็จสมบูรณ์สําหรับงานพิมพ์ที่ล้มเหลวหรือถูกยกเลิก ให้ผลสํารวจสถานะเป็นความล้มเหลว

  1. ต่อเนื่องและลดความซับซ้อน delivery_id แล้วกลับมา 2xx ทันที การส่งของซ้ําถึงแปดครั้ง
  2. เหตุการณ์ไม่แน่นอน ตรงกับหมายเลขและแหล่งไปยังใบเสร็จที่บันทึกไว้ของคุณ; ตรวจสอบเสร็จสิ้นผ่านทางการจัดการการตรวจสอบสิทธิ์ API ก่อนที่จะได้กลับมา ไม่สนใจ URLs ให้พ้นจากเหตุการณ์ที่ไม่สงบ
สร้างการร้องขอด้วยการเรียกกลับ
{
  "source": "youtube_metadata",
  "options": {
    "include_formats": false,
    "include_chapters": false
  },
  "callback_url": "https://your-app.example/webhooks/flashdata"
}
ทําเหตุการณ์ให้สมบูรณ์
{
  "delivery_id": "bulk-completion:bulk_EXAMPLE123",
  "id": "bulk_EXAMPLE123",
  "source": "youtube_metadata",
  "status": "completed",
  "links": [
    {
      "rel": "self",
      "href": "https://api.flashdata.dev/v2/bulk-jobs/bulk_EXAMPLE123",
      "method": "GET"
    },
    {
      "rel": "results",
      "href": "https://api.flashdata.dev/v2/bulk-jobs/bulk_EXAMPLE123/results",
      "method": "GET"
    }
  ]
}

นิยามการสลับรูปแบบ

BulkJobCreated

BulkJobCreated
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "job",
    "upload"
  ],
  "properties": {
    "job": {
      "$ref": "#/components/schemas/BulkJob"
    },
    "upload": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "href",
        "method",
        "expiresAt",
        "contentType"
      ],
      "properties": {
        "href": {
          "type": "string",
          "format": "uri"
        },
        "method": {
          "type": "string",
          "const": "PUT"
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time"
        },
        "contentType": {
          "type": "string",
          "const": "text/plain; charset=utf-8"
        }
      }
    }
  }
}

BulkJob

BulkJob
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "source",
    "status",
    "input",
    "counts",
    "delivery",
    "pauseReason",
    "error",
    "createdAt",
    "startedAt",
    "completedAt",
    "expiresAt",
    "links"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^bulk_[A-Za-z0-9_-]{8,}$"
    },
    "source": {
      "type": "string",
      "enum": [
        "youtube_metadata",
        "youtube_transcript",
        "youtube_captions",
        "youtube_trainability",
        "youtube_download"
      ]
    },
    "status": {
      "type": "string",
      "enum": [
        "awaiting_upload",
        "running",
        "paused",
        "finalizing",
        "completed",
        "failed",
        "cancelled"
      ]
    },
    "input": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "bytes",
        "complete",
        "scannedBytes",
        "scannedLines"
      ],
      "properties": {
        "bytes": {
          "type": "integer",
          "minimum": 0
        },
        "complete": {
          "type": "boolean"
        },
        "scannedBytes": {
          "type": "integer",
          "minimum": 0
        },
        "scannedLines": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "counts": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "accepted",
        "completed",
        "failed",
        "invalid",
        "results"
      ],
      "properties": {
        "accepted": {
          "type": "integer",
          "minimum": 0
        },
        "completed": {
          "type": "integer",
          "minimum": 0
        },
        "failed": {
          "type": "integer",
          "minimum": 0
        },
        "invalid": {
          "type": "integer",
          "minimum": 0
        },
        "results": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "pauseReason": {
      "type": [
        "string",
        "null"
      ]
    },
    "delivery": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "customerStorage",
        "storageType",
        "uploadedParts",
        "retryCount"
      ],
      "properties": {
        "customerStorage": {
          "type": "boolean"
        },
        "storageType": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "s3",
            "s3_compatible",
            "oss",
            "gcs",
            "azure",
            "cos",
            "bos",
            "tos",
            null
          ]
        },
        "uploadedParts": {
          "type": "integer",
          "minimum": 0
        },
        "retryCount": {
          "type": "integer",
          "minimum": 0
        }
      }
    },
    "error": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "code",
            "detail"
          ],
          "properties": {
            "code": {
              "type": "string"
            },
            "detail": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        }
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "startedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "completedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "links": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/JobLink"
      }
    }
  }
}

BulkJobPage

BulkJobPage
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "data",
    "pagination"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/BulkJob"
      }
    },
    "pagination": {
      "$ref": "#/components/schemas/Pagination"
    }
  }
}

BulkJobResponse

BulkJobResponse
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "job"
  ],
  "properties": {
    "job": {
      "$ref": "#/components/schemas/BulkJob"
    }
  }
}

CreateBulkJobRequest

CreateBulkJobRequest
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "source"
  ],
  "properties": {
    "source": {
      "type": "string",
      "enum": [
        "youtube_metadata",
        "youtube_transcript",
        "youtube_captions",
        "youtube_trainability",
        "youtube_download"
      ]
    },
    "options": {
      "type": "object",
      "additionalProperties": true,
      "description": "Reused for every ID. Metadata accepts include_formats and include_chapters. Transcript and captions accept language (one code or an array of 1–10 distinct codes) and auto (applies to all requested languages). Omit language to prefer en-orig, fall back to en, and return one track. With auto=true, each requested code tries its -orig track first, then the plain code. Explicit -orig codes and auto=false stay exact. languageCode identifies the selected track; requestedLanguageCode is included when it differs from the requested code. A language array returns tracks and per-language errors for each video with at least one retrieved track. If no track is retrieved, the video job fails and its reserved credits are refunded. Bulk exports use one JSONL record per video. Trainability accepts no source options. These four data sources optionally accept result_storage. Supported storage_type values are s3, s3_compatible, oss, gcs, azure, cos, bos, and tos. storage_url is the bucket name (Azure container name); object_prefix is optional. S3, S3-compatible, OSS, COS, BOS, and TOS use access_key and secret_key. S3-compatible and OSS also require a public HTTPS endpoint_url. COS, BOS, and TOS require region and use fixed provider endpoints. COS bucket names include the APPID. BOS S3-compatible HTTPS delivery supports bj, su, and hkg. GCS requires service_account with project_id, client_email, and private_key. Azure requires account_name and a container SAS sas_token with write permission. Default object_prefix is YYYYMMDD, frozen to the UTC bulk creation date. Files are written to <prefix>/<source>/<bulkId>/results/part-NNNNNNNN.jsonl.gz; manifest.json in the same bulk directory is written last. Each JSONL row includes its input index and completed, failed, or invalid status. Internal R2 results remain available through the result links for 24 hours. Download accepts the normal YouTube download parameters, requires customer storage, and does not permit browser_delivery. Download storage supports the same eight provider types and credential shapes listed above under the storage field. Download storage may include object_prefix; YYYYMMDD tokens resolve to the UTC upload date, while literal prefixes are unchanged."
    },
    "callback_url": {
      "type": "string",
      "format": "uri",
      "maxLength": 2048,
      "description": "Optional public HTTPS endpoint notified once after manifest publication."
    }
  }
}

JobLink

JobLink
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "rel",
    "href",
    "method"
  ],
  "properties": {
    "rel": {
      "type": "string",
      "enum": [
        "self",
        "results",
        "content",
        "download"
      ]
    },
    "href": {
      "type": "string",
      "format": "uri"
    },
    "method": {
      "type": "string",
      "const": "GET"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "filename": {
      "type": "string"
    },
    "content_type": {
      "type": "string"
    },
    "size_bytes": {
      "type": "integer",
      "minimum": 1
    }
  }
}

Pagination

Pagination
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "hasMore",
    "limit"
  ],
  "properties": {
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "previousCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "hasMore": {
      "type": "boolean"
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    }
  }
}

Problem

Problem
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "type",
    "title",
    "status",
    "code",
    "requestId"
  ],
  "properties": {
    "type": {
      "type": "string",
      "format": "uri-reference"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 400,
      "maximum": 599
    },
    "code": {
      "type": "string",
      "pattern": "^[a-z0-9_]+$"
    },
    "detail": {
      "type": "string"
    },
    "requestId": {
      "type": "string",
      "pattern": "^req_"
    },
    "fieldErrors": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/FieldError"
      }
    }
  }
}

FieldError

FieldError
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "field",
    "code",
    "message"
  ],
  "properties": {
    "field": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  }
}

UpdateBulkJobRequest

UpdateBulkJobRequest
{
  "type": "object",
  "additionalProperties": false,
  "minProperties": 1,
  "properties": {
    "options": {
      "type": "object",
      "additionalProperties": true,
      "description": "Partial option update. Nested storage fields are merged so unchanged credentials do not need to be resent. Data result_storage fields are merged the same way. After all IDs have been scanned, a paused data bulk job accepts credential updates only: access_key and secret_key, GCS service_account, or Azure sas_token, depending on the storage type. The complete merged configuration is validated before it is stored."
    },
    "callback_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "maxLength": 2048,
      "description": "Replacement completion callback, or null to remove the callback."
    }
  }
}