Skip to content

Upload an image into an active destination draft.

POST
/api/workspace/markdown/drafts/upload
curl --request POST \
--url https://example.com/api/workspace/markdown/drafts/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'X-Moltaro-Markdown-Draft-Session: example' \
--header 'X-Moltaro-Markdown-File-Size: 1' \
--header 'X-Moltaro-Markdown-Scope: example' \
--form File=@file
access_token
string

Optional access token for clients that cannot set Authorization headers. Prefer Authorization: Bearer <token> when possible.

X-Moltaro-Markdown-Draft-Session
required
string

Id of the active Markdown attachment draft that receives the image.

X-Moltaro-Markdown-Scope
required
string

ScopeToken of the draft’s destination scope, issued by POST /api/workspace/markdown/scope/issue or renewed by POST /api/workspace/markdown/scope/refresh. Moltaro issues no scope whose header line (name, “: “, token and line end) would exceed 7,168 bytes, so it passes proxies that accept 8 KiB request header lines; send the token unchanged.

X-Moltaro-Markdown-File-Size
required
integer format: int64
>= 1 <= 104857600

Exact byte length of the image in the File part; an upload of another length is refused.

Exactly one file part named File, with a file name, and no other form values. The request is at most 104923136 bytes.

Media typemultipart/form-data
object
File
required
string format: binary

OK

Media typeapplication/json
object
Data

One file reference owned by a Markdown attachment draft.

object
FileReferenceId
string
nullable
Origin
integer format: int32
Allowed values: 0 1
State
integer format: int32
Allowed values: 0 1 2 3
FileName
string
nullable
SizeBytes
integer format: int64
AvailabilityState
integer format: int32
Allowed values: 0 1 2 3 4
DetectedMimeType
string
nullable
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Origin": 0,
"State": 0,
"AvailabilityState": 0
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Bad Request

Media typeapplication/json
object
Data

One file reference owned by a Markdown attachment draft.

object
FileReferenceId
string
nullable
Origin
integer format: int32
Allowed values: 0 1
State
integer format: int32
Allowed values: 0 1 2 3
FileName
string
nullable
SizeBytes
integer format: int64
AvailabilityState
integer format: int32
Allowed values: 0 1 2 3 4
DetectedMimeType
string
nullable
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Origin": 0,
"State": 0,
"AvailabilityState": 0
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Forbidden

Media typeapplication/json
object
type
string
nullable
title
string
nullable
status
integer format: int32
nullable
detail
string
nullable
instance
string
nullable
key
additional properties
Examplegenerated
{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example"
}

Not Found

Media typeapplication/json
object
Data

One file reference owned by a Markdown attachment draft.

object
FileReferenceId
string
nullable
Origin
integer format: int32
Allowed values: 0 1
State
integer format: int32
Allowed values: 0 1 2 3
FileName
string
nullable
SizeBytes
integer format: int64
AvailabilityState
integer format: int32
Allowed values: 0 1 2 3 4
DetectedMimeType
string
nullable
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Origin": 0,
"State": 0,
"AvailabilityState": 0
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}

Too Many Requests

Media typeapplication/json
object
Data

One file reference owned by a Markdown attachment draft.

object
FileReferenceId
string
nullable
Origin
integer format: int32
Allowed values: 0 1
State
integer format: int32
Allowed values: 0 1 2 3
FileName
string
nullable
SizeBytes
integer format: int64
AvailabilityState
integer format: int32
Allowed values: 0 1 2 3 4
DetectedMimeType
string
nullable
Errors
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Warnings
Array<object>
nullable
object
Code
required
string
nullable
Message
required
string
nullable
Target
string
nullable
Field
string
nullable
Metadata
object
key
additional properties
string
nullable
Type
integer format: int32
Allowed values: 0 1 2
Severity
integer format: int32
Allowed values: 0 1 2
Success
boolean
Example
{
"Data": {
"Origin": 0,
"State": 0,
"AvailabilityState": 0
},
"Errors": [
{
"Type": 0,
"Severity": 0
}
],
"Warnings": [
{
"Type": 0,
"Severity": 0
}
]
}