Uploads

Stage a media upload

Changed on

Stages a media file - the native event image, or a custom file/image form-schema field. Send the file as multipart/form-data (field file); the API validates its real type and size, stores it, and returns a short-lived ref. Then attach ref on an event write - image: { ref } or a custom field under additionalFields as { ref, name? } (name being the download filename) - so the media lands in the same write as the rest of the edit.

The type is detected from the file content, or from the filename extension for signature-less formats such as CSV; a type outside the platform's allowed set (images, PDF and common office documents) answers 422 with the code file.invalidType. The file is capped at 20 MiB (422 with the code file.tooBig past it). This is a coarse gate: the precise types a given field accepts are enforced on the event write, against the agenda's form schema.

A request without a file answers 422 with the code required on file; a file sent in another part, or a second file, answers 422 with the code file.unexpected on that part. A multipart body that cannot be read (cut short, without a boundary, a text part over 1 MiB) answers 400.

post/agendas/{agendaUid}/uploads

Request

  • Base URL: https://api.openagenda.com/v3
  • URL: https://api.openagenda.com/v3/agendas/{agendaUid}/uploads
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://openagenda.com/api/auth/oauth2/authorize, token URL https://openagenda.com/api/auth/oauth2/token, scopes: media:write)

Path parameters

agendaUidinteger required

Numeric uid of the agenda.

Response

The staging reference to attach on an event write.

refstring required

The staging reference to attach on an event write.

expiresAtstring date-time required

The staged upload is attachable at least until this instant (ISO 8601); attaching it later may answer 422.

Changes

    • info

      the security scope media:write was added to the endpoint's security scheme oauth2

    • info

      the security scope events:write was removed from the endpoint's security scheme oauth2

    • info

      added the optional property /// to the response with the status

    • info

      added the optional property /////// to the response with the status

    • warning

      removed the optional property /// from the response with the status

    • warning

      removed the optional property /////// from the response with the status

    • info

      the security scope events:write was added to the endpoint's security scheme oauth2

    • info

      the security scope media:write was removed from the endpoint's security scheme oauth2