---
title: إنشاء رفع ملف | RunAPI
description: رفع ملف محلي واحد أو عنوان HTTPS بعيد أو مصدر base64 واستلام عنوان URL
  مؤقت.
url: https://runapi.ai/ar/docs/api/files/create.md
canonical: https://runapi.ai/ar/docs/api/files/create
locale: ar
---

> نسخة HTML: https://runapi.ai/ar/docs/api/files/create
> فهرس الموقع للوكلاء: https://runapi.ai/llms.txt

# إنشاء رفع ملف

رفع ملف محلي واحد أو عنوان HTTPS بعيد أو مصدر base64 واستلام عنوان URL مؤقت.

## نقطة النهاية

POST /api/v1/files

عنوان URL الأساسي: https://runapi.ai

إصدار API: v1

المصادقة: Authorization: Bearer YOUR_API_KEY

## الطلب

أرسل القيم فقط في موقع الطلب المُدرج.

### application/json - Base64 source

```json
{
  "file_name": {
    "description": "اسم ملف اختياري لرفع الملف المُنشأ.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "بايتات المصدر مُرمَّزة بـ Base64.",
    "properties": {
      "data": {
        "description": "بيانات Base64",
        "required": true,
        "type": "string"
      },
      "type": {
        "description": "يحدد تمثيل المصدر بترميز base64.",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### application/json - URL source

```json
{
  "file_name": {
    "description": "اسم ملف اختياري لرفع الملف المُنشأ.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "المصدر البعيد عبر HTTPS للتنزيل.",
    "properties": {
      "type": {
        "description": "يحدد تمثيل مصدر URL.",
        "required": true,
        "type": "string"
      },
      "url": {
        "description": "عنوان URL عام عبر HTTPS للتنزيل.",
        "format": "uri",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### multipart/form-data

```json
{
  "file": {
    "description": "بايتات الملف المحلي للرفع.",
    "format": "binary",
    "required": true,
    "type": "string"
  },
  "file_name": {
    "description": "اسم ملف اختياري لرفع الملف المُنشأ.",
    "required": false,
    "type": "string"
  }
}
```

## استجابة النجاح

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"
}
```

## استجابة الخطأ (401)

HTTP 401

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Authentication required"
}
```

## استجابة الخطأ (403)

HTTP 403

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Standard API key required"
}
```

## استجابة الخطأ (400)

HTTP 400

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Only HTTPS URLs are allowed"
}
```

## استجابة الخطأ (408)

HTTP 408

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Download timeout"
}
```

## استجابة الخطأ (413)

HTTP 413

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "File size exceeds the maximum allowed size"
}
```

## استجابة الخطأ (415)

HTTP 415

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "This content type is not supported"
}
```

## استجابة الخطأ (422)

HTTP 422

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "File upload failed. Please try again."
}
```

## استجابة الخطأ (429)

HTTP 429

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

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

## مثال cURL



### curl

```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"}'
```

## المرجع ذو الصلة

- [الملفات](https://runapi.ai/ar/docs/api/files.md)
- [كائن رفع الملف](https://runapi.ai/ar/docs/api/files/object.md)

---

## المزيد من RunAPI

- [الرئيسية](https://runapi.ai/ar/.md)
- [كتالوج النماذج](https://runapi.ai/ar/models.md)
- [الأسعار](https://runapi.ai/ar/pricing.md)
- [مزودو الخدمة](https://runapi.ai/ar/models)
- [التوثيق](https://runapi.ai/ar/docs/guides)
- [حزم SDK](https://runapi.ai/ar/sdk.md)
- [CLI](https://runapi.ai/ar/cli.md)
- [خادم MCP](https://runapi.ai/ar/mcp.md)
- [Claude Code مقابل Cursor](https://runapi.ai/ar/claude-code-vs-cursor.md)
- [إعداد Cursor API](https://runapi.ai/ar/cursor-api-setup.md)
- [RunAPI مقابل OpenRouter](https://runapi.ai/ar/openrouter-alternative.md)
- [المؤسسات](https://runapi.ai/ar/contact.md)
- [اتصل بنا](https://runapi.ai/ar/contact.md)
- [الشروط](https://runapi.ai/ar/terms.md)
- [الخصوصية](https://runapi.ai/ar/privacy.md)
- [فهرس الموقع للوكلاء](https://runapi.ai/llms.txt)

التواصل: contact@runapi.ai

## البيانات المنظمة

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/ar",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/ar/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/ar",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/aricon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "TechArticle",
    "headline": "إنشاء رفع ملف",
    "description": "رفع ملف محلي واحد أو عنوان HTTPS بعيد أو مصدر base64 واستلام عنوان URL مؤقت.",
    "url": "https://runapi.ai/ar/docs/api/files/create",
    "mainEntityOfPage": "https://runapi.ai/ar/docs/api/files/create"
  }
]
```
