Files
Upload File
Documents
Common Guides
API Reference
- Files
- Folders
- Drives
Files
Upload File
POST
/
unified
/
documents
/
files
/
upload
curl --request POST \
--url https://api.stackone.com/unified/documents/files/upload \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'x-account-id: <x-account-id>' \
--data '{
"name": "weather-forecast",
"file_format": {
"value": "pdf",
"source_value": "abc"
},
"content": "VGhpcyBpc24ndCByZWFsbHkgYSBzYW1wbGUgZmlsZSwgYnV0IG5vIG9uZSB3aWxsIGV2ZXIga25vdyE",
"category_id": "6530",
"path": "/path/to/file",
"category": {
"value": "reports, resumes",
"source_value": "550e8400-e29b-41d4-a716-446655440000, CUSTOM_CATEGORY_NAME"
},
"confidential": {
"value": "true",
"source_value": "public"
}
}'
{
"statusCode": 201,
"message": "Employee created successfully",
"timestamp": "2021-01-01T01:01:01.000Z",
"provider_errors": [
{
"status": 400,
"url": "https://api.someprovider.com/v1/endpoint",
"raw": {
"error": "Bad Request",
"message": "The supplied data is invalid"
},
"headers": {
"date": "Tue, 02 Apr 2024 13:52:01 GMT",
"content-type": "application/json; charset=utf-8",
"transfer-encoding": "chunked",
"connection": "close"
}
}
],
"unified_warnings": [
{
"message": "The provided field type is not supported in the current model."
}
]
}
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Headers
The account identifier
The session token
Body
application/json
Response
201
application/json
The file was uploaded.
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://api.stackone.com/unified/documents/files/upload \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'x-account-id: <x-account-id>' \
--data '{
"name": "weather-forecast",
"file_format": {
"value": "pdf",
"source_value": "abc"
},
"content": "VGhpcyBpc24ndCByZWFsbHkgYSBzYW1wbGUgZmlsZSwgYnV0IG5vIG9uZSB3aWxsIGV2ZXIga25vdyE",
"category_id": "6530",
"path": "/path/to/file",
"category": {
"value": "reports, resumes",
"source_value": "550e8400-e29b-41d4-a716-446655440000, CUSTOM_CATEGORY_NAME"
},
"confidential": {
"value": "true",
"source_value": "public"
}
}'
{
"statusCode": 201,
"message": "Employee created successfully",
"timestamp": "2021-01-01T01:01:01.000Z",
"provider_errors": [
{
"status": 400,
"url": "https://api.someprovider.com/v1/endpoint",
"raw": {
"error": "Bad Request",
"message": "The supplied data is invalid"
},
"headers": {
"date": "Tue, 02 Apr 2024 13:52:01 GMT",
"content-type": "application/json; charset=utf-8",
"transfer-encoding": "chunked",
"connection": "close"
}
}
],
"unified_warnings": [
{
"message": "The provided field type is not supported in the current model."
}
]
}