For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
CommunityCreate AccountSign in
  • Overview
    • Welcome
    • Authentication
    • Using Environments
  • API Reference
      • GETList files
      • POSTUpload a file
      • GETGet a file
      • DELDelete a file
      • PATCHUpdate a file
      • GETDownload a file
      • POSTClone a file
      • POSTDetect header
LogoLogo
LogoLogo
CommunityCreate AccountSign in
API ReferenceFiles

Upload a file

POST
https://api.x.flatfile.com/v1/files
POST
/v1/files
$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" \
> -F spaceId="string" \
> -F environmentId="string" \
> -F file=@<filename1>
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 "description": "string",
15 "mode": "import",
16 "expiredAt": "2023-01-01T00:00:00Z",
17 "workbookId": "string",
18 "sheetId": "string",
19 "actions": [
20 {
21 "label": "string",
22 "confirm": true,
23 "constraints": [
24 {
25 "type": "hasAllValid",
26 "ignoreSelection": true
27 }
28 ],
29 "createdFrom": "string",
30 "deletedAt": "2023-01-01T00:00:00Z",
31 "description": "string",
32 "guardrail": {
33 "content": "string"
34 },
35 "guide": {
36 "content": "string"
37 },
38 "icon": "string",
39 "inputForm": {
40 "type": "simple",
41 "fields": [
42 {
43 "key": "string",
44 "label": "string",
45 "type": "string",
46 "description": "string",
47 "defaultValue": {},
48 "config": {
49 "options": [
50 {
51 "value": {},
52 "label": "string",
53 "description": "string",
54 "color": "string",
55 "icon": "string",
56 "meta": {
57 "string": {}
58 }
59 }
60 ]
61 },
62 "constraints": [
63 {
64 "type": "required"
65 }
66 ]
67 }
68 ]
69 },
70 "invalidConditionalMessaging": true,
71 "invalidRecordsMessage": "string",
72 "lastPropagatedAt": "2023-01-01T00:00:00Z",
73 "messages": [
74 {
75 "type": "error",
76 "content": "string"
77 }
78 ],
79 "mode": "foreground",
80 "mount": {
81 "type": "sheet",
82 "slugs": [
83 "string"
84 ]
85 },
86 "operation": "string",
87 "primary": true,
88 "schedule": "weekly",
89 "tooltip": "string",
90 "type": "string",
91 "validRecordsMessage": "string",
92 "requireAllValid": true,
93 "requireSelection": true,
94 "slug": "string"
95 }
96 ],
97 "origin": "filesystem",
98 "treatments": [
99 "IS_BASIC_FILE_SHAPE"
100 ]
101 }
102}
Was this page helpful?
Previous

Get a file

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Headers

X-Disable-Hooks"true"Required

Request

This endpoint expects a multipart form containing a file.
spaceIdstringRequired
Space ID
environmentIdstringRequired
Environment ID
modeenumOptional
The storage mode of file to insert, defaults to "import"
Allowed values:
filefileRequired
A binary payload containing the file contents
actionslist of objectsOptional
The actions attached to the file
originenumOptional
The origin of the file, ie filesystem
Allowed values:

Response

This endpoint returns an object.
dataobject
Any uploaded file of any type

Errors

400
Bad Request Error