{"openapi":"3.1.0","info":{"title":"AnimaTime API","version":"v1","description":"AnimaTime 外部連携 API（v1）。v1 の中では追加だけを行い、既存の項目の削除・意味の変更はしません。APIキーのスコープ: projects:read, processes:write, staff:read, staff:read_contact, orders:read, invoices:read, vendors:read, amounts:read, events:read, payments:read, budgets:read, orders:write, invoices:write, staff:write, staff:deactivate, projects:write, rights_jobs:read, rights_jobs:write。Webhook の本文は Event スキーマと同じです（api_version 2026-11-01）。"},"servers":[{"url":"https://animatime.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"設定ページで発行した APIキー（at_…）。サンドボックス組織ではテスト用キー（at_test_…）"}},"schemas":{"Error":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["invalid_request_error","authentication_error","permission_error","not_found","api_error"]},"code":{"type":"string","description":"UNAUTHORIZED / INSUFFICIENT_SCOPE / FEATURE_NOT_AVAILABLE / IP_NOT_ALLOWED / RATE_LIMITED / NOT_FOUND / BAD_REQUEST / INTERNAL_ERROR（書き込み: ORG_READ_ONLY / MONTH_CLOSED / ORDER_CANCELLED / INVALID_DELIVERY_TRANSITION / DATE_NOT_ACCEPTED / DUPLICATE_INVOICE_NUMBER / AMOUNT_MISMATCH / INVOICE_PAID / idempotency_key_required / idempotency_key_invalid / idempotency_key_reused / idempotency_key_in_progress。承認依頼の作成: DUPLICATE_APPROVAL_REQUEST と、画面の発注作成と同じ理由の大文字 （MISSING_FIELDS / DUPLICATE_ORDER / ZERO_AMOUNT / EPISODE_NOT_FOUND など。docs の POST /api/v1/order-approval-requests）。作品・話数・カットの書き込み: PLAN_LIMIT_EXCEEDED / DUPLICATE_EPISODE_NUMBER / DUPLICATE_CUT_NUMBER / DUPLICATE_EXTERNAL_ID / CONCURRENT_CONFLICT。スタッフ名簿: NAME_REQUIRED / INVALID_NAME / IS_EXTERNAL_REQUIRED / INVALID_EMAIL / INVALID_INVOICE_REGISTRATION_NUMBER / DUPLICATE_EXTERNAL_ID / CONCURRENT_CONFLICT / CANNOT_DEACTIVATE_API_KEY_STAFF。版権案件: PROJECT_NOT_FOUND / ASSIGNEE_NOT_FOUND / DUPLICATE_EXTERNAL_ID / CONCURRENT_CONFLICT"},"message":{"type":"string"},"param":{"type":"string","description":"原因の入力（該当するとき）"}}}}},"BulkValidationError":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","const":"invalid_request_error"},"code":{"type":"string","const":"VALIDATION_FAILED"},"message":{"type":"string"}}},"errors":{"type":"array","description":"拒否した行ごとの理由（何も書いていない）","items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer","description":"items の位置（0始まり）"},"code":{"type":"string","description":"BAD_REQUEST / DUPLICATE_IN_REQUEST / DUPLICATE_EPISODE_NUMBER / DUPLICATE_CUT_NUMBER（スタッフ名簿: NAME_REQUIRED / INVALID_NAME / IS_EXTERNAL_REQUIRED / INVALID_EMAIL / INVALID_INVOICE_REGISTRATION_NUMBER / EXTERNAL_ID_REQUIRED / CANNOT_DEACTIVATE_API_KEY_STAFF）"},"message":{"type":"string"},"param":{"type":"string","description":"原因の項目"}}}}}},"Project":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"project"},"id":{"type":"string"},"external_id":{"type":["string","null"],"maxLength":128,"description":"移行元のID（作品=組織内 / 話数=作品内 / カット=話数内で一意）。付けていなければ null"},"name":{"type":"string"},"description":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Episode":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"episode"},"id":{"type":"string"},"project_id":{"type":"string"},"external_id":{"type":["string","null"],"maxLength":128,"description":"移行元のID（作品=組織内 / 話数=作品内 / カット=話数内で一意）。付けていなければ null"},"number":{"type":"string","description":"話数番号"},"title":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Cut":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"cut"},"id":{"type":"string"},"episode_id":{"type":"string"},"external_id":{"type":["string","null"],"maxLength":128,"description":"移行元のID（作品=組織内 / 話数=作品内 / カット=話数内で一意）。付けていなければ null"},"number":{"type":"string","description":"カット番号"},"scene_id":{"type":["string","null"],"description":"シーン（画面で付けたときだけ）"},"total_frames":{"type":["integer","null"],"description":"尺（総フレーム数・24fps）"},"planned_sheets":{"type":["integer","null"],"description":"予定枚数"},"notes":{"type":["string","null"],"description":"申し送り"},"processes":{"type":"array","description":"カットの工程（新しいカットは組織のワークフローから作る）","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","description":"工程ID（PATCH /api/v1/processes/{id} で担当・日程・状態を更新する）"},"type":{"type":["string","null"],"description":"標準工程の種類。カスタム工程は null"},"custom_step_id":{"type":["string","null"],"description":"カスタム工程のワークフローの工程ID"},"custom_label":{"type":["string","null"],"description":"カスタム工程の名前"},"status":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","COMPLETED","RETAKE"]}}}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Order":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"order"},"id":{"type":"string"},"order_number":{"type":"string","description":"発注番号"},"order_kind":{"type":"string","enum":["CUT","MASTER","ADJUSTMENT","RETAINER","RIGHTS"],"description":"CUT=カット単位 / MASTER=話数単位 / ADJUSTMENT=マイナス伝票 / RETAINER=拘束（人を月単位で押さえる発注） / RIGHTS=版権案件の発注（話数なし・案件ごと）"},"status":{"type":"string","enum":["ORDERED","DELIVERED","CONFIRMED","CANCELLED"]},"project_id":{"type":["string","null"],"description":"作品ID。拘束で作品を指定しない（会社拘束）とき・作品の無い版権案件の発注は null"},"episode_id":{"type":["string","null"],"description":"話数ID。拘束（RETAINER）・版権案件（RIGHTS）と、それが元のマイナス伝票は null"},"retainer_period_start":{"type":["string","null"],"format":"date-time","description":"拘束の期間の初日（日付だけの値・UTC 00:00）。拘束以外は null"},"retainer_period_end":{"type":["string","null"],"format":"date-time","description":"拘束の期間の末日（日付だけの値・UTC 00:00）。拘束以外は null"},"retainer_type":{"type":["string","null"],"enum":["FULL","PARTIAL",null],"description":"FULL=完全拘束 / PARTIAL=半拘束。拘束以外は null"},"rights_job_id":{"type":["string","null"],"description":"版権案件ID（GET /api/v1/rights-jobs の id）。版権案件の発注と、それが元のマイナス伝票だけ。ほかは null"},"rights_job_title":{"type":["string","null"],"description":"発行時の版権案件名。版権案件の発注と、それが元のマイナス伝票だけ。ほかは null"},"vendor":{"type":"object","additionalProperties":false,"properties":{"id":{"type":["string","null"],"description":"取引先ID（GET /api/v1/vendors の id）。名簿に無い発注先は null"},"name":{"type":"string","description":"発注時の発注先名"}}},"process_type":{"type":"string"},"process_label":{"type":["string","null"],"description":"発行時の工程名"},"master_part":{"type":["string","null"]},"order_group_id":{"type":["string","null"],"description":"まとめ発注のグループ"},"order_date":{"type":["string","null"],"format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time","description":"納期"},"sent_at":{"type":["string","null"],"format":"date-time","description":"発注書を交付した日時"},"vendor_accepted_at":{"type":["string","null"],"format":"date-time"},"vendor_declined_at":{"type":["string","null"],"format":"date-time","description":"未解決の差し戻し（再送で消える）"},"delivered_at":{"type":["string","null"],"format":"date-time","description":"最初に納品された日時"},"cancelled_at":{"type":["string","null"],"format":"date-time"},"invoice_id":{"type":["string","null"],"description":"発注ごとに紐付けた請求書"},"adjustment_for_order_id":{"type":["string","null"],"description":"マイナス伝票が相殺する元の発注"},"is_provisional_amount":{"type":"boolean","description":"報酬額が暫定か"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"tax_included":{"type":"boolean"},"tax_rate":{"type":"number"},"withholding_applied":{"type":"boolean"},"subtotal":{"type":["integer","null"],"description":"小計（税抜・源泉控除前）"},"consumption_tax":{"type":["integer","null"]},"withholding_tax":{"type":["integer","null"]},"gross_amount":{"type":["integer","null"],"description":"税込・源泉控除前"},"total_amount":{"type":["integer","null"],"description":"支払額（源泉控除後）"}},"description":"amounts:read のキーにだけ付く。発行時に保存した値（再計算しない）"}}},"OrderItem":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"order_item"},"id":{"type":"string"},"process_id":{"type":["string","null"]},"cut_number":{"type":["string","null"]},"description":{"type":["string","null"],"description":"話数単位の発注の品目名"},"seconds":{"type":["number","null"]},"sheets":{"type":["integer","null"]},"delivery_status":{"type":"string","enum":["PENDING","DELIVERED","CONFIRMED"]},"delivered_at":{"type":["string","null"],"format":"date-time"},"confirmed_at":{"type":["string","null"],"format":"date-time","description":"検収日時"},"invoice_id":{"type":["string","null"],"description":"明細ごとに紐付けた請求書"},"worker_id":{"type":["string","null"],"description":"実作業者（取引先と別の人のとき）"},"amounts":{"type":"object","additionalProperties":false,"properties":{"unit_price":{"type":["integer","null"]},"tax_rate":{"type":["number","null"]},"invoiced_gross":{"type":["integer","null"]}},"description":"amounts:read のキーにだけ付く"}}},"OrderDetail":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"order"},"id":{"type":"string"},"order_number":{"type":"string","description":"発注番号"},"order_kind":{"type":"string","enum":["CUT","MASTER","ADJUSTMENT","RETAINER","RIGHTS"],"description":"CUT=カット単位 / MASTER=話数単位 / ADJUSTMENT=マイナス伝票 / RETAINER=拘束（人を月単位で押さえる発注） / RIGHTS=版権案件の発注（話数なし・案件ごと）"},"status":{"type":"string","enum":["ORDERED","DELIVERED","CONFIRMED","CANCELLED"]},"project_id":{"type":["string","null"],"description":"作品ID。拘束で作品を指定しない（会社拘束）とき・作品の無い版権案件の発注は null"},"episode_id":{"type":["string","null"],"description":"話数ID。拘束（RETAINER）・版権案件（RIGHTS）と、それが元のマイナス伝票は null"},"retainer_period_start":{"type":["string","null"],"format":"date-time","description":"拘束の期間の初日（日付だけの値・UTC 00:00）。拘束以外は null"},"retainer_period_end":{"type":["string","null"],"format":"date-time","description":"拘束の期間の末日（日付だけの値・UTC 00:00）。拘束以外は null"},"retainer_type":{"type":["string","null"],"enum":["FULL","PARTIAL",null],"description":"FULL=完全拘束 / PARTIAL=半拘束。拘束以外は null"},"rights_job_id":{"type":["string","null"],"description":"版権案件ID（GET /api/v1/rights-jobs の id）。版権案件の発注と、それが元のマイナス伝票だけ。ほかは null"},"rights_job_title":{"type":["string","null"],"description":"発行時の版権案件名。版権案件の発注と、それが元のマイナス伝票だけ。ほかは null"},"vendor":{"type":"object","additionalProperties":false,"properties":{"id":{"type":["string","null"],"description":"取引先ID（GET /api/v1/vendors の id）。名簿に無い発注先は null"},"name":{"type":"string","description":"発注時の発注先名"}}},"process_type":{"type":"string"},"process_label":{"type":["string","null"],"description":"発行時の工程名"},"master_part":{"type":["string","null"]},"order_group_id":{"type":["string","null"],"description":"まとめ発注のグループ"},"order_date":{"type":["string","null"],"format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time","description":"納期"},"sent_at":{"type":["string","null"],"format":"date-time","description":"発注書を交付した日時"},"vendor_accepted_at":{"type":["string","null"],"format":"date-time"},"vendor_declined_at":{"type":["string","null"],"format":"date-time","description":"未解決の差し戻し（再送で消える）"},"delivered_at":{"type":["string","null"],"format":"date-time","description":"最初に納品された日時"},"cancelled_at":{"type":["string","null"],"format":"date-time"},"invoice_id":{"type":["string","null"],"description":"発注ごとに紐付けた請求書"},"adjustment_for_order_id":{"type":["string","null"],"description":"マイナス伝票が相殺する元の発注"},"is_provisional_amount":{"type":"boolean","description":"報酬額が暫定か"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"tax_included":{"type":"boolean"},"tax_rate":{"type":"number"},"withholding_applied":{"type":"boolean"},"subtotal":{"type":["integer","null"],"description":"小計（税抜・源泉控除前）"},"consumption_tax":{"type":["integer","null"]},"withholding_tax":{"type":["integer","null"]},"gross_amount":{"type":["integer","null"],"description":"税込・源泉控除前"},"total_amount":{"type":["integer","null"],"description":"支払額（源泉控除後）"}},"description":"amounts:read のキーにだけ付く。発行時に保存した値（再計算しない）"},"adjustment_order_id":{"type":["string","null"],"description":"この発注に発行したマイナス伝票"},"terms":{"type":"object","additionalProperties":false,"properties":{"receipt_place":{"type":["string","null"]},"inspection_days":{"type":["integer","null"]},"inspection_due_date":{"type":["string","null"],"format":"date-time"},"payment_due_date":{"type":["string","null"],"format":"date-time"},"check_period_days":{"type":["integer","null"]},"correction_period_days":{"type":["integer","null"]},"quality_standard":{"type":["string","null"]},"rights_handling":{"type":["string","null"]},"cancellation_policy":{"type":["string","null"]}},"description":"発注書を発行した時点の明示事項・合意事項"},"cancellation":{"type":["object","null"],"additionalProperties":false,"properties":{"cancelled_at":{"type":"string","format":"date-time"},"reason":{"type":["string","null"],"description":"ORDERER_CONVENIENCE / MUTUAL / FORCE_MAJEURE"},"compensation_basis":{"type":["string","null"],"description":"INCURRED_COST / FULL_FEE / PARTIAL / NONE"},"compensation_amount":{"type":["integer","null"],"description":"amounts:read のキーにだけ付く"}}},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}},"vendor_responses":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"action":{"type":"string","enum":["ACCEPTED","DECLINED"]},"channel":{"type":"string","enum":["PORTAL","CONNECTED_ORG"]},"effective":{"type":"boolean","description":"false=先に別の返答が通った後に届いた返答の記録"},"reason":{"type":["string","null"],"description":"差し戻しの理由"},"responded_at":{"type":"string","format":"date-time"}}}}}},"Invoice":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"invoice"},"id":{"type":"string"},"invoice_number":{"type":["string","null"],"description":"取引先の請求書番号"},"vendor":{"type":"object","additionalProperties":false,"properties":{"id":{"type":["string","null"]},"name":{"type":"string"}}},"status":{"type":"string","enum":["UNPAID","PAID"]},"issue_date":{"type":["string","null"],"format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time","description":"支払期日"},"paid_at":{"type":["string","null"],"format":"date-time"},"payment_instructed_at":{"type":["string","null"],"format":"date-time","description":"支払指示（全銀データ出力）を確定した日時"},"scheduled_transfer_date":{"type":["string","null"],"format":"date-time"},"has_file":{"type":"boolean","description":"原本ファイルが添付されているか"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"amount":{"type":"integer"}},"description":"amounts:read のキーにだけ付く"}}},"InvoiceDetail":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"invoice"},"id":{"type":"string"},"invoice_number":{"type":["string","null"],"description":"取引先の請求書番号"},"vendor":{"type":"object","additionalProperties":false,"properties":{"id":{"type":["string","null"]},"name":{"type":"string"}}},"status":{"type":"string","enum":["UNPAID","PAID"]},"issue_date":{"type":["string","null"],"format":"date-time"},"due_date":{"type":["string","null"],"format":"date-time","description":"支払期日"},"paid_at":{"type":["string","null"],"format":"date-time"},"payment_instructed_at":{"type":["string","null"],"format":"date-time","description":"支払指示（全銀データ出力）を確定した日時"},"scheduled_transfer_date":{"type":["string","null"],"format":"date-time"},"has_file":{"type":"boolean","description":"原本ファイルが添付されているか"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"amount":{"type":"integer"}},"description":"amounts:read のキーにだけ付く"},"order_ids":{"type":"array","items":{"type":"string"},"description":"発注ごと（全額）の紐付け"},"order_items":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"order_id":{"type":"string"}}},"description":"明細ごと（分納の一部）の紐付け"}}},"Vendor":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"vendor"},"id":{"type":"string"},"name":{"type":"string"},"company_name":{"type":["string","null"]},"is_individual":{"type":"boolean","description":"個人（源泉徴収の対象になりうる）か"},"is_external":{"type":"boolean","description":"社外の名簿か"},"contract_type":{"type":"string","enum":["EMPLOYMENT","SUBCONTRACT","UNSPECIFIED"]},"tax_status":{"type":"string","enum":["TAXABLE","EXEMPT","UNKNOWN"]},"invoice_registration_number":{"type":["string","null"],"description":"適格請求書発行事業者の登録番号"},"deactivated_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"Staff":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"staff"},"id":{"type":"string"},"external_id":{"type":["string","null"],"description":"移行元のID（組織の中で一意）。画面で登録した行は null"},"name":{"type":"string"},"email":{"type":["string","null"],"description":"staff:read_contact のキーにだけ付く。教育機関プランでは付かない"},"phone":{"type":["string","null"],"description":"staff:read_contact のキーにだけ付く。教育機関プランでは付かない"},"company_name":{"type":["string","null"]},"is_external":{"type":"boolean","description":"社外の名簿か"},"contract_type":{"type":"string","enum":["EMPLOYMENT","SUBCONTRACT","UNSPECIFIED"]},"is_individual":{"type":"boolean","description":"個人（源泉徴収の対象になりうる）か"},"tax_status":{"type":"string","enum":["TAXABLE","EXEMPT","UNKNOWN"]},"invoice_registration_number":{"type":["string","null"],"description":"適格請求書発行事業者の登録番号"},"specialties":{"type":"array","items":{"type":"string","enum":["絵コンテ","演出","原画","第二原画","レイアウト","作監","動画","彩色","仕上げ","背景","特効","3DCG","撮影","編集","制作進行","制作デスク"]}},"login_linked":{"type":"boolean","description":"組織のログインユーザーに紐付いているか"},"active":{"type":"boolean","description":"有効か（false＝無効化済み・deactivated_at に日時）"},"deactivated_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}}},"LegacyPagination":{"type":"object","additionalProperties":false,"properties":{"page":{"type":"integer"},"perPage":{"type":"integer"},"total":{"type":"integer","description":"絞り込み後の件数"}}},"LegacyProjectListItem":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"externalId":{"type":["string","null"],"maxLength":128,"description":"移行元のID（組織内で一意）。付けていなければ null"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"LegacyStaffListItem":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"externalId":{"type":["string","null"],"description":"移行元のID（組織の中で一意）。画面で登録した行は null"},"name":{"type":"string"},"email":{"type":["string","null"],"description":"staff:read_contact のキーにだけ付く。教育機関プランでは付かない"},"specialties":{"type":"array","items":{"type":"string"}},"deactivatedAt":{"type":["string","null"],"format":"date-time","description":"無効化した日時（有効なら null）"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}},"LegacyCutListItem":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"number":{"type":"string"},"externalId":{"type":["string","null"],"maxLength":128,"description":"移行元のID（話数内で一意）。付けていなければ null"},"processes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"type":{"type":["string","null"]},"status":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","COMPLETED","RETAKE"]},"assigneeId":{"type":["string","null"]},"startDate":{"type":["string","null"],"format":"date-time"},"dueDate":{"type":["string","null"],"format":"date-time"}}}}}},"Event":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","description":"イベントID（evt_…）。重複の判定に使う"},"object":{"type":"string","const":"event"},"type":{"type":"string","enum":["order.sent","order.accepted","order.declined","order.confirmed","invoice.received","payment.instructed","order.created","order.cancelled","order.uncancelled","order.supplemented","order.delivered","order.delivery_reverted","order.deleted","invoice.matched","invoice.deleted","payment.completed","payment.reverted","order_approval_request.created","order_approval_request.approved","order_approval_request.rejected","month.closed","month.reopened"]},"api_version":{"type":"string","examples":["2026-11-01"]},"created":{"type":"string","format":"date-time","description":"イベントが起きた時刻（再送しても変わらない）"},"organization_id":{"type":"string"},"livemode":{"type":"boolean"},"data":{"type":"object","properties":{"object":{"type":"object","description":"対象（order / invoice / order_approval_request / monthly_close）の ID と状態の列。金額・明細・連絡先は入らない"},"previous":{"type":"object","description":"変わる前の値（あるイベントだけ）"}},"required":["object"]},"actor":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["user","portal","connected_org","system","api_key"]},"name":{"type":["string","null"]}}}}},"Payment":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"payment"},"id":{"type":"string","description":"請求書の id と同じ（支払は受領請求書の単位）"},"invoice_id":{"type":"string"},"invoice_number":{"type":["string","null"]},"vendor":{"type":"object","additionalProperties":false,"properties":{"id":{"type":["string","null"]},"name":{"type":"string"}}},"status":{"type":"string","enum":["open","instructed","paid"],"description":"open=未指示 / instructed=支払指示済み（振込待ち）/ paid=支払済"},"due_date":{"type":["string","null"],"format":"date-time","description":"支払期日"},"payment_instructed_at":{"type":["string","null"],"format":"date-time"},"scheduled_transfer_date":{"type":["string","null"],"format":"date-time"},"paid_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"amount":{"type":"integer"}},"description":"amounts:read のキーにだけ付く"}}},"Budget":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"budget"},"id":{"type":"string","description":"作品の id と同じ"},"project_id":{"type":"string"},"project_name":{"type":"string"},"has_budget":{"type":"boolean"},"status":{"type":"string","enum":["none","ok","warning","over"],"description":"発注済みの額で判定した予算の状態"},"forecast_status":{"type":"string","enum":["none","ok","warning","over"],"description":"着地見込みで判定した予算の状態"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"budget":{"type":["integer","null"],"description":"予算（作品の予算、無ければ話数の予算の合計）"},"ordered":{"type":"integer","description":"発注済み（取消は補償額）"},"paid":{"type":"integer","description":"支払済の請求書に紐付いた発注分"},"remaining":{"type":["integer","null"],"description":"予算 − 発注済み"},"consumption_rate":{"type":["number","null"],"description":"発注済み ÷ 予算（%・小数1桁）"},"internal_accrued":{"type":"integer","description":"内製の報酬（発生ベース）"},"unordered_estimate":{"type":"integer","description":"未発注の工程の見込み（基準単価からの概算・税抜）"},"forecast":{"type":"integer","description":"着地見込み＝発注済み＋内製の報酬＋未発注の見込み"}},"description":"amounts:read のキーにだけ付く。呼び出しのたびに計算する（保存された値ではない）"},"progress":{"type":"object","additionalProperties":false,"properties":{"percent":{"type":"integer","description":"工程の完了率（%）"},"total_processes":{"type":"integer"},"completed_processes":{"type":"integer"}}}}},"OrderApprovalRequest":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"order_approval_request"},"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","APPROVED","REJECTED"]},"episode_id":{"type":"string"},"vendor":{"type":"object","additionalProperties":false,"properties":{"id":{"type":["string","null"]},"name":{"type":"string"}}},"process_type":{"type":"string"},"order_kind":{"type":"string","enum":["CUT","MASTER"]},"master_part":{"type":["string","null"]},"due_date":{"type":["string","null"],"description":"納品予定日（依頼の入力のまま）"},"item_count":{"type":"integer"},"price_deviations":{"type":"array","description":"基準単価から外れた明細。単価は amounts:read のキーにだけ付く","items":{"type":"object","additionalProperties":false,"properties":{"cut_number":{"type":["string","null"]},"direction":{"type":"string","enum":["above","below"]},"standard_price":{"type":"integer"},"actual_price":{"type":"integer"}}}},"requested_by":{"type":"object","additionalProperties":false,"properties":{"type":{"type":"string","enum":["user","api_key"]},"name":{"type":["string","null"],"description":"api_key のときだけキーの名義（\"API: <ラベル>\"）"}},"description":"依頼した人・キー"},"order_id":{"type":["string","null"],"description":"承認で発行された発注（APPROVED のときだけ）"},"reject_reason":{"type":["string","null"]},"decided_at":{"type":["string","null"],"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"total_amount":{"type":["integer","null"],"description":"依頼額（税込・源泉控除後）"}},"description":"amounts:read のキーにだけ付く"}}},"RightsJob":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"rights_job"},"id":{"type":"string"},"external_id":{"type":["string","null"],"maxLength":128,"description":"移行元のID（組織内で一意）。付けていなければ null"},"title":{"type":"string","description":"案件名"},"project_id":{"type":["string","null"],"description":"作品ID（紐付けなし・作品が消えた案件は null）"},"project_name":{"type":["string","null"],"description":"作品名（作品が消えた案件は紐付けた時点の名前）"},"category_key":{"type":"string","description":"組織の「版権案件の種類」のキー。未設定は \"\""},"status":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","CONFIRMED","DELIVERED"]},"due_date":{"type":["string","null"],"description":"〆切（YYYY-MM-DD）"},"due_time":{"type":["string","null"],"description":"〆切の時刻（HH:MM）"},"assignee_staff_id":{"type":["string","null"],"description":"担当のスタッフID"},"assignee_name":{"type":["string","null"]},"notes":{"type":["string","null"]},"archived_at":{"type":["string","null"],"format":"date-time","description":"アーカイブした日時（していなければ null）"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"amount":{"type":["integer","null"],"description":"見込み金額（円）"}},"description":"amounts:read のキーにだけ付く"}}},"ProjectBudget":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"budget"},"id":{"type":"string","description":"作品の id と同じ"},"project_id":{"type":"string"},"project_name":{"type":"string"},"has_budget":{"type":"boolean"},"status":{"type":"string","enum":["none","ok","warning","over"],"description":"発注済みの額で判定した予算の状態"},"forecast_status":{"type":"string","enum":["none","ok","warning","over"],"description":"着地見込みで判定した予算の状態"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"budget":{"type":["integer","null"],"description":"予算（作品の予算、無ければ話数の予算の合計）"},"ordered":{"type":"integer","description":"発注済み（取消は補償額）"},"paid":{"type":"integer","description":"支払済の請求書に紐付いた発注分"},"remaining":{"type":["integer","null"],"description":"予算 − 発注済み"},"consumption_rate":{"type":["number","null"],"description":"発注済み ÷ 予算（%・小数1桁）"},"internal_accrued":{"type":"integer","description":"内製の報酬（発生ベース）"},"unordered_estimate":{"type":"integer","description":"未発注の工程の見込み（基準単価からの概算・税抜）"},"forecast":{"type":"integer","description":"着地見込み＝発注済み＋内製の報酬＋未発注の見込み"}},"description":"amounts:read のキーにだけ付く。呼び出しのたびに計算する（保存された値ではない）"},"episodes":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"episode_budget"},"episode_id":{"type":"string"},"episode_number":{"type":"string"},"episode_title":{"type":["string","null"]},"has_budget":{"type":"boolean"},"status":{"type":"string","enum":["none","ok","warning","over"],"description":"none=予算未設定 / ok / warning=80%以上 / over=100%以上"},"forecast_status":{"type":"string","enum":["none","ok","warning","over"],"description":"none=予算未設定 / ok / warning=80%以上 / over=100%以上"},"order_count":{"type":"integer"},"amounts":{"type":"object","additionalProperties":false,"properties":{"currency":{"type":"string","const":"JPY"},"budget":{"type":["integer","null"],"description":"予算（作品の予算、無ければ話数の予算の合計）"},"ordered":{"type":"integer","description":"発注済み（取消は補償額）"},"paid":{"type":"integer","description":"支払済の請求書に紐付いた発注分"},"remaining":{"type":["integer","null"],"description":"予算 − 発注済み"},"consumption_rate":{"type":["number","null"],"description":"発注済み ÷ 予算（%・小数1桁）"},"internal_accrued":{"type":"integer","description":"内製の報酬（発生ベース）"},"unordered_estimate":{"type":"integer","description":"未発注の工程の見込み（基準単価からの概算・税抜）"},"forecast":{"type":"integer","description":"着地見込み＝発注済み＋内製の報酬＋未発注の見込み"}},"description":"amounts:read のキーにだけ付く。呼び出しのたびに計算する（保存された値ではない）"}}}}}}},"headers":{"X-RateLimit-Limit":{"description":"1分間の上限（組織ごと）","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"この呼び出しの後に残っている回数","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"回数が戻る時刻（UNIX 時刻・秒）","schema":{"type":"integer"}},"Retry-After":{"description":"次に通るまでの秒数（429 のときだけ）","schema":{"type":"integer"}}},"responses":{"Error":{"description":"エラー","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"BulkValidationError":{"description":"一括の書き込みで拒否した行がある（VALIDATION_FAILED・何も書いていない）。冪等キーの使い回しは Error の形","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BulkValidationError"},{"$ref":"#/components/schemas/Error"}]}}}},"RateLimited":{"description":"レート制限（RATE_LIMITED）。Retry-After の秒数だけ待ってから再試行する","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"paths":{"/api/v1/projects":{"get":{"summary":"APIキーの組織に属する作品の一覧を取得します。external_id で作品IDを引けます。","description":"新しい順（createdAt の降順）で返ります。\n\nexternalId は API で付けた移行元のID です（付けていない作品は null）。\n\n移行ツールが自分のIDから作品IDを引くときは external_id を指定します（全件を取って突き合わせる必要はありません）。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:read","x-animatime-feature":"projects","parameters":[{"name":"page","in":"query","required":false,"description":"ページ番号（既定: 1）","schema":{"type":"integer"}},{"name":"perPage","in":"query","required":false,"description":"1ページあたりの件数（既定: 20 / 最大: 100）","schema":{"type":"integer"}},{"name":"external_id","in":"query","required":false,"description":"移行元のID（組織内で一意）で絞り込みます。完全一致です。external_id=A&external_id=B のように繰り返すと複数を一度に引けます（最大 100 個・各 128 文字まで）。一致しないIDは結果に含まれないだけで、エラーにはなりません","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyProjectListItem"}},"pagination":{"$ref":"#/components/schemas/LegacyPagination"}}},"example":{"data":[{"id":"clxxx...","name":"作品タイトル","description":"説明","externalId":"SRC-PRJ-001","createdAt":"2026-01-15T00:00:00.000Z","updatedAt":"2026-01-15T00:00:00.000Z"}],"pagination":{"page":1,"perPage":20,"total":5}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"作品を1件作成します。external_id が同じ作品がすでにあれば、作らずにその作品を更新します。","description":"Idempotency-Key ヘッダが必須です。同じキーの再送には最初の応答をそのまま返します（24時間）。\n\nexternal_id（移行元のID・1〜128文字・前後の空白と制御文字は不可）を付けると、同じ external_id の行がすでにあれば作らずにその行を更新します（移行をやり直しても二重になりません）。external_id の一意の範囲は 作品=組織内 / 話数=作品内 / カット=話数内です。external_id を付けない行は毎回新しく作ります。\n\n応答の result は created（作った）/ updated（変えた）/ unchanged（送った値が今と同じで何もしていない）です。単体の作成は created のとき 201、それ以外は 200 です。\n\n削除は API では行えません。記録は監査ログに「API: キーの名前」として残ります。\n\n作品のワークフローは組織の標準になります（変える場合は画面の作品設定から）。シーンで管理する作品は API では作れません。\n\nプランの作品数の上限を超える場合は 403（PLAN_LIMIT_EXCEEDED）です。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":10000}},"required":["name"]}}}},"responses":{"200":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Project"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"project","id":"clxxx...","external_id":"SRC-PRJ-001","name":"作品タイトル","description":"説明","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"created"}}}},"201":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Project"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"project","id":"clxxx...","external_id":"SRC-PRJ-001","name":"作品タイトル","description":"説明","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"created"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/staff":{"get":{"summary":"APIキーの組織に登録されているスタッフの一覧を取得します。external_id・有効/無効・更新日時で絞り込めます（名簿の同期用）。","description":"応答の形（camelCase の項目と page / perPage / total）は従来のままです。deactivatedAt（無効化した日時・有効なら null）と updatedAt は同期のために足した項目です。\n\n名前の昇順で返ります。updated_since を付けたときは更新日時の古い順です。絞り込みを付けると total も絞り込んだ件数になります。\n\n差分の同期: 前回の同期の開始時刻を updated_since に渡します。件数が多くページをめくる間に更新が入りうるときは、page を進める代わりに「最後の行の updatedAt を次の updated_since にして page=1 から取り直す」と取りこぼしがありません（境目の行は2回返ることがあるので、id で重ねてください）。\n\n退職者の反映: 移行元に居ない人は POST /api/v1/staff/bulk で active: false を送ります。active=false で無効化済みの人を確かめられます。\n\nactive・updated_since の値が不正なとき、external_id が空・長すぎる・多すぎるときは 400（BAD_REQUEST・param に項目名）です。黙って全件を返しません。\n\nメールアドレス（email）は staff:read_contact スコープも持つキーにだけ返します。教育機関プランの組織では返しません。\n\nexternalId は POST /api/v1/staff・POST /api/v1/staff/bulk で付けた移行元のID です（画面で登録した行は null）。","security":[{"bearerAuth":[]}],"x-animatime-scope":"staff:read","x-animatime-feature":"staff","parameters":[{"name":"page","in":"query","required":false,"description":"ページ番号（既定: 1）","schema":{"type":"integer"}},{"name":"perPage","in":"query","required":false,"description":"1ページあたりの件数（既定: 50 / 最大: 100）","schema":{"type":"integer"}},{"name":"external_id","in":"query","required":false,"description":"移行元のID（組織内で一意）で絞り込みます。完全一致です。external_id=A&external_id=B のように繰り返すと複数を一度に引けます（最大 100 個・各 100 文字まで）。一致しないIDは結果に含まれないだけで、エラーにはなりません","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}},{"name":"active","in":"query","required":false,"description":"true＝有効なスタッフだけ / false＝無効化したスタッフだけ。省くと両方を返します（従来どおり）","schema":{"type":"boolean"}},{"name":"updated_since","in":"query","required":false,"description":"この日時以降に更新された行だけを返します（差分の同期用）。指定すると並びが更新日時の古い順になります","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyStaffListItem"}},"pagination":{"$ref":"#/components/schemas/LegacyPagination"}}},"example":{"data":[{"id":"clxxx...","externalId":"EMP-0001","name":"山田太郎","specialties":["原画","レイアウト"],"deactivatedAt":null,"createdAt":"2026-01-15T00:00:00.000Z","updatedAt":"2026-11-05T03:00:00.000Z"}],"pagination":{"page":1,"perPage":50,"total":12}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"スタッフ名簿に1件登録します。external_id が既存の行に一致すれば、その行を更新します（upsert）。","description":"Idempotency-Key ヘッダが必須です。作成したときは 201（result: created）、更新したときは 200（result: updated）、送った値がすべて今の値と同じなら何も書かずに 200（result: unchanged）です。\n\nこの API が書くのはスタッフ名簿の行だけです。ログインアカウントの作成・招待メールの送信はしません。ログインする人は画面の招待か SCIM（/scim/v2/Users）で加えてください。招待を受けた人は、同じメールの名簿の行に自動で紐付きます。\n\n画面での登録と同じく、同じメールの組織のメンバー（名簿の行がまだ無い人）がいれば、その人に紐付けます（login_linked が true）。名簿の行は組織の人数（席数）に数えません。\n\n名前は必須で、空白だけ・null は 400（NAME_REQUIRED）です。メールアドレスで代用しません。URL を含む名前・所属会社は 400（INVALID_NAME）です。\n\n作成時に is_external が無いと 400（IS_EXTERNAL_REQUIRED）です。社内か社外かを AnimaTime が推測しません。\n\nメールの形式違いは 400（INVALID_EMAIL）、登録番号の形式違いは 400（INVALID_INVOICE_REGISTRATION_NUMBER）です。メールは一意にしません（画面と同じ）。国税庁への登録番号の照会はしません。\n\nspecialties に使える値: 絵コンテ / 演出 / 原画 / 第二原画 / レイアウト / 作監 / 動画 / 彩色 / 仕上げ / 背景 / 特効 / 3DCG / 撮影 / 編集 / 制作進行 / 制作デスク（画面の選択肢と同じ）。\n\n同じ external_id の行を同時に作ろうとしたときは 409（CONCURRENT_CONFLICT）です。新しい Idempotency-Key で送り直すと更新になります。\n\nメールアドレス・電話番号（email / phone）は staff:read_contact スコープも持つキーにだけ応答に含めます。教育機関プランの組織では返しません。\n\nactive: false で無効化、active: true で再有効化します（行は消しません）。active を送るには staff:write に加えて staff:deactivate スコープが要ります（無いと 403 INSUFFICIENT_SCOPE・何も書きません）。このスコープは、発行する人が画面でスタッフを無効化できる（staff:deactivate 権限）ときだけ付けられます。処理は画面の「無効化」と同じです: 進行中の工程の担当を外して工程の履歴と監査ログに残し（外した件数は unassigned_process_count）、そのスタッフに発行した APIキーと外注先ポータルのリンクが使えなくなります。再有効化するとキーとリンクは再び使えるようになります（外れた担当は戻りません）。すでに同じ状態なら何もしません（result: unchanged）。active: false の行を送り直すと、外し残しの担当があれば外します。\n\nこのキー自身のスタッフ（キーを発行した名簿の行）は無効化できません（409 CANNOT_DEACTIVATE_API_KEY_STAFF・無効化した瞬間にキーが止まるため）。画面か、別のスタッフのキーで行ってください。\n\n取引先（GET /api/v1/vendors）もスタッフ名簿の行です。社外の取引先は is_external: true で登録します。振込先口座は画面で登録します。\n\n記録は監査ログに「API: キーの名前」として残ります。","security":[{"bearerAuth":[]}],"x-animatime-scope":"staff:write","x-animatime-feature":"staff","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":100,"description":"移行元のID（組織の中で一意）。null で外す"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"空白だけは不可"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company_name":{"type":["string","null"],"maxLength":120},"is_external":{"type":"boolean","description":"false=社内 / true=社外（作成時は必須）"},"contract_type":{"type":"string","enum":["EMPLOYMENT","SUBCONTRACT","UNSPECIFIED"]},"is_individual":{"type":"boolean","description":"true=個人 / false=法人"},"tax_status":{"type":"string","enum":["TAXABLE","EXEMPT","UNKNOWN"]},"invoice_registration_number":{"type":["string","null"],"description":"T＋数字13桁"},"specialties":{"type":"array","items":{"type":"string","enum":["絵コンテ","演出","原画","第二原画","レイアウト","作監","動画","彩色","仕上げ","背景","特効","3DCG","撮影","編集","制作進行","制作デスク"]}},"active":{"type":"boolean","description":"false=無効化 / true=再有効化（画面の無効化と同じ処理。作成時の既定は true）。送るには staff:deactivate スコープも要る"}},"description":"external_id が既存の行に一致すれば更新、無ければ作成（name・is_external が必須）"}}}},"responses":{"200":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Staff"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"unchanged=送った値がすべて今の値と同じ（何も書いていない）"},"unassigned_process_count":{"type":"integer","description":"無効化に連動して担当を外した進行中の工程の数（画面の無効化と同じ）"}}},"example":{"data":{"object":"staff","id":"clxxx...","external_id":"EMP-0001","name":"山田太郎","company_name":null,"is_external":false,"contract_type":"EMPLOYMENT","is_individual":true,"tax_status":"UNKNOWN","invoice_registration_number":null,"specialties":["原画"],"login_linked":false,"active":true,"deactivated_at":null,"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"created","unassigned_process_count":0}}}},"201":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Staff"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"unchanged=送った値がすべて今の値と同じ（何も書いていない）"},"unassigned_process_count":{"type":"integer","description":"無効化に連動して担当を外した進行中の工程の数（画面の無効化と同じ）"}}},"example":{"data":{"object":"staff","id":"clxxx...","external_id":"EMP-0001","name":"山田太郎","company_name":null,"is_external":false,"contract_type":"EMPLOYMENT","is_individual":true,"tax_status":"UNKNOWN","invoice_registration_number":null,"specialties":["原画"],"login_linked":false,"active":true,"deactivated_at":null,"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"created","unassigned_process_count":0}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/episodes/{id}/cuts":{"get":{"summary":"話数に属するカットと、その工程の一覧を取得します。external_id でカットIDを引けます。","description":"パスパラメータ id は話数ID。APIキーの組織に属さない話数は 404 になります。\n\nカットは番号の昇順、工程は種別の昇順で返ります。\n\nexternalId は API で付けた移行元のID です（付けていないカットは null）。external_id を付けると、そのカットだけを返します。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:read","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"external_id","in":"query","required":false,"description":"移行元のID（話数内で一意）で絞り込みます。完全一致です。external_id=A&external_id=B のように繰り返すと複数を一度に引けます（最大 100 個・各 128 文字まで）。一致しないIDは結果に含まれないだけで、エラーにはなりません","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LegacyCutListItem"}}}},"example":{"data":[{"id":"clxxx...","number":"C-001","externalId":"SRC-CUT-0001","processes":[{"id":"clxxx...","type":"KEY_ANIMATION","status":"IN_PROGRESS","assigneeId":"clxxx...","startDate":"2026-01-10T00:00:00.000Z","dueDate":"2026-01-20T00:00:00.000Z"}]}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"話数にカットを1件作成します。external_id が同じカットが話数にすでにあれば、作らずにそのカットを更新します。","description":"パスパラメータ id は話数ID。APIキーの組織に属さない話数は 404 になります。\n\n新しいカットの工程は、画面でカットを作るときと同じく組織のワークフロー（話数 → 作品 → 組織の標準の順に、設定されているもの）から作ります。工程の種類は指定できません。工程の担当・日程・状態は PATCH /api/v1/processes/{id}（processes:write）で更新します。\n\nIdempotency-Key ヘッダが必須です。同じキーの再送には最初の応答をそのまま返します（24時間）。\n\nexternal_id（移行元のID・1〜128文字・前後の空白と制御文字は不可）を付けると、同じ external_id の行がすでにあれば作らずにその行を更新します（移行をやり直しても二重になりません）。external_id の一意の範囲は 作品=組織内 / 話数=作品内 / カット=話数内です。external_id を付けない行は毎回新しく作ります。\n\n応答の result は created（作った）/ updated（変えた）/ unchanged（送った値が今と同じで何もしていない）です。単体の作成は created のとき 201、それ以外は 200 です。\n\n削除は API では行えません。記録は監査ログに「API: キーの名前」として残ります。\n\n話数の別のカットと同じ番号は 409（DUPLICATE_CUT_NUMBER）です。新しいカットはシーンに属さないカットとして作ります。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"number":{"type":"string","minLength":1,"maxLength":20,"description":"カット番号（話数内で一意）"},"total_frames":{"type":["integer","null"],"minimum":0,"maximum":86400,"description":"尺（総フレーム数・24fps）"},"planned_sheets":{"type":["integer","null"],"minimum":0,"maximum":100000,"description":"予定枚数（0 は未入力）"},"notes":{"type":["string","null"],"maxLength":2000,"description":"申し送り"}},"required":["number"]}}}},"responses":{"200":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Cut"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"cut","id":"clxxx...","episode_id":"clxxx...","external_id":"SRC-CUT-0001","number":"C001","scene_id":null,"total_frames":156,"planned_sheets":12,"notes":"申し送り","processes":[{"id":"clxxx...","type":"LAYOUT","custom_step_id":null,"custom_label":null,"status":"NOT_STARTED"},{"id":"clyyy...","type":null,"custom_step_id":"clzzz...","custom_label":"3DCG","status":"NOT_STARTED"}],"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"created"}}}},"201":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Cut"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"cut","id":"clxxx...","episode_id":"clxxx...","external_id":"SRC-CUT-0001","number":"C001","scene_id":null,"total_frames":156,"planned_sheets":12,"notes":"申し送り","processes":[{"id":"clxxx...","type":"LAYOUT","custom_step_id":null,"custom_label":null,"status":"NOT_STARTED"},{"id":"clyyy...","type":null,"custom_step_id":"clzzz...","custom_label":"3DCG","status":"NOT_STARTED"}],"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"created"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/projects/bulk":{"post":{"summary":"作品をまとめて作成・更新します（最大 100 件）。","description":"本文は { \"items\": [...] } で、1リクエスト最大 100 件です。全部か無しで処理します: 1件でも拒否があれば何も書かず、422（VALIDATION_FAILED）と行ごとの理由（errors[].index は items の位置・0始まり）を返します。\n\n拒否の code: BAD_REQUEST（項目の形・長さ・未知の項目）/ DUPLICATE_IN_REQUEST（同じリクエストの中で external_id や番号が重なった）/ DUPLICATE_EPISODE_NUMBER・DUPLICATE_CUT_NUMBER（既存の行と番号が重なった）。\n\n確かめた後に同時に同じ行が書き換えられたときは何も書かずに 409（CONCURRENT_CONFLICT）を返します。新しい Idempotency-Key で送り直してください。\n\nIdempotency-Key ヘッダが必須です。同じキーの再送には最初の応答をそのまま返します（24時間）。\n\nexternal_id（移行元のID・1〜128文字・前後の空白と制御文字は不可）を付けると、同じ external_id の行がすでにあれば作らずにその行を更新します（移行をやり直しても二重になりません）。external_id の一意の範囲は 作品=組織内 / 話数=作品内 / カット=話数内です。external_id を付けない行は毎回新しく作ります。\n\n応答の result は created（作った）/ updated（変えた）/ unchanged（送った値が今と同じで何もしていない）です。単体の作成は created のとき 201、それ以外は 200 です。\n\n削除は API では行えません。記録は監査ログに「API: キーの名前」として残ります。\n\n作品数の上限は、新しく作る件数をまとめて確かめます（超える場合は何も作らず 403 PLAN_LIMIT_EXCEEDED）。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":10000}},"required":["name"]}}},"required":["items"],"description":"全部か無し（1件でも拒否があれば何も書かず 422）。最大 100 件"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"bulk_result"},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"data":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"},"project":{"$ref":"#/components/schemas/Project"}}}}}},"example":{"object":"bulk_result","created":1,"updated":1,"unchanged":0,"data":[{"index":0,"result":"updated","project":{"object":"project","id":"clxxx...","external_id":"SRC-PRJ-001","name":"作品タイトル","description":"説明","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"}},{"index":1,"result":"created","project":{"object":"project","id":"clyyy...","…":"同じ項目"}}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/BulkValidationError"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/projects/{id}":{"patch":{"summary":"作品の名前・説明・external_id を変更します。画面で作った作品に移行元のIDを付けるのにも使えます。","description":"パスパラメータ id は作品ID。APIキーの組織に属さない作品は 404 になります。\n\n送った項目だけを変えます。1つも送らないと 400 です。組織の別の作品が使っている external_id は 409（DUPLICATE_EXTERNAL_ID）です。\n\nIdempotency-Key ヘッダが必須です。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":["string","null"],"maxLength":10000}},"minProperties":1,"description":"送った項目だけを変える"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Project"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"project","id":"clxxx...","external_id":"SRC-PRJ-001","name":"作品タイトル","description":"説明","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"updated"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/projects/{id}/episodes":{"get":{"summary":"作品の話数の一覧を取得します（話数ID と external_id の突き合わせに使います）。","description":"パスパラメータ id は作品ID。APIキーの組織に属さない作品は 404 になります。\n\n作成した順に全件を返します（ページ分けはしません）。external_id を付けると、その話数だけを返します。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:read","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"external_id","in":"query","required":false,"description":"移行元のID（作品内で一意）で絞り込みます。完全一致です。external_id=A&external_id=B のように繰り返すと複数を一度に引けます（最大 100 個・各 128 文字まで）。一致しないIDは結果に含まれないだけで、エラーにはなりません","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Episode"}}}},"example":{"data":[{"object":"episode","id":"clxxx...","project_id":"clxxx...","external_id":"SRC-EP-01","number":"1","title":"第1話タイトル","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"作品に話数を1件作成します。external_id が同じ話数が作品にすでにあれば、作らずにその話数を更新します。","description":"パスパラメータ id は作品ID。APIキーの組織に属さない作品は 404 になります。\n\nIdempotency-Key ヘッダが必須です。同じキーの再送には最初の応答をそのまま返します（24時間）。\n\nexternal_id（移行元のID・1〜128文字・前後の空白と制御文字は不可）を付けると、同じ external_id の行がすでにあれば作らずにその行を更新します（移行をやり直しても二重になりません）。external_id の一意の範囲は 作品=組織内 / 話数=作品内 / カット=話数内です。external_id を付けない行は毎回新しく作ります。\n\n応答の result は created（作った）/ updated（変えた）/ unchanged（送った値が今と同じで何もしていない）です。単体の作成は created のとき 201、それ以外は 200 です。\n\n削除は API では行えません。記録は監査ログに「API: キーの名前」として残ります。\n\n作品の別の話数と同じ番号は 409（DUPLICATE_EPISODE_NUMBER）です。話数のワークフローは作品の設定に従います。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"number":{"type":"string","minLength":1,"maxLength":50,"description":"話数番号（作品内で一意）"},"title":{"type":["string","null"],"maxLength":200}},"required":["number"]}}}},"responses":{"200":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Episode"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"episode","id":"clxxx...","project_id":"clxxx...","external_id":"SRC-EP-01","number":"1","title":"第1話タイトル","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"created"}}}},"201":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Episode"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"episode","id":"clxxx...","project_id":"clxxx...","external_id":"SRC-EP-01","number":"1","title":"第1話タイトル","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"created"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/projects/{id}/episodes/bulk":{"post":{"summary":"作品の話数をまとめて作成・更新します（最大 200 件）。","description":"パスパラメータ id は作品ID。APIキーの組織に属さない作品は 404 になります。\n\n本文は { \"items\": [...] } で、1リクエスト最大 200 件です。全部か無しで処理します: 1件でも拒否があれば何も書かず、422（VALIDATION_FAILED）と行ごとの理由（errors[].index は items の位置・0始まり）を返します。\n\n拒否の code: BAD_REQUEST（項目の形・長さ・未知の項目）/ DUPLICATE_IN_REQUEST（同じリクエストの中で external_id や番号が重なった）/ DUPLICATE_EPISODE_NUMBER・DUPLICATE_CUT_NUMBER（既存の行と番号が重なった）。\n\n確かめた後に同時に同じ行が書き換えられたときは何も書かずに 409（CONCURRENT_CONFLICT）を返します。新しい Idempotency-Key で送り直してください。\n\nIdempotency-Key ヘッダが必須です。同じキーの再送には最初の応答をそのまま返します（24時間）。\n\nexternal_id（移行元のID・1〜128文字・前後の空白と制御文字は不可）を付けると、同じ external_id の行がすでにあれば作らずにその行を更新します（移行をやり直しても二重になりません）。external_id の一意の範囲は 作品=組織内 / 話数=作品内 / カット=話数内です。external_id を付けない行は毎回新しく作ります。\n\n応答の result は created（作った）/ updated（変えた）/ unchanged（送った値が今と同じで何もしていない）です。単体の作成は created のとき 201、それ以外は 200 です。\n\n削除は API では行えません。記録は監査ログに「API: キーの名前」として残ります。\n\n番号の入れ替え（1話と2話の番号を交換するなど）も1回のリクエストでできます。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"items":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"number":{"type":"string","minLength":1,"maxLength":50,"description":"話数番号（作品内で一意）"},"title":{"type":["string","null"],"maxLength":200}},"required":["number"]}}},"required":["items"],"description":"全部か無し（1件でも拒否があれば何も書かず 422）。最大 200 件"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"bulk_result"},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"data":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"},"episode":{"$ref":"#/components/schemas/Episode"}}}}}},"example":{"object":"bulk_result","created":2,"updated":0,"unchanged":0,"data":[{"index":0,"result":"created","episode":{"object":"episode","id":"clxxx...","project_id":"clxxx...","external_id":"SRC-EP-01","number":"1","title":"第1話タイトル","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"}},{"index":1,"result":"created","episode":{"object":"episode","id":"clyyy...","…":"同じ項目"}}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/BulkValidationError"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/episodes/{id}":{"patch":{"summary":"話数の番号・タイトル・external_id を変更します。","description":"パスパラメータ id は話数ID。APIキーの組織に属さない話数は 404 になります。\n\n送った項目だけを変えます。1つも送らないと 400 です。作品の別の話数と同じ番号は 409（DUPLICATE_EPISODE_NUMBER）、別の話数が使っている external_id は 409（DUPLICATE_EXTERNAL_ID）です。\n\nIdempotency-Key ヘッダが必須です。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"number":{"type":"string","minLength":1,"maxLength":50,"description":"話数番号（作品内で一意）"},"title":{"type":["string","null"],"maxLength":200}},"minProperties":1,"description":"送った項目だけを変える"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Episode"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"episode","id":"clxxx...","project_id":"clxxx...","external_id":"SRC-EP-01","number":"1","title":"第1話タイトル","created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"updated"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/episodes/{id}/cuts/bulk":{"post":{"summary":"話数のカットをまとめて作成・更新します（最大 500 件）。","description":"パスパラメータ id は話数ID。APIキーの組織に属さない話数は 404 になります。\n\n新しいカットの工程は、画面でカットを作るときと同じく組織のワークフロー（話数 → 作品 → 組織の標準の順に、設定されているもの）から作ります。工程の種類は指定できません。工程の担当・日程・状態は PATCH /api/v1/processes/{id}（processes:write）で更新します。\n\n本文は { \"items\": [...] } で、1リクエスト最大 500 件です。全部か無しで処理します: 1件でも拒否があれば何も書かず、422（VALIDATION_FAILED）と行ごとの理由（errors[].index は items の位置・0始まり）を返します。\n\n拒否の code: BAD_REQUEST（項目の形・長さ・未知の項目）/ DUPLICATE_IN_REQUEST（同じリクエストの中で external_id や番号が重なった）/ DUPLICATE_EPISODE_NUMBER・DUPLICATE_CUT_NUMBER（既存の行と番号が重なった）。\n\n確かめた後に同時に同じ行が書き換えられたときは何も書かずに 409（CONCURRENT_CONFLICT）を返します。新しい Idempotency-Key で送り直してください。\n\nIdempotency-Key ヘッダが必須です。同じキーの再送には最初の応答をそのまま返します（24時間）。\n\nexternal_id（移行元のID・1〜128文字・前後の空白と制御文字は不可）を付けると、同じ external_id の行がすでにあれば作らずにその行を更新します（移行をやり直しても二重になりません）。external_id の一意の範囲は 作品=組織内 / 話数=作品内 / カット=話数内です。external_id を付けない行は毎回新しく作ります。\n\n応答の result は created（作った）/ updated（変えた）/ unchanged（送った値が今と同じで何もしていない）です。単体の作成は created のとき 201、それ以外は 200 です。\n\n削除は API では行えません。記録は監査ログに「API: キーの名前」として残ります。\n\n番号の入れ替え（C001 と C002 の番号を交換するなど）も1回のリクエストでできます。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"items":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"number":{"type":"string","minLength":1,"maxLength":20,"description":"カット番号（話数内で一意）"},"total_frames":{"type":["integer","null"],"minimum":0,"maximum":86400,"description":"尺（総フレーム数・24fps）"},"planned_sheets":{"type":["integer","null"],"minimum":0,"maximum":100000,"description":"予定枚数（0 は未入力）"},"notes":{"type":["string","null"],"maxLength":2000,"description":"申し送り"}},"required":["number"]}}},"required":["items"],"description":"全部か無し（1件でも拒否があれば何も書かず 422）。最大 500 件"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"bulk_result"},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"data":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"},"cut":{"$ref":"#/components/schemas/Cut"}}}}}},"example":{"object":"bulk_result","created":2,"updated":0,"unchanged":0,"data":[{"index":0,"result":"created","cut":{"object":"cut","id":"clxxx...","episode_id":"clxxx...","external_id":"SRC-CUT-0001","number":"C001","scene_id":null,"total_frames":156,"planned_sheets":12,"notes":"申し送り","processes":[{"id":"clxxx...","type":"LAYOUT","custom_step_id":null,"custom_label":null,"status":"NOT_STARTED"},{"id":"clyyy...","type":null,"custom_step_id":"clzzz...","custom_label":"3DCG","status":"NOT_STARTED"}],"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"}},{"index":1,"result":"created","cut":{"object":"cut","id":"clyyy...","…":"同じ項目"}}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/BulkValidationError"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/cuts/{id}":{"patch":{"summary":"カットの番号・尺・予定枚数・申し送り・external_id を変更します。","description":"パスパラメータ id はカットID。APIキーの組織に属さないカットは 404 になります。\n\n送った項目だけを変えます。1つも送らないと 400 です。同じ話数（シーンに属するカットはそのシーン）の別のカットと同じ番号は 409（DUPLICATE_CUT_NUMBER）、別のカットが使っている external_id は 409（DUPLICATE_EXTERNAL_ID）です。\n\nIdempotency-Key ヘッダが必須です。","security":[{"bearerAuth":[]}],"x-animatime-scope":"projects:write","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID。同じ値の行があれば作らずに更新する（前後の空白・制御文字は不可）"},"number":{"type":"string","minLength":1,"maxLength":20,"description":"カット番号（話数内で一意）"},"total_frames":{"type":["integer","null"],"minimum":0,"maximum":86400,"description":"尺（総フレーム数・24fps）"},"planned_sheets":{"type":["integer","null"],"minimum":0,"maximum":100000,"description":"予定枚数（0 は未入力）"},"notes":{"type":["string","null"],"maxLength":2000,"description":"申し送り"}},"minProperties":1,"description":"送った項目だけを変える"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Cut"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"cut","id":"clxxx...","episode_id":"clxxx...","external_id":"SRC-CUT-0001","number":"C001","scene_id":null,"total_frames":156,"planned_sheets":12,"notes":"申し送り","processes":[{"id":"clxxx...","type":"LAYOUT","custom_step_id":null,"custom_label":null,"status":"NOT_STARTED"},{"id":"clyyy...","type":null,"custom_step_id":"clzzz...","custom_label":"3DCG","status":"NOT_STARTED"}],"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"updated"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/rights-jobs":{"get":{"summary":"版権案件（作品と並列の単発案件・CD/DVD ジャケットなど）の一覧を取得します。external_id で案件IDを引けます。","description":"並びは作成日時の古い順です。has_more が true のときは next_cursor を starting_after に渡して続きを取ります。\n\nstatus は 開始前（NOT_STARTED）→ 作業中（IN_PROGRESS）→ 確認中（CONFIRMED）→ 納品済み（DELIVERED）です（画面の外部仕事と同じ値）。\n\n見込み金額は amounts:read スコープも持つキーにだけ amounts.amount として返します。","security":[{"bearerAuth":[]}],"x-animatime-scope":"rights_jobs:read","x-animatime-feature":"rights-jobs","parameters":[{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定: 20 / 最大: 100）","schema":{"type":"integer"}},{"name":"starting_after","in":"query","required":false,"description":"前回の応答の next_cursor。続きのページを返します","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"この日時以降に更新された行だけを返します（差分の同期用）","schema":{"type":"string"}},{"name":"external_id","in":"query","required":false,"description":"移行元のID（組織内で一意）で絞り込みます。完全一致です。external_id=A&external_id=B のように繰り返すと複数を一度に引けます（最大 100 個・各 128 文字まで）。一致しないIDは結果に含まれないだけで、エラーにはなりません","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}},{"name":"project_id","in":"query","required":false,"description":"作品IDで絞り込みます","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"NOT_STARTED / IN_PROGRESS / CONFIRMED / DELIVERED のいずれかで絞り込みます","schema":{"type":"string"}},{"name":"include_archived","in":"query","required":false,"description":"true でアーカイブした案件も返します（既定は返しません）","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/RightsJob"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"次のページの starting_after に渡す値（続きが無ければ null）"}}},"example":{"object":"list","data":[{"object":"rights_job","id":"clxxx...","external_id":"SRC-RJ-0001","title":"Blu-ray 第1巻ジャケット","project_id":"clyyy...","project_name":"作品タイトル","category_key":"JACKET","status":"IN_PROGRESS","due_date":"2026-12-10","due_time":"15:00","assignee_staff_id":"clzzz...","assignee_name":"山田太郎","notes":null,"archived_at":null,"created_at":"2026-11-20T03:00:00.000Z","updated_at":"2026-11-20T03:00:00.000Z"}],"has_more":false,"next_cursor":null}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"版権案件を1件作成します。external_id が同じ案件がすでにあれば、作らずにその案件を更新します。","description":"Idempotency-Key ヘッダが必須です。同じキーの再送には最初の応答をそのまま返します（24時間）。\n\nexternal_id（1〜128文字・前後の空白と制御文字は不可）を付けると、同じ external_id の案件（アーカイブ済みを含む）があれば作らずにその案件を更新します。\n\n応答の result は created / updated / unchanged です。created のとき 201、それ以外は 200 です。\n\n作品ID・担当のスタッフIDが組織に無いときは 400（PROJECT_NOT_FOUND / ASSIGNEE_NOT_FOUND）です。category_key は組織の「版権案件の種類」にあるキーだけを受け付けます。\n\nアーカイブ（削除）は API では行えません。記録は監査ログに「API: キーの名前」として残ります。\n\nstatus は 開始前（NOT_STARTED）→ 作業中（IN_PROGRESS）→ 確認中（CONFIRMED）→ 納品済み（DELIVERED）です（画面の外部仕事と同じ値）。\n\n見込み金額は amounts:read スコープも持つキーにだけ amounts.amount として返します。","security":[{"bearerAuth":[]}],"x-animatime-scope":"rights_jobs:write","x-animatime-feature":"rights-jobs","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID（組織内で一意）。同じ値の案件があれば作らずに更新する（前後の空白・制御文字は不可）"},"title":{"type":"string","minLength":1,"maxLength":200},"project_id":{"type":["string","null"],"description":"作品ID（null で紐付けなし）"},"category_key":{"type":"string","description":"組織の「版権案件の種類」のキー（\"\" で未設定）"},"status":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","CONFIRMED","DELIVERED"]},"due_date":{"type":["string","null"],"description":"YYYY-MM-DD（null で未設定）"},"due_time":{"type":["string","null"],"description":"HH:MM（null で未設定）"},"assignee_staff_id":{"type":["string","null"],"description":"担当のスタッフID（null で外す）"},"amount":{"type":["integer","null"],"minimum":0,"description":"見込み金額（円）"},"notes":{"type":["string","null"],"maxLength":4000}},"required":[],"description":"external_id が既存の案件に一致すれば更新、無ければ作成（作成時は title が必須）"}}}},"responses":{"200":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/RightsJob"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"rights_job","id":"clxxx...","external_id":"SRC-RJ-0001","title":"Blu-ray 第1巻ジャケット","project_id":"clyyy...","project_name":"作品タイトル","category_key":"JACKET","status":"IN_PROGRESS","due_date":"2026-12-10","due_time":"15:00","assignee_staff_id":"clzzz...","assignee_name":"山田太郎","notes":null,"archived_at":null,"created_at":"2026-11-20T03:00:00.000Z","updated_at":"2026-11-20T03:00:00.000Z"},"result":"created"}}}},"201":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/RightsJob"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"rights_job","id":"clxxx...","external_id":"SRC-RJ-0001","title":"Blu-ray 第1巻ジャケット","project_id":"clyyy...","project_name":"作品タイトル","category_key":"JACKET","status":"IN_PROGRESS","due_date":"2026-12-10","due_time":"15:00","assignee_staff_id":"clzzz...","assignee_name":"山田太郎","notes":null,"archived_at":null,"created_at":"2026-11-20T03:00:00.000Z","updated_at":"2026-11-20T03:00:00.000Z"},"result":"created"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/rights-jobs/{id}":{"get":{"summary":"版権案件を1件取得します（アーカイブした案件も返します）。","description":"パスパラメータ id は版権案件ID。APIキーの組織に属さない案件は 404 になります。\n\nstatus は 開始前（NOT_STARTED）→ 作業中（IN_PROGRESS）→ 確認中（CONFIRMED）→ 納品済み（DELIVERED）です（画面の外部仕事と同じ値）。\n\n見込み金額は amounts:read スコープも持つキーにだけ amounts.amount として返します。","security":[{"bearerAuth":[]}],"x-animatime-scope":"rights_jobs:read","x-animatime-feature":"rights-jobs","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/RightsJob"}}},"example":{"data":{"object":"rights_job","id":"clxxx...","external_id":"SRC-RJ-0001","title":"Blu-ray 第1巻ジャケット","project_id":"clyyy...","project_name":"作品タイトル","category_key":"JACKET","status":"IN_PROGRESS","due_date":"2026-12-10","due_time":"15:00","assignee_staff_id":"clzzz...","assignee_name":"山田太郎","notes":null,"archived_at":null,"created_at":"2026-11-20T03:00:00.000Z","updated_at":"2026-11-20T03:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"summary":"版権案件の項目を変更します（送った項目だけ）。画面で作った案件に移行元のIDを付けるのにも使えます。","description":"パスパラメータ id は版権案件ID。APIキーの組織に属さない案件は 404 になります。\n\n送った項目だけを変えます。1つも送らないと 400、別の案件が使っている external_id は 409（DUPLICATE_EXTERNAL_ID）です。\n\nIdempotency-Key ヘッダが必須です。\n\nstatus は 開始前（NOT_STARTED）→ 作業中（IN_PROGRESS）→ 確認中（CONFIRMED）→ 納品済み（DELIVERED）です（画面の外部仕事と同じ値）。\n\n見込み金額は amounts:read スコープも持つキーにだけ amounts.amount として返します。","security":[{"bearerAuth":[]}],"x-animatime-scope":"rights_jobs:write","x-animatime-feature":"rights-jobs","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":128,"description":"移行元のID（組織内で一意）。同じ値の案件があれば作らずに更新する（前後の空白・制御文字は不可）"},"title":{"type":"string","minLength":1,"maxLength":200},"project_id":{"type":["string","null"],"description":"作品ID（null で紐付けなし）"},"category_key":{"type":"string","description":"組織の「版権案件の種類」のキー（\"\" で未設定）"},"status":{"type":"string","enum":["NOT_STARTED","IN_PROGRESS","CONFIRMED","DELIVERED"]},"due_date":{"type":["string","null"],"description":"YYYY-MM-DD（null で未設定）"},"due_time":{"type":["string","null"],"description":"HH:MM（null で未設定）"},"assignee_staff_id":{"type":["string","null"],"description":"担当のスタッフID（null で外す）"},"amount":{"type":["integer","null"],"minimum":0,"description":"見込み金額（円）"},"notes":{"type":["string","null"],"maxLength":4000}},"minProperties":1,"description":"送った項目だけを変える"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/RightsJob"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"created=作った / updated=変えた / unchanged=送った値が今と同じで何もしていない"}},"required":["data","result"]},"example":{"data":{"object":"rights_job","id":"clxxx...","external_id":"SRC-RJ-0001","title":"Blu-ray 第1巻ジャケット","project_id":"clyyy...","project_name":"作品タイトル","category_key":"JACKET","status":"IN_PROGRESS","due_date":"2026-12-10","due_time":"15:00","assignee_staff_id":"clzzz...","assignee_name":"山田太郎","notes":null,"archived_at":null,"created_at":"2026-11-20T03:00:00.000Z","updated_at":"2026-11-20T03:00:00.000Z"},"result":"updated"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/processes/{id}":{"patch":{"summary":"工程のステータス・担当・日程を更新します。","description":"status の有効値: NOT_STARTED / IN_PROGRESS / COMPLETED / RETAKE\n\n更新できる項目が1つも含まれていない場合は 400 になります。\n\n外部発注の工程で発注伝票・納品・承認が揃っていない場合は 422 または 400（REQUIRES_PURCHASE_ORDER / REQUIRES_APPROVAL / REQUIRES_ORDER_DELIVERY）で拒否されます。","security":[{"bearerAuth":[]}],"x-animatime-scope":"processes:write","x-animatime-feature":"projects","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"id":"clxxx...","type":"KEY_ANIMATION","status":"COMPLETED","assigneeId":"clxxx...","startDate":"2026-01-10T00:00:00.000Z","dueDate":"2026-01-20T00:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/processes/bulk/status":{"patch":{"summary":"複数の工程のステータスをまとめて更新します。","description":"1リクエストあたり最大100件です。\n\nprocessIds に組織外の工程が1件でも含まれていると、何も更新せず 404 を返します。\n\n途中で拒否された場合は、その時点までに更新できた件数を data.updated に入れてエラーを返します。","security":[{"bearerAuth":[]}],"x-animatime-scope":"processes:write","x-animatime-feature":"projects","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object"},"example":{"data":{"updated":2}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/orders":{"get":{"summary":"発注の一覧を取得します（明細は含みません）。","description":"並びは作成日時の古い順です。has_more が true のときは next_cursor を starting_after に渡して続きを取ります。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。組織で請求・支払の機能が使えない場合は付けても返しません。金額は発行時に保存した値で、再計算しません。\n\nstatus は発注全体の状態です（明細の状態は GET /api/v1/orders/{id} の items[].delivery_status）。","security":[{"bearerAuth":[]}],"x-animatime-scope":"orders:read","x-animatime-feature":"orders","parameters":[{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定: 20 / 最大: 100）","schema":{"type":"integer"}},{"name":"starting_after","in":"query","required":false,"description":"前回の応答の next_cursor。続きのページを返します","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"この日時以降に更新された行だけを返します（差分の同期用）","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"ORDERED / DELIVERED / CONFIRMED / CANCELLED で絞り込み","schema":{"type":"string"}},{"name":"order_kind","in":"query","required":false,"description":"CUT（カット単位）/ MASTER（話数単位）/ ADJUSTMENT（マイナス伝票）で絞り込み","schema":{"type":"string"}},{"name":"episode_id","in":"query","required":false,"description":"話数IDで絞り込み","schema":{"type":"string"}},{"name":"vendor_id","in":"query","required":false,"description":"取引先ID（GET /api/v1/vendors の id）で絞り込み","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"次のページの starting_after に渡す値（続きが無ければ null）"}}},"example":{"object":"list","data":[{"object":"order","id":"clxxx...","order_number":"PO-2026-0123","order_kind":"CUT","status":"DELIVERED","project_id":"clxxx...","episode_id":"clxxx...","vendor":{"id":"clxxx...","name":"取引先名"},"process_type":"KEY_ANIMATION","process_label":"原画","master_part":null,"order_group_id":null,"order_date":"2026-11-01T00:00:00.000Z","due_date":"2026-11-20T00:00:00.000Z","sent_at":"2026-11-01T03:00:00.000Z","vendor_accepted_at":"2026-11-01T05:00:00.000Z","vendor_declined_at":null,"delivered_at":"2026-11-18T09:00:00.000Z","cancelled_at":null,"invoice_id":null,"adjustment_for_order_id":null,"is_provisional_amount":false,"created_at":"2026-11-01T00:00:00.000Z","updated_at":"2026-11-18T09:00:00.000Z","amounts":{"currency":"JPY","tax_included":true,"tax_rate":0.1,"withholding_applied":true,"subtotal":100000,"consumption_tax":10000,"withholding_tax":10210,"gross_amount":110000,"total_amount":99790}}],"has_more":false,"next_cursor":null}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/orders/{id}":{"get":{"summary":"発注1件を、明細・取引先の受諾/差し戻しの記録・発注書の明示事項・取消とあわせて取得します。","description":"パスパラメータ id は発注ID。APIキーの組織に属さない発注は 404 になります。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。組織で請求・支払の機能が使えない場合は付けても返しません。金額は発行時に保存した値で、再計算しません。\n\nterms は発注書を発行した時点の値です（組織の設定を後から変えても変わりません）。発行前の発注では null の項目があります。\n\nvendor_responses の effective が false の行は、先に別の返答が通った後に届いた返答の記録です。","security":[{"bearerAuth":[]}],"x-animatime-scope":"orders:read","x-animatime-feature":"orders","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/OrderDetail"}}},"example":{"data":{"object":"order","id":"clxxx...","order_number":"PO-2026-0123","status":"DELIVERED","…":"一覧と同じ項目","adjustment_order_id":null,"terms":{"receipt_place":"電子データで納品","inspection_days":10,"inspection_due_date":"2026-11-30T00:00:00.000Z","payment_due_date":"2026-12-31T00:00:00.000Z","check_period_days":3,"correction_period_days":3,"quality_standard":"…","rights_handling":"…","cancellation_policy":"…"},"cancellation":null,"items":[{"object":"order_item","id":"clxxx...","process_id":"clxxx...","cut_number":"C-001","description":null,"seconds":3.5,"sheets":12,"delivery_status":"DELIVERED","delivered_at":"2026-11-18T09:00:00.000Z","confirmed_at":null,"invoice_id":null,"worker_id":null,"amounts":{"unit_price":3800,"tax_rate":null,"invoiced_gross":null}}],"vendor_responses":[{"id":"clxxx...","action":"ACCEPTED","channel":"PORTAL","effective":true,"reason":null,"responded_at":"2026-11-01T05:00:00.000Z"}]}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/vendors":{"get":{"summary":"取引先（社外の名簿、または発注先になったことがある名簿）の一覧を取得します。","description":"並びは作成日時の古い順です。has_more が true のときは next_cursor を starting_after に渡して続きを取ります。\n\nメールアドレス・電話番号・振込口座は返しません。\n\n発注・請求書の vendor.id はこの一覧の id と同じです。","security":[{"bearerAuth":[]}],"x-animatime-scope":"vendors:read","x-animatime-feature":"orders","parameters":[{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定: 20 / 最大: 100）","schema":{"type":"integer"}},{"name":"starting_after","in":"query","required":false,"description":"前回の応答の next_cursor。続きのページを返します","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"この日時以降に更新された行だけを返します（差分の同期用）","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Vendor"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"次のページの starting_after に渡す値（続きが無ければ null）"}}},"example":{"object":"list","data":[{"object":"vendor","id":"clxxx...","name":"取引先名","company_name":null,"is_individual":true,"is_external":true,"contract_type":"SUBCONTRACT","tax_status":"TAXABLE","invoice_registration_number":"T1234567890123","deactivated_at":null,"created_at":"2026-01-15T00:00:00.000Z","updated_at":"2026-01-15T00:00:00.000Z"}],"has_more":false,"next_cursor":null}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/invoices":{"get":{"summary":"取引先から受け取った請求書（受領請求書）の一覧を取得します。","description":"並びは作成日時の古い順です。has_more が true のときは next_cursor を starting_after に渡して続きを取ります。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。組織で請求・支払の機能が使えない場合は付けても返しません。金額は発行時に保存した値で、再計算しません。","security":[{"bearerAuth":[]}],"x-animatime-scope":"invoices:read","x-animatime-feature":"billing","parameters":[{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定: 20 / 最大: 100）","schema":{"type":"integer"}},{"name":"starting_after","in":"query","required":false,"description":"前回の応答の next_cursor。続きのページを返します","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"この日時以降に更新された行だけを返します（差分の同期用）","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"UNPAID / PAID で絞り込み","schema":{"type":"string"}},{"name":"vendor_id","in":"query","required":false,"description":"取引先IDで絞り込み","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"次のページの starting_after に渡す値（続きが無ければ null）"}}},"example":{"object":"list","data":[{"object":"invoice","id":"clxxx...","invoice_number":"INV-0042","vendor":{"id":"clxxx...","name":"取引先名"},"status":"UNPAID","issue_date":"2026-11-30T00:00:00.000Z","due_date":"2026-12-31T00:00:00.000Z","paid_at":null,"payment_instructed_at":"2026-12-20T01:00:00.000Z","scheduled_transfer_date":"2026-12-25T00:00:00.000Z","has_file":true,"created_at":"2026-12-01T00:00:00.000Z","updated_at":"2026-12-20T01:00:00.000Z","amounts":{"currency":"JPY","amount":110000}}],"has_more":false,"next_cursor":null}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"summary":"取引先から受け取った請求書（受領請求書）を登録します。発注・明細への紐付け（消込）も同時にできます。","description":"Idempotency-Key ヘッダが必須です。登録できたときは 201、同じキーの再送（登録済み）は 200 で同じ請求書を返します。\n\n同じ請求元・同じ請求書番号の請求書がすでにあると 409（DUPLICATE_INVOICE_NUMBER）です。\n\n請求額が紐付けた発注・明細の金額と一致しないと 422（AMOUNT_MISMATCH）です。差額はマイナス伝票（画面）で調整してください。\n\n支払期日が月次締め済みの月だと 409（MONTH_CLOSED）です。\n\norder_ids・order_item_ids をどちらも省くと、画面での登録と同じく、同じ取引先の発注のうち金額が一つだけ一致するものへ自動で紐付けます（link_result.auto_linked が true）。一致が一つに決まらないときは紐付けず、候補を link_result.candidates に返します。\n\nlink_result.duplicate_warnings は二重登録の疑い（番号の打ち間違い・近い期間の同額）です。登録は成立しています。\n\n支払指示・支払済の記録は API では行えません。","security":[{"bearerAuth":[]}],"x-animatime-scope":"invoices:write","x-animatime-feature":"billing","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"vendor_id":{"type":["string","null"],"description":"取引先ID（vendor_name とどちらか必須）"},"vendor_name":{"type":["string","null"],"description":"名簿に無い請求元（組織で自由入力を許可しているときだけ）"},"amount":{"type":"integer","minimum":0,"description":"請求額（円・税込・源泉控除前）"},"invoice_number":{"type":["string","null"]},"issue_date":{"type":["string","null"],"description":"ISO 8601 の日付"},"due_date":{"type":["string","null"],"description":"ISO 8601 の日付。省くと紐付けた発注の支払期日"},"notes":{"type":["string","null"]},"order_ids":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"発注ごとに紐付け"},"order_item_ids":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"明細ごとに紐付け（分納の一部）"}},"required":["amount"]}}}},"responses":{"200":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"},"link_result":{"type":"object","additionalProperties":false,"properties":{"linked":{"type":"boolean"},"auto_linked":{"type":"boolean","description":"金額が一つだけ一致する発注へ自動で紐付けた"},"candidates":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"order_id":{"type":"string"},"order_number":{"type":"string"}}},"description":"紐付けなかったときの候補"},"duplicate_warnings":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"invoice_id":{"type":"string"},"reason":{"type":"string"}}},"description":"二重登録の疑い（登録は成立している）"}}}}},"example":{"data":{"object":"invoice","id":"clxxx...","…":"GET /api/v1/invoices/{id} と同じ項目","order_ids":["clxxx..."],"order_items":[]},"link_result":{"linked":true,"auto_linked":false,"candidates":[],"duplicate_warnings":[]}}}}},"201":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"},"link_result":{"type":"object","additionalProperties":false,"properties":{"linked":{"type":"boolean"},"auto_linked":{"type":"boolean","description":"金額が一つだけ一致する発注へ自動で紐付けた"},"candidates":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"order_id":{"type":"string"},"order_number":{"type":"string"}}},"description":"紐付けなかったときの候補"},"duplicate_warnings":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"invoice_id":{"type":"string"},"reason":{"type":"string"}}},"description":"二重登録の疑い（登録は成立している）"}}}}},"example":{"data":{"object":"invoice","id":"clxxx...","…":"GET /api/v1/invoices/{id} と同じ項目","order_ids":["clxxx..."],"order_items":[]},"link_result":{"linked":true,"auto_linked":false,"candidates":[],"duplicate_warnings":[]}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/invoices/{id}":{"get":{"summary":"受領請求書1件を、消込先（紐付けた発注・明細）とあわせて取得します。","description":"パスパラメータ id は請求書ID。APIキーの組織に属さない請求書は 404 になります。\n\norder_ids は発注ごと（全額）の紐付け、order_items は明細ごと（分納の一部）の紐付けです。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。組織で請求・支払の機能が使えない場合は付けても返しません。金額は発行時に保存した値で、再計算しません。","security":[{"bearerAuth":[]}],"x-animatime-scope":"invoices:read","x-animatime-feature":"billing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"}}},"example":{"data":{"object":"invoice","id":"clxxx...","…":"一覧と同じ項目","order_ids":["clxxx..."],"order_items":[{"id":"clxxx...","order_id":"clxxx..."}]}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/events":{"get":{"summary":"発注・請求の業務イベントを古い順に取得します。Webhook を取りこぼしたときの回収に使います。","description":"返すのはキーのスコープで読める種類だけです（orders:read → order.*、invoices:read → invoice.* / payment.*）。\n\nサンドボックス組織（テスト用キー at_test_…）のイベントは livemode が false です。\n\nnext_cursor は毎回返します。次の呼び出しで starting_after に渡すと、その後に起きたイベントだけが返ります。\n\n書き込み中の処理の分だけ、連番が数秒〜数分遅れて埋まることがあります。取りこぼしたくない場合は少し前のカーソルから重ねて読み、id で重複を除いてください。\n\n保持期間は30日です。それより古いイベントは返りません。","security":[{"bearerAuth":[]}],"x-animatime-scope":"events:read","x-animatime-feature":"orders","parameters":[{"name":"starting_after","in":"query","required":false,"description":"前回の応答の next_cursor（連番）。省略すると保持期間の最初から返します","schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定: 50 / 最大: 100）","schema":{"type":"integer"}},{"name":"type","in":"query","required":false,"description":"イベントの種類で絞り込み（例: order.sent）","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"次の starting_after に渡す連番（毎回返る）"}}},"example":{"object":"list","data":[{"id":"evt_5c1e9a2f7b3d4e6a8c0f1b2d","object":"event","type":"order.sent","api_version":"2026-11-01","created":"2026-11-05T03:00:00.000Z","organization_id":"clxxx...","livemode":true,"data":{"object":{"object":"order","id":"clxxx...","status":"ORDERED","sent_at":"2026-11-05T03:00:00.000Z","channel":"EMAIL"},"previous":{"sent_at":null}},"actor":{"type":"user","name":"制作進行A"}}],"has_more":false,"next_cursor":"1042"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/payments":{"get":{"summary":"受領請求書ごとの支払の状態（未指示・支払指示済み・支払済）を取得します。","description":"並びは作成日時の古い順です。has_more が true のときは next_cursor を starting_after に渡して続きを取ります。\n\n支払は受領請求書の単位です（id は請求書の id と同じ）。請求書の来ない取引先（支払明細書で払う取引先）への振込は載りません。\n\nstatus は paid（支払済）→ instructed（支払指示＝全銀データの出力を確定した・振込予定日つき）→ open（どちらもまだ）の順に判定します。支払指示は着金ではありません。支払済は人が着金を確かめて付けます。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。組織で請求・支払の機能が使えない場合は付けても返しません。金額は発行時に保存した値で、再計算しません。","security":[{"bearerAuth":[]}],"x-animatime-scope":"payments:read","x-animatime-feature":"billing","parameters":[{"name":"limit","in":"query","required":false,"description":"1回に返す件数（既定: 20 / 最大: 100）","schema":{"type":"integer"}},{"name":"starting_after","in":"query","required":false,"description":"前回の応答の next_cursor。続きのページを返します","schema":{"type":"string"}},{"name":"updated_since","in":"query","required":false,"description":"この日時以降に更新された行だけを返します（差分の同期用）","schema":{"type":"string"}},{"name":"status","in":"query","required":false,"description":"open（未指示）/ instructed（支払指示済み・振込待ち）/ paid（支払済）で絞り込み","schema":{"type":"string"}},{"name":"vendor_id","in":"query","required":false,"description":"取引先IDで絞り込み","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"次のページの starting_after に渡す値（続きが無ければ null）"}}},"example":{"object":"list","data":[{"object":"payment","id":"clxxx...","invoice_id":"clxxx...","invoice_number":"INV-0042","vendor":{"id":"clxxx...","name":"取引先名"},"status":"instructed","due_date":"2026-12-31T00:00:00.000Z","payment_instructed_at":"2026-12-20T01:00:00.000Z","scheduled_transfer_date":"2026-12-25T00:00:00.000Z","paid_at":null,"created_at":"2026-12-01T00:00:00.000Z","updated_at":"2026-12-20T01:00:00.000Z","amounts":{"currency":"JPY","amount":110000}}],"has_more":false,"next_cursor":null}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/budgets":{"get":{"summary":"作品ごとの予算の状態・着地見込みの状態・工程の進捗を取得します（全作品）。","description":"ページ分けはしません（全作品を1回で返します）。\n\nstatus は発注済みの額、forecast_status は着地見込み（発注済み＋内製の報酬＋未発注の見込み）で判定した予算の状態です。none（予算未設定）/ ok / warning（80%以上）/ over（100%以上）。\n\n予算は作品の予算、無ければ話数の予算の合計です。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。予算・着地見込みは保存された値ではなく、呼び出しのたびに画面の予算一覧と同じ計算で出します（未発注の見込みは基準単価からの概算）。\n\n集計が重いため、組織ごとに1分あたり10回までです（超えると 429 RATE_LIMITED）。","security":[{"bearerAuth":[]}],"x-animatime-scope":"budgets:read","x-animatime-feature":"billing","parameters":[],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Budget"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"],"description":"次のページの starting_after に渡す値（続きが無ければ null）"}}},"example":{"object":"list","data":[{"object":"budget","id":"clxxx...","project_id":"clxxx...","project_name":"作品名","has_budget":true,"status":"warning","forecast_status":"over","progress":{"percent":42,"total_processes":1200,"completed_processes":504},"amounts":{"currency":"JPY","budget":30000000,"ordered":25000000,"paid":12000000,"remaining":5000000,"consumption_rate":83.3,"internal_accrued":1500000,"unordered_estimate":6000000,"forecast":32500000}}],"has_more":false,"next_cursor":null}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/projects/{id}/budget":{"get":{"summary":"作品1件の予算を、話数ごとの内訳とあわせて取得します。","description":"パスパラメータ id は作品ID。APIキーの組織に属さない作品は 404 になります。\n\n話数の status は話数の予算で判定します（話数に予算が無ければ none）。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。組織ごとに1分あたり10回まで（GET /api/v1/budgets と合わせて数えます）。","security":[{"bearerAuth":[]}],"x-animatime-scope":"budgets:read","x-animatime-feature":"billing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/ProjectBudget"}}},"example":{"data":{"object":"budget","id":"clxxx...","project_id":"clxxx...","project_name":"作品名","has_budget":true,"status":"ok","forecast_status":"warning","amounts":{"currency":"JPY","budget":30000000,"ordered":20000000,"…":"一覧と同じ項目"},"episodes":[{"object":"episode_budget","episode_id":"clxxx...","episode_number":"1","episode_title":"第1話","has_budget":true,"status":"ok","forecast_status":"ok","order_count":48,"amounts":{"currency":"JPY","budget":2500000,"ordered":1800000,"…":"一覧と同じ項目"}}]}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/orders/{id}/items/{itemId}/delivery":{"post":{"summary":"発注明細の納品・検収を記録します。記録日はリクエストを受け取った時刻です。","description":"Idempotency-Key ヘッダが必須です。\n\n記録できるのは前へ進む向きだけです（PENDING → DELIVERED → CONFIRMED）。未納品から検収への直行・検収の取消・未納品への差し戻しは 409（INVALID_DELIVERY_TRANSITION）です。取消・差し戻しは画面で行います。\n\n納品日・検収日は AnimaTime がリクエストを受け取った時刻で記録します。日付は指定できません（delivered_at などを送ると 400 DATE_NOT_ACCEPTED）。\n\n取消済みの発注の明細は 409（ORDER_CANCELLED）、月次締め済みの月に帰属する発注・締め済みの月に入る検収は 409（MONTH_CLOSED）です。\n\nすでに同じ状態の明細には何もせず、changed: false を返します。\n\n画面での納品・検収と同じく、明細が覆う工程の状態も合わせて更新します（process_sync に更新した工程の ID）。発注全体が検収済みになると order.confirmed イベントが飛びます（actor.type は api_key）。\n\n記録は監査ログに「API: キーの名前」として残ります。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。組織で請求・支払の機能が使えない場合は付けても返しません。金額は発行時に保存した値で、再計算しません。","security":[{"bearerAuth":[]}],"x-animatime-scope":"orders:write","x-animatime-feature":"orders","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"itemId","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"status":{"type":"string","enum":["DELIVERED","CONFIRMED"],"description":"DELIVERED=納品 / CONFIRMED=検収。前へ進む向きだけ"}},"required":["status"],"description":"日付は受け付けない（受信時刻で記録する）"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/OrderItem"},"order":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string"},"status":{"type":"string","enum":["ORDERED","DELIVERED","CONFIRMED","CANCELLED"]}},"description":"記録後の発注全体の状態"},"changed":{"type":"boolean","description":"false=すでに同じ状態だった（何もしていない）"},"process_sync":{"type":"object","additionalProperties":false,"properties":{"completed":{"type":"array","items":{"type":"string"},"description":"納品・検収に合わせて完了にした工程の ID"},"reverted":{"type":"array","items":{"type":"string"}}},"description":"画面での納品・検収と同じく工程の状態も合わせる"}}},"example":{"data":{"object":"order_item","id":"clxxx...","process_id":"clxxx...","cut_number":"C-001","description":null,"seconds":3.5,"sheets":12,"delivery_status":"CONFIRMED","delivered_at":"2026-11-18T09:00:00.000Z","confirmed_at":"2026-11-20T03:00:00.000Z","invoice_id":null,"worker_id":null},"order":{"id":"clxxx...","status":"CONFIRMED"},"changed":true,"process_sync":{"completed":["clxxx..."],"reverted":[]}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/invoices/{id}/links":{"post":{"summary":"受領請求書の消込先（紐付ける発注・明細）を、指定したものに置き換えます。","description":"Idempotency-Key ヘッダが必須です。\n\n今の紐付けは全部外れ、指定したものだけになります（省いた方の種類も空にします）。両方を空にすると紐付けを外します。\n\n未納品の発注・取消済みの発注・他の請求書に紐付いた発注は紐付けられません（400）。請求額と一致しないと 422（AMOUNT_MISMATCH）です。\n\n支払済の請求書は 409（INVOICE_PAID）、月次締め済みの月の請求書は 409（MONTH_CLOSED）です。","security":[{"bearerAuth":[]}],"x-animatime-scope":"invoices:write","x-animatime-feature":"billing","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"order_ids":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"発注ごとに紐付け（全置換）"},"order_item_ids":{"type":"array","items":{"type":"string"},"maxItems":200,"description":"明細ごとに紐付け（全置換）"}}}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/InvoiceDetail"}}},"example":{"data":{"object":"invoice","id":"clxxx...","…":"GET /api/v1/invoices/{id} と同じ項目","order_ids":["clxxx..."],"order_items":[]}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/order-approval-requests":{"post":{"summary":"発注の承認依頼を作成します。発注書の発行・取引先への送付は行いません（オーナー/管理者が画面で承認すると発行されます）。","description":"Idempotency-Key ヘッダが必須です。作成できたときは 201 です。\n\nAPI で作れるのは承認依頼までです。単価が基準単価どおりでも必ず承認待ちになり、オーナー/管理者が画面で承認すると、承認した人の名義で発注が発行されます（order_approval_request.approved と order.created のイベント）。取引先への送付も画面で行います。\n\n入力の検証は画面の発注作成と同じです。拒否の code は画面と同じ理由を大文字にしたものです: MISSING_FIELDS / INVALID_AMOUNT / FOREIGN_WORKER / EPISODE_NOT_FOUND（404）/ INVALID_MASTER_CATEGORY / INVALID_MASTER_PART / MASTER_AMOUNT_REQUIRED / ZERO_AMOUNT / INVALID_PROCESS / PROCESS_TYPE_MISMATCH / DUPLICATE_ORDER（409・すでに発注済みの工程）/ VENDOR_STAFF_NOT_FOUND（404）/ VENDOR_FREE_INPUT_DISABLED / INVALID_RECEIPT_PLACE / CHECK_PERIOD_EXCEEDS_PAYMENT_SITE。\n\n同じ話数・発注先・工程・パートのマスター発注の承認待ちがすでにあると 409（DUPLICATE_APPROVAL_REQUEST）です。\n\n明細の項目は process_id / cut_number / description / seconds / sheets / unit_price / notes / worker_id（実作業者のスタッフID）です。ほかに check_period_days / correction_period_days / due_time（HH:MM）/ master_part / notes / quality_standard / rights_handling / price_negotiation_note / cancellation_policy / receipt_place / is_provisional_amount / tax_included / withholding / withholding_is_individual を送れます（意味は画面の発注フォームと同じ）。\n\n依頼は監査ログに「API: キーの名前」として残り、承認できる人にアプリ内通知が届きます。\n\n金額（amounts）は amounts:read スコープを持つキーにだけ返します。組織で請求・支払の機能が使えない場合は付けても返しません。金額は発行時に保存した値で、再計算しません。","security":[{"bearerAuth":[]}],"x-animatime-scope":"orders:write","x-animatime-feature":"orders","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"episode_id":{"type":"string","description":"話数ID"},"vendor_id":{"type":["string","null"],"description":"取引先ID（vendor_name とどちらか必須）"},"vendor_name":{"type":["string","null"],"description":"名簿に無い発注先（組織で自由入力を許可しているときだけ）"},"process_type":{"type":"string","description":"工程（標準工程のキー、またはカスタム工程の名前）"},"custom_step_id":{"type":["string","null"],"description":"カスタム工程のとき、組織のワークフローの工程ID"},"order_kind":{"type":"string","enum":["CUT","MASTER"],"default":"CUT"},"master_part":{"type":["string","null"]},"due_date":{"type":["string","null"],"description":"ISO 8601 の日付（納品予定日）"},"due_time":{"type":["string","null"],"description":"HH:MM"},"check_period_days":{"type":["integer","null"]},"correction_period_days":{"type":["integer","null"]},"notes":{"type":["string","null"]},"quality_standard":{"type":["string","null"]},"rights_handling":{"type":["string","null"]},"price_negotiation_note":{"type":["string","null"]},"cancellation_policy":{"type":["string","null"]},"receipt_place":{"type":["string","null"]},"is_provisional_amount":{"type":"boolean"},"tax_included":{"type":"boolean"},"withholding":{"type":"boolean","description":"省くと取引先の名簿（個人事業主か）から決める"},"withholding_is_individual":{"type":"boolean","description":"名簿に無い発注先のときだけ使う"},"items":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","additionalProperties":false,"properties":{"process_id":{"type":["string","null"],"description":"工程ID（GET /api/v1/episodes/{id}/cuts）"},"cut_number":{"type":["string","null"]},"description":{"type":["string","null"]},"seconds":{"type":["number","null"]},"sheets":{"type":["number","null"]},"unit_price":{"type":["number","null"],"description":"単価（円）"},"notes":{"type":["string","null"]},"worker_id":{"type":["string","null"],"description":"実作業者のスタッフID"}}}}},"required":["episode_id","process_type","items"],"description":"発注の発行・送付はしない（人が承認してから発行される）"}}}},"responses":{"200":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/OrderApprovalRequest"}}},"example":{"data":{"object":"order_approval_request","id":"clxxx...","status":"PENDING","episode_id":"clxxx...","vendor":{"id":"clxxx...","name":"取引先名"},"process_type":"KEY_ANIMATION","order_kind":"CUT","master_part":null,"due_date":"2026-12-10","item_count":1,"price_deviations":[],"requested_by":{"type":"api_key","name":"API: 制作管理ツール"},"order_id":null,"reject_reason":null,"decided_at":null,"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"}}}}},"201":{"description":"Created（同じ Idempotency-Key の再送は 200）","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/OrderApprovalRequest"}}},"example":{"data":{"object":"order_approval_request","id":"clxxx...","status":"PENDING","episode_id":"clxxx...","vendor":{"id":"clxxx...","name":"取引先名"},"process_type":"KEY_ANIMATION","order_kind":"CUT","master_part":null,"due_date":"2026-12-10","item_count":1,"price_deviations":[],"requested_by":{"type":"api_key","name":"API: 制作管理ツール"},"order_id":null,"reject_reason":null,"decided_at":null,"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/order-approval-requests/{id}":{"get":{"summary":"発注の承認依頼1件を取得します（承認・却下の結果と、承認で発行された発注の ID）。","description":"status は PENDING（承認待ち）/ APPROVED（承認済み・order_id に発行された発注）/ REJECTED（却下・reject_reason に理由）です。\n\n画面で作られた承認申請（単価が基準単価から外れた発注）も取れます。その場合 requested_by.type は user で、名前は返しません。\n\nprice_deviations は基準単価から外れた明細（cut_number と direction: above / below）です。単価（standard_price / actual_price）と依頼額（amounts.total_amount）は amounts:read のキーにだけ返します。\n\nAPIキーの組織に属さない依頼は 404 になります。","security":[{"bearerAuth":[]}],"x-animatime-scope":"orders:read","x-animatime-feature":"orders","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/OrderApprovalRequest"}}},"example":{"data":{"object":"order_approval_request","id":"clxxx...","status":"APPROVED","…":"POST /api/v1/order-approval-requests の応答と同じ項目","order_id":"clxxx...","decided_at":"2026-11-05T05:00:00.000Z"}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/staff/{id}":{"patch":{"summary":"スタッフ名簿の1件を AnimaTime の ID で更新します。画面で登録した行に移行元の external_id を付けるときに使います。","description":"Idempotency-Key ヘッダが必須です。送った項目だけを変えます。値が今と同じ項目は書きません（すべて同じなら result: unchanged）。\n\nexternal_id: null で外部IDを外します。別の行が使っている external_id は付けられません（409 DUPLICATE_EXTERNAL_ID）。\n\n検証は POST /api/v1/staff と同じです（名前を空白にする更新は 400 NAME_REQUIRED）。\n\nactive: false で無効化、active: true で再有効化します（画面の無効化と同じ処理・下の POST /api/v1/staff の説明を参照）。このキー自身のスタッフは無効化できません（409 CANNOT_DEACTIVATE_API_KEY_STAFF）。\n\nAPIキーの組織に属さないスタッフは 404 になります。","security":[{"bearerAuth":[]}],"x-animatime-scope":"staff:write","x-animatime-feature":"staff","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":100,"description":"移行元のID（組織の中で一意）。null で外す"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"空白だけは不可"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company_name":{"type":["string","null"],"maxLength":120},"is_external":{"type":"boolean","description":"false=社内 / true=社外（作成時は必須）"},"contract_type":{"type":"string","enum":["EMPLOYMENT","SUBCONTRACT","UNSPECIFIED"]},"is_individual":{"type":"boolean","description":"true=個人 / false=法人"},"tax_status":{"type":"string","enum":["TAXABLE","EXEMPT","UNKNOWN"]},"invoice_registration_number":{"type":["string","null"],"description":"T＋数字13桁"},"specialties":{"type":"array","items":{"type":"string","enum":["絵コンテ","演出","原画","第二原画","レイアウト","作監","動画","彩色","仕上げ","背景","特効","3DCG","撮影","編集","制作進行","制作デスク"]}},"active":{"type":"boolean","description":"false=無効化 / true=再有効化（画面の無効化と同じ処理。作成時の既定は true）。送るには staff:deactivate スコープも要る"}},"description":"送った項目だけを変える"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/Staff"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"unchanged=送った値がすべて今の値と同じ（何も書いていない）"},"unassigned_process_count":{"type":"integer","description":"無効化に連動して担当を外した進行中の工程の数（画面の無効化と同じ）"}}},"example":{"data":{"object":"staff","id":"clxxx...","external_id":"EMP-0001","name":"山田太郎","company_name":null,"is_external":false,"contract_type":"EMPLOYMENT","is_individual":true,"tax_status":"UNKNOWN","invoice_registration_number":null,"specialties":["原画"],"login_linked":false,"active":true,"deactivated_at":null,"created_at":"2026-11-05T03:00:00.000Z","updated_at":"2026-11-05T03:00:00.000Z"},"result":"updated","unassigned_process_count":0}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/api/v1/staff/bulk":{"post":{"summary":"スタッフ名簿を external_id で一括登録・更新します（1回に最大100件）。","description":"Idempotency-Key ヘッダが必須です。1回に送れるのは1〜100件です（超えると 400）。約200名の名簿は2回に分けて送ります。応答の形は作品・話数・カットの一括と同じです。\n\n各行の項目と検証は POST /api/v1/staff と同じで、external_id は必須です（無いと EXTERNAL_ID_REQUIRED）。同じリクエストの中で external_id が重なると DUPLICATE_IN_REQUEST です。\n\n全行を検証してから1つのトランザクションで書きます。1行でも不正があると何も書かず、422（VALIDATION_FAILED）の errors に行ごとの理由（index・code・message・param）を返します。直して送り直すときは新しい Idempotency-Key を使います。\n\n同じ external_id で送り直すと更新になるので、途中で失敗しても最初から送り直せます。\n\n退職者は active: false の行として送ります（既存の行だけなら external_id と active だけで足ります）。無効化・再有効化の処理は POST /api/v1/staff と同じで、unassigned_process_count は担当を外した工程の合計です。このキー自身のスタッフを無効化する行は CANNOT_DEACTIVATE_API_KEY_STAFF で拒否します（何も書きません）。\n\nこの API はログインアカウントの作成・招待をしません（POST /api/v1/staff と同じ）。","security":[{"bearerAuth":[]}],"x-animatime-scope":"staff:write","x-animatime-feature":"staff","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"操作ごとに新しい値（8〜64文字の英数字・_・-）。同じ値の再送には24時間、最初の応答をそのまま返す","schema":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"items":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"object","additionalProperties":false,"properties":{"external_id":{"type":["string","null"],"minLength":1,"maxLength":100,"description":"移行元のID（組織の中で一意）。null で外す"},"name":{"type":"string","minLength":1,"maxLength":100,"description":"空白だけは不可"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"company_name":{"type":["string","null"],"maxLength":120},"is_external":{"type":"boolean","description":"false=社内 / true=社外（作成時は必須）"},"contract_type":{"type":"string","enum":["EMPLOYMENT","SUBCONTRACT","UNSPECIFIED"]},"is_individual":{"type":"boolean","description":"true=個人 / false=法人"},"tax_status":{"type":"string","enum":["TAXABLE","EXEMPT","UNKNOWN"]},"invoice_registration_number":{"type":["string","null"],"description":"T＋数字13桁"},"specialties":{"type":"array","items":{"type":"string","enum":["絵コンテ","演出","原画","第二原画","レイアウト","作監","動画","彩色","仕上げ","背景","特効","3DCG","撮影","編集","制作進行","制作デスク"]}},"active":{"type":"boolean","description":"false=無効化 / true=再有効化（画面の無効化と同じ処理。作成時の既定は true）。送るには staff:deactivate スコープも要る"}},"required":["external_id"]},"description":"各行は POST /api/v1/staff と同じ項目（external_id 必須）"}},"required":["items"],"description":"全部か無し（1件でも拒否があれば何も書かず 422）。最大 100 件"}}}},"responses":{"200":{"description":"OK","headers":{"X-RateLimit-Limit":{"$ref":"#/components/headers/X-RateLimit-Limit"},"X-RateLimit-Remaining":{"$ref":"#/components/headers/X-RateLimit-Remaining"},"X-RateLimit-Reset":{"$ref":"#/components/headers/X-RateLimit-Reset"}},"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"object":{"type":"string","const":"bulk_result"},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"unassigned_process_count":{"type":"integer","description":"無効化に連動して担当を外した進行中の工程の数（画面の無効化と同じ）"},"data":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"index":{"type":"integer"},"result":{"type":"string","enum":["created","updated","unchanged"],"description":"unchanged=送った値がすべて今の値と同じ（何も書いていない）"},"staff":{"$ref":"#/components/schemas/Staff"}}}}}},"example":{"object":"bulk_result","created":1,"updated":2,"unchanged":0,"unassigned_process_count":3,"data":[{"index":0,"result":"created","staff":{"object":"staff","id":"clxxx...","external_id":"EMP-0001","…":"POST /api/v1/staff と同じ項目"}},{"index":1,"result":"updated","staff":{"object":"staff","id":"clyyy...","external_id":"EXT-0042","…":"…"}},{"index":2,"result":"updated","staff":{"object":"staff","id":"clzzz...","external_id":"EMP-0007","active":false,"…":"…"}}]}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"422":{"$ref":"#/components/responses/BulkValidationError"},"429":{"$ref":"#/components/responses/RateLimited"}}}}}}