Forward API リファレンス。
Description
Uploads file content and creates a File.
パス
POST /api/v1/forward/files
リクエストヘッダー
| ヘッダー | 必須 | 説明 |
|---|---|---|
Authorization | はい | Bearer <PAT または SAT> |
Idempotency-Key | いいえ | 作成リクエスト用の任意の冪等性キーです。同じキーは同一リクエストにのみ再利用できます。省略した場合、ローカルの冪等リプレイ保護は提供されません。 |
Content-Type | はい | multipart/form-data |
Form フィールド
| フィールド | 型 | 必須 | 説明 |
|---|---|---|---|
file | file | Yes | File content to upload. See Supported upload file types. |
name | string | いいえ | 表示ファイル名。既定値は multipart のファイル名です。正規化後の長さは 1〜255 バイトである必要があります。 |
metadata | JSON string | No | Metadata object. created_by is reserved and must not be supplied (supplying it returns 400). |
リクエスト例
レスポンス例
HTTP 201 Created
レスポンスフィールド
| フィールド | 型 | 説明 |
|---|---|---|
id | string | File ID。 |
type | string | 固定値 file。 |
filename | string | ファイル名。 |
size_bytes | integer | バイト単位のファイルサイズ。 |
mime_type | string | MIME タイプ。 |
created_at | string | RFC 3339 形式の作成日時。 |
updated_at | string | RFC 3339 形式の最終更新日時。 |
downloadable | boolean | File をダウンロードできるかどうか。 |
scope | object/null | Resource scope associated with the File, such as a Session. |
metadata | object | File メタデータ。 |
identity_id | string/null | Forward の所有 Identity。 |
エラー
| HTTP | Type | 発生条件 |
|---|---|---|
| 400 | invalid_request_error | The request body, path parameters, query parameters, or multipart fields are invalid. |
| 400 | invalid_request_error | The file type is unsupported. See Supported upload file types. |
| 400 | invalid_request_error | If the reserved key created_by is supplied, message is metadata key "created_by" is reserved, identifying the invalid field. |
| 401 | authentication_error | 認証トークンがないか、無効です。 |
| 403 | permission_error | 呼び出し元にはこのリソースへのアクセス権限がありません。 |
| 409 | conflict_error | リソース状態、参照関係、または冪等性キーが競合しています。 |
| 429 | rate_limit_error | アップロード容量が不足しています。 |
| 500/502/503 | api_error | Forward または依存サービスでエラーが発生しました。 |