Files

Upload a file

POST

Request

This endpoint expects a multipart form containing a file.
spaceIdstringRequired
Space ID
environmentIdstringRequired
Environment ID
modeenumOptional
filefile
actionslist of objectsOptional
originenumOptional

Response

This endpoint returns an object
data
object
Any uploaded file of any type

Errors

POST
$curl -X POST https://api.x.flatfile.com/v1/files \
> -H "X-Disable-Hooks: true" \
> -H "Authorization: Bearer <token>" \
> -H "Content-Type: multipart/form-data" \
> -d '{
> "spaceId": "string",
> "environmentId": "string"
>}'
Response
1{
2 "data": {
3 "id": "string",
4 "name": "string",
5 "ext": "string",
6 "mimetype": "string",
7 "encoding": "string",
8 "status": "partial",
9 "size": 0,
10 "bytesReceived": 0,
11 "createdAt": "2023-01-01T00:00:00Z",
12 "updatedAt": "2023-01-01T00:00:00Z",
13 "spaceId": "string",
14 "mode": "import",
15 "expiredAt": "2023-01-01T00:00:00Z",
16 "workbookId": "string",
17 "sheetId": "string",
18 "actions": [
19 {
20 "label": "string",
21 "operation": "string",
22 "mode": "foreground",
23 "tooltip": "string",
24 "messages": [
25 {
26 "type": "error",
27 "content": "string"
28 }
29 ],
30 "type": "string",
31 "description": "string",
32 "schedule": "weekly",
33 "primary": true,
34 "confirm": true,
35 "icon": "string",
36 "inputForm": {
37 "type": "simple",
38 "fields": [
39 {
40 "key": "string",
41 "label": "string",
42 "type": "string",
43 "description": "string",
44 "defaultValue": {},
45 "config": {
46 "options": [
47 {
48 "value": {},
49 "label": "string",
50 "description": "string",
51 "color": "string",
52 "icon": "string",
53 "meta": {
54 "string": {}
55 }
56 }
57 ]
58 },
59 "constraints": [
60 {
61 "type": "required"
62 }
63 ]
64 }
65 ]
66 },
67 "constraints": [
68 {
69 "type": "hasAllValid"
70 }
71 ],
72 "slug": "string",
73 "requireAllValid": true,
74 "requireSelection": true
75 }
76 ],
77 "origin": "filesystem"
78 }
79}