Storage API

Storage API

조직의 파일 스토리지를 관리합니다. Presigned URL로 파일을 업로드하고, 조회하고, 삭제할 수 있습니다.

GET/organizations/:orgId/storages

조직의 모든 스토리지를 조회합니다.

응답
{
  "storages": [
    {
      "id": "stor_abc123",
      "name": "My Storage",
      "status": "active",
      "createdAt": "2026-03-20T...",
      "updatedAt": "2026-03-20T..."
    }
  ]
}
GET/organizations/:orgId/storages/:storageId/files

스토리지의 파일 목록을 조회합니다. limit 쿼리 파라미터(1-200, 기본 50)와 cursor로 페이지네이션합니다.

응답
{
  "files": [
    {
      "id": "f1234567-abcd-...",
      "name": "photo.png",
      "path": "photo.png",
      "mime": "image/png",
      "size": 102400,
      "status": "active",
      "error": null,
      "createdAt": "2026-03-20T...",
      "updatedAt": "2026-03-20T..."
    }
  ],
  "nextCursor": null
}
POST/organizations/:orgId/storages/:storageId/files

파일 항목을 만들고 업로드용 presigned URL을 받습니다. 반환된 URL로 1시간 안에 파일을 업로드하세요.

Request body
{
  "files": [
    { "name": "photo.png", "mime": "image/png" },
    { "name": "data.json", "mime": "application/json" }
  ]
}
응답
{
  "files": [
    {
      "id": "f1234567-abcd-...",
      "name": "photo.png",
      "path": "photo.png",
      "mime": "image/png",
      "size": 0,
      "status": "pending",
      "error": null,
      "createdAt": "2026-03-20T...",
      "updatedAt": "2026-03-20T...",
      "url": "https://upload.justdeploy.net/..." // Presigned upload URL
    }
  ]
}

presigned URL로 zip 파일을 업로드하세요:

업로드
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/png" \
  --data-binary @photo.png
GET/organizations/:orgId/storages/:storageId/files/:fileId

파일 메타데이터와 서명된 다운로드 URL을 조회합니다. URL은 1시간 후 만료됩니다.

응답
{
  "file": {
    "id": "f1234567-abcd-...",
    "name": "photo.png",
    "path": "photo.png",
    "mime": "image/png",
    "size": 102400,
    "status": "active",
    "error": null,
    "createdAt": "2026-03-20T...",
    "updatedAt": "2026-03-20T...",
    "url": "https://cdn.justdeploy.net/..." // Signed download URL
  }
}
DELETE/organizations/:orgId/storages/:storageId/files/:fileId

스토리지에서 파일을 삭제합니다.