Main Content

Write Image

Write channel image with HTTP POST


HTTP Method



URL Parameters



(Required) Channel ID for the image channel to write to.

<filename>(Optional) Name of the image file.
<timestamp>(Optional) Timestamp provided by the client.



The body of the POST is the image data. The means of specifying the file depends on the utility.


The following headers are required for an image POST request.

Key NameValue

(Required) image/jpeg


(Required) The API Key for this specific image channel. The Write API Key is found in the API Keys column of the image channels table.



HTTP Status Code

202 OK

JSON Response

The response is a JSON object of the new entry, for example:

    "requestID": "cmnog8kdd00224cmc4cz0dnwo",
    "code": 0,
    "status": "PENDING",
    "message": null


For the full list, see Error Codes.


  • You must have a paid licence to create an image channel.

  • The only supported image format is JPEG/JPG.

  • Images are limited in size to 5 MB. Those slightly larger are automatically scaled down. Significantly larger images are rejected.

  • All timestamps must be unique within a channel. You cannot write a new image using a timestamp that matches the timestamp of an existing image in the channel.


expand all

The following code operates in a Linux® shell. Change the channel ID, API Key, and filename as appropriate.

curl --location --request POST "" \
--header "Content-Type: image/jpeg" \
--header "thingspeak-image-channel-api-key: M3I17NS05QKZ6Q5D" \
--data-binary "./MyImage44.jpg"

The raw response is:


You can use Postman to try out your HTTP requests using the RESTful API for ThingSpeak. This example shows how to write data to a channel using Postman.

  1. In Postman, select POST from the drop-down list of HTTP verbs.

  2. Enter<channel_id>/images in the address field, replacing <channel_id> with the ID of the channel you are writing the image to.

  3. Under the Headers tab, enter the following parameter keys:

    • Content-type with the value image/jpeg.

    • thingspeak-image-channel-api-key with the value from your image channel API Key, which is available in the ThingSpeak™ Channels > My Image Channels listing.

    Postman image post headers

  4. Under the Body tab select binary, then click Select File to browse for the image file with the file explorer.

    Postman image post body

  5. Click Send to POST your image. The response is a JSON object with request ID, code, and status; and a 202 Accepted from the server.

    Postman image post response