İçeriğe geç
API Referansı
API Referansı

Bir Dosya Yüklemesi Oluştur

Tek bir yerel dosyayı, uzak HTTPS URL'sini veya base64 kaynağını yükleyin ve geçici bir URL alın.

Tek bir yerel dosyayı, uzak HTTPS URL’sini veya base64 kaynağını yükleyin ve geçici bir URL alın.

Uç Nokta

POST /api/v1/files
Temel URL
https://runapi.ai
API sürümü
v1
Kimlik doğrulama
Authorization: Bearer YOUR_API_KEY
02

İstek

JSON gövdesi

Değerleri yalnızca listelenen istek konumunda gönderin.

application/json - Base64 source4 alan
file_namestring
İsteğe bağlı

Oluşturulan Dosya Yüklemesi için isteğe bağlı dosya adı.

sourceobject
Zorunlu

Base64 kodlu kaynak baytları.

source.datastring
Zorunlu

Base64 verisi

source.typestring
Zorunlu

base64 kaynak gösterimini seçer.

application/json - URL source4 alan
file_namestring
İsteğe bağlı

Oluşturulan Dosya Yüklemesi için isteğe bağlı dosya adı.

sourceobject
Zorunlu

İndirilecek uzak HTTPS kaynağı.

source.typestring
Zorunlu

URL kaynak gösterimini seçer.

source.urlstring
Zorunlu

İndirilecek genel HTTPS URL'si.

multipart/form-data2 alan
filestring
Zorunlu

Yüklenecek yerel dosya baytları.

file_namestring
İsteğe bağlı

Oluşturulan Dosya Yüklemesi için isteğe bağlı dosya adı.

03

Başarılı yanıt

HTTP 201

POST /api/v1/files

JSON
{
  "created_at": "2026-07-27T10:00:00.000Z",
  "expires_at": "2026-07-27T11:00:00.000Z",
  "file_name": "mask.png",
  "mime_type": "image/png",
  "size_bytes": 204800,
  "url": "https://file.runapi.ai/temp/user-uploads/mask.png"
}
04

Hata yanıtı (401)

HTTP 401
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Authentication required"
}
05

Hata yanıtı (403)

HTTP 403
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Standard API key required"
}
06

Hata yanıtı (400)

HTTP 400
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Only HTTPS URLs are allowed"
}
07

Hata yanıtı (408)

HTTP 408
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Download timeout"
}
08

Hata yanıtı (413)

HTTP 413
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "File size exceeds the maximum allowed size"
}
09

Hata yanıtı (415)

HTTP 415
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "This content type is not supported"
}
10

Hata yanıtı (422)

HTTP 422
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "File upload failed. Please try again."
}
11

Hata yanıtı (429)

HTTP 429
Yanıt şeması
JSON
{
  "properties": {
    "error": {
      "description": "İnsan tarafından okunabilir hata mesajı.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}

Yanıt örneği

JSON
{
  "error": "Too many file uploads for this account. Please retry later."
}
12

cURL örneği

CURL
curl -X POST https://runapi.ai/api/v1/files \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"source":{"type":"url","url":"https://cdn.runapi.ai/public/samples/mask.png"},"file_name":"mask.png"}'