Skip to content

Register a direct upload

POST
/rails/active_storage/direct_uploads
curl --request POST \
--url https://your-board.mudda.today/rails/active_storage/direct_uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "blob": { "filename": "screenshot.png", "byte_size": 12345, "checksum": "GQ5SqLsM7ylnji0Wgd9wNC==", "content_type": "image/png" } }'

Registers a blob and answers with where to PUT its bytes. Send the file there with exactly the direct_upload.headers given, then use the blob’s signed_id as a user’s avatar, or its attachable_sgid in an <action-text-attachment sgid="…"> in rich text. Answers JSON whatever the path’s format. Not subject to the token’s request allowance.

Scope: write.

Media typeapplication/json
object
blob
required
object
filename
required
string
byte_size
required

The file’s size in bytes.

integer
checksum
required

The file’s MD5 digest, Base64-encoded.

string
content_type
required
string
metadata
object
key
additional properties
any

Example

{
"blob": {
"filename": "screenshot.png",
"byte_size": 12345,
"checksum": "GQ5SqLsM7ylnji0Wgd9wNC==",
"content_type": "image/png"
}
}

The blob, and where to upload its bytes.

Media typeapplication/json
object
id
required
integer
key
required
string
filename
required
string
content_type
required
string
metadata
object
key
additional properties
any
service_name
string
byte_size
required
integer
checksum
required
string
created_at
required
string format: date-time
signed_id
required

What avatar takes.

string
attachable_sgid
required

What a rich-text attachment’s sgid takes.

string
direct_upload
required
object
url
required

PUT the file’s bytes here.

string format: uri
headers
required

Send exactly these with the PUT.

object
key
additional properties
string

Example

{
"id": 9,
"key": "5tl09q813hmri5z2ui4zzrdj8gqi",
"filename": "screenshot.png",
"content_type": "image/png",
"metadata": {},
"service_name": "local",
"byte_size": 12345,
"checksum": "GQ5SqLsM7ylnji0Wgd9wNC==",
"created_at": "2026-10-16T14:02:11Z",
"signed_id": "eyJfcmFpbHMiOnsiZGF0YSI6OSwicHVyIjoiYmxvYl9pZCJ9fQ==--d724…",
"attachable_sgid": "eyJfcmFpbHMiOnsiZGF0YSI6ImdpZDovL211ZGRh…",
"direct_upload": {
"url": "https://your-board.mudda.today/rails/active_storage/disk/eyJfcmFpbHMiOnsiZGF0YSI6eyJrZXkiOiI1dGwwOXE4--08c33a68f1982870d7d1",
"headers": {
"Content-Type": "image/png"
}
}
}

No credential, or a revoked or expired token.

Media typeapplication/json

Every failure’s envelope. request_id matches the X-Request-Id header.

object
errors
required

Messages keyed by field; base when no field is to blame.

object
key
additional properties
Array<string>
request_id
string

Example

{
"errors": {
"base": [
"Unauthorized"
]
},
"request_id": "5f0c1e9a-2b7d-4c1e-9a63-0e4f8d2b1c55"
}

The user is deactivated, the record isn’t yours to change, or the token lacks the scope.

Media typeapplication/json

Every failure’s envelope. request_id matches the X-Request-Id header.

object
errors
required

Messages keyed by field; base when no field is to blame.

object
key
additional properties
Array<string>
request_id
string

Example

{
"errors": {
"base": [
"This token is not granted the write scope"
]
},
"request_id": "5f0c1e9a-2b7d-4c1e-9a63-0e4f8d2b1c55"
}

Validation failed, a query parameter isn’t recognised, or a filter value is outside its list.

Media typeapplication/json

Every failure’s envelope. request_id matches the X-Request-Id header.

object
errors
required

Messages keyed by field; base when no field is to blame.

object
key
additional properties
Array<string>
request_id
string

Example

{
"errors": {
"due_on": [
"can't be blank in Todo or Doing"
]
},
"request_id": "5f0c1e9a-2b7d-4c1e-9a63-0e4f8d2b1c55"
}