Set a channel photo

POST https://z.u1v.ru/api/v1/streams/{stream_id}/avatar

Requires channel administration and metadata access. Upload exactly one image within max_avatar_file_size_mib; validates, strips metadata, crops to a square and resizes to 256px. Replaces the existing photo, increments its revision and sends a stream update with property avatar.

Usage example

Use your organization URL and API key; replace the example channel ID 10. Check channel_avatar_api_version: 1 in the register response before calling.

curl --fail-with-body -X POST https://z.u1v.ru/api/v1/streams/10/avatar \
    -u EMAIL_ADDRESS:API_KEY -F file=@channel-photo.png

Parameters

stream_id integer required in path

Example: 1

The ID of the channel to access.


file

Required image file. Send exactly one file in the file field of a multipart/form-data request, within max_avatar_file_size_mib.

Response

HTTP 200: Photo saved.

Return values

  • avatar: object | null

    Channel photo metadata, or null when no photo is set.

    • url: string

      Authenticated realm-relative image URL with revision query.

    • version: integer

      Current photo revision used in the URL query.