---
title: Een bestandsupload aanmaken | RunAPI
description: Upload één lokaal bestand, externe HTTPS-URL of base64-bron en ontvang
  een tijdelijke URL.
url: https://runapi.ai/nl/docs/api/files/create.md
canonical: https://runapi.ai/nl/docs/api/files/create
locale: nl
---

> HTML-versie: https://runapi.ai/nl/docs/api/files/create
> Site-index voor agents: https://runapi.ai/llms.txt

# Een bestandsupload aanmaken

Upload één lokaal bestand, externe HTTPS-URL of base64-bron en ontvang een tijdelijke URL.

## Eindpunt

POST /api/v1/files

Basis-URL: https://runapi.ai

API-versie: v1

Authenticatie: Authorization: Bearer YOUR_API_KEY

## Verzoek

Stuur waarden alleen op de vermelde verzoeklocatie.

### application/json - Base64 source

```json
{
  "file_name": {
    "description": "Optionele bestandsnaam voor de aangemaakte bestandsupload.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "Met Base64 gecodeerde bronbytes.",
    "properties": {
      "data": {
        "description": "Base64-gegevens",
        "required": true,
        "type": "string"
      },
      "type": {
        "description": "Selecteert de base64-bronrepresentatie.",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### application/json - URL source

```json
{
  "file_name": {
    "description": "Optionele bestandsnaam voor de aangemaakte bestandsupload.",
    "required": false,
    "type": "string"
  },
  "source": {
    "description": "Externe HTTPS-bron om te downloaden.",
    "properties": {
      "type": {
        "description": "Selecteert de URL-bronrepresentatie.",
        "required": true,
        "type": "string"
      },
      "url": {
        "description": "Publieke HTTPS-URL om te downloaden.",
        "format": "uri",
        "required": true,
        "type": "string"
      }
    },
    "required": true,
    "type": "object"
  }
}
```

### multipart/form-data

```json
{
  "file": {
    "description": "Te uploaden lokale bestandsbytes.",
    "format": "binary",
    "required": true,
    "type": "string"
  },
  "file_name": {
    "description": "Optionele bestandsnaam voor de aangemaakte bestandsupload.",
    "required": false,
    "type": "string"
  }
}
```

## Succesvol antwoord

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

## Foutrespons (401)

HTTP 401

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

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

## Foutrespons (403)

HTTP 403

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

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

## Foutrespons (400)

HTTP 400

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

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

## Foutrespons (408)

HTTP 408

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

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

## Foutrespons (413)

HTTP 413

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

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

## Foutrespons (415)

HTTP 415

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

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

## Foutrespons (422)

HTTP 422

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

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

## Foutrespons (429)

HTTP 429

### Responsschema

```json
{
  "properties": {
    "error": {
      "description": "Leesbare foutmelding.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### Responsvoorbeeld

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

## cURL-voorbeeld



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

## Gerelateerde referentie

- [Bestanden](https://runapi.ai/nl/docs/api/files.md)
- [Bestandsuploadobject](https://runapi.ai/nl/docs/api/files/object.md)

---

## Meer van RunAPI

- [Home](https://runapi.ai/nl/.md)
- [Modelcatalogus](https://runapi.ai/nl/models.md)
- [Prijzen](https://runapi.ai/nl/pricing.md)
- [Providers](https://runapi.ai/nl/models)
- [Documentatie](https://runapi.ai/nl/docs/guides)
- [SDK's](https://runapi.ai/nl/sdk.md)
- [CLI](https://runapi.ai/nl/cli.md)
- [MCP Server](https://runapi.ai/nl/mcp.md)
- [Claude Code vs Cursor](https://runapi.ai/nl/claude-code-vs-cursor.md)
- [Cursor API instellen](https://runapi.ai/nl/cursor-api-setup.md)
- [RunAPI vs OpenRouter](https://runapi.ai/nl/openrouter-alternative.md)
- [Enterprise](https://runapi.ai/nl/contact.md)
- [Contact](https://runapi.ai/nl/contact.md)
- [Voorwaarden](https://runapi.ai/nl/terms.md)
- [Privacy](https://runapi.ai/nl/privacy.md)
- [Site-index voor agents](https://runapi.ai/llms.txt)

Contact: contact@runapi.ai

## Gestructureerde gegevens

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/nl",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/nl/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/nl",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/nlicon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "nl",
    "@type": "TechArticle",
    "headline": "Een bestandsupload aanmaken",
    "description": "Upload één lokaal bestand, externe HTTPS-URL of base64-bron en ontvang een tijdelijke URL.",
    "url": "https://runapi.ai/nl/docs/api/files/create",
    "mainEntityOfPage": "https://runapi.ai/nl/docs/api/files/create"
  }
]
```
