本文へ移動
Bounty Developer

PUT/api/me/portfolio

「自分」の分類の、送った内容で対象を保存する(更新する)API。ログインした本人として呼ぶ。

要約

自分のポートフォリオを丸ごと置き換える(expectedUpdatedAt が違えば 409 conflict と最新の current)

呼び方と印

ログイン

送るもの(本文)application/json

送る本文の欄。「必須」の印がある欄は省けない。

  • items必須array<object>
    件数 ≤12
  • id必須string
    /^[a-zA-Z0-9_-]{1,48}$/
  • kind必須enum(7)
    • "video"
    • "image"
    • "project"
    • "article"
    • "achievement"
    • "event"
    • "link"
  • title必須string
    長さ 1–100
  • description任意string
    長さ ≤300
  • url必須"" | string
  • coverUrl任意"" | string | string
  • role任意string
    長さ ≤60
  • year任意integer
    1950–2100
  • tags任意array<string>
    件数 ≤5
  • media任意object
  • kind必須"image" | "video"
  • url必須string
    長さ ≤2048
  • posterUrl任意string
    長さ ≤2048
  • durationSec任意number
    ≤16
  • width任意integer
    1–100000
  • height任意integer
    1–100000
  • entryType任意"work" | "lightning_talk"
  • format任意enum(14)
    • "video"
    • "animation"
    • "photography"
    • "image"
    • "graphic"
    • "audio"
    • "music"
    • "writing"
    • "product"
    • "software"
    • "game"
    • "hardware"
    • …+2
  • tools任意array<string>
    件数 ≤10
  • technicalDetails任意record<array<string>>
  • technicalNote任意string
    長さ ≤200
  • attachment任意object
  • kind必須"pdf"
  • url必須string
    長さ ≤2048
  • expectedUpdatedAt必須string(date-time) | null

返るもの(応答)200 · application/json

成功したときに返る形。入れ子の欄は、その行を押すと開く・閉じる。「任意」の印がある欄は返らないことがある。

  • stateenum(5)"ready" "link_required" "deleted" "unavailable" "off"
  • items任意array<object>
    • idstring
    • kindenum(7)"video" "image" "project" "article" "achievement" "event" "link"
    • titlestring
    • descriptionstring
    • urlstring
    • coverUrlstring
    • role任意string
    • year任意integer
    • tags任意array<string>
    • media任意object
      • kind"image" | "video"
      • urlstring
      • posterUrl任意string
      • durationSec任意number
      • width任意integer
      • height任意integer
    • entryType任意"work" | "lightning_talk"
    • format任意enum(14)"video" "animation" "photography" "image" "graphic" "audio" "music" "writing" "product" "software" "game" "hardware" …+2
    • tools任意array<string>
    • technicalDetails任意record<array<string>>
    • technicalNote任意string
    • attachment任意object
      • kind"pdf"
      • urlstring
  • updatedAt任意string | null
  • publicUrl任意string | null
  • reason任意"not_linked" | "link_requires_spikes_login" | "account_conflict"
  • spikesUrl任意string
  • legacyCountinteger
  • fixture任意boolean
  • adultDeclared任意boolean

失敗したとき(エラー)

失敗したときの状態コードと、その意味。本文の error の値で、プログラムが失敗の種類を見分けられる。

  • 400入力の誤り(error = invalid_input など)
  • 401未ログイン(unauthorized)/ Bearer が無効(invalid_token。WWW-Authenticate 付き)
  • 403権限が無い
  • conflict
  • items_dropped
  • media_out_of_scope
  • link_requires_spikes_login
  • account_conflict
  • not_linked
  • deleted
  • portfolio_unavailable
  • portfolio_not_configured

呼び出しの見本

そのまま試せる呼び出しの例。curl と fetch をタブで切り替える。ID やトークンは自分の値に置き換える。

curl -X PUT "https://bounty.spikes.4s.link/api/me/portfolio" \
  -H "Authorization: Bearer $BEARER_AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "items": [],
    "expectedUpdatedAt": "2026-11-01T10:00:00+09:00"
  }'
PUT /api/me/portfolio | Bounty Developer