Browse Files Media

stable · api · 0.1.0

Upload bytes with a single-use grant

PUT /api/v1/file-uploads/{uploadToken}

Capability Domain: Files Media

Authentication

No authentication required

Scope: None

Parameters and request body

  • uploadToken — path, required
    uploadToken schema
    {
        "type": "string",
        "pattern": "^[a-f0-9]{64}$"
    }

Request schema

application/octet-stream

application/octet-stream request schema
{
    "type": "string",
    "format": "binary"
}

text/plain

text/plain request schema
{
    "type": "string",
    "format": "binary"
}

image/jpeg

image/jpeg request schema
{
    "type": "string",
    "format": "binary"
}

image/gif

image/gif request schema
{
    "type": "string",
    "format": "binary"
}

image/png

image/png request schema
{
    "type": "string",
    "format": "binary"
}

application/pdf

application/pdf request schema
{
    "type": "string",
    "format": "binary"
}

application/octet-stream request example

application/octet-stream request example
"<binary bytes matching the declared SHA-256>"

Responses and errors

StatusDescription
200Uploaded quarantined File Object
422Request violates the public contract

200 schema

200 response schema
{
    "type": "object",
    "required": [
        "data"
    ],
    "properties": {
        "data": {
            "type": "object",
            "required": [
                "file_object_id"
            ],
            "properties": {
                "file_object_id": {
                    "type": "string",
                    "format": "uuid"
                }
            }
        }
    }
}

422 schema

422 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

200 example

200 response example
{
    "data": {
        "file_object_id": "50000000-0000-4000-8000-000000000005"
    }
}

Idempotency

The upload token is single-use; obtain a new grant after an uncertain upload.