Main Content

Create Channel

Create new channel with HTTP POST

Request

HTTP Method

POST

URL

https://api.thingspeak.com/channels.<format>

URL Parameters

NameDescription

<format>

(Required) Format for the HTTP response, specified as json or xml.

Example: https://api.thingspeak.com/channels.json

Body Parameters

NameDescriptionValue Type
api_key

(Required) Specify User API Key, which you can find in your profile. This key is different from the channel API keys.

string

description

(Optional) Specify an ID or name for the client making the request.

string

field1

(Optional) Field 1 name.

string

fieldX

(Optional) Field X name, where X is the field ID.

string

latitude

(Optional) Latitude in degrees.

decimal

longitude

(Optional) Longitude in degrees.

decimal

metadata

(Optional) Metadata for the channel, which can include JSON, XML, or any other data.

string

name

(Optional) Name of the channel.

string

public_flag

(Optional) Whether the channel is public. The default is false.

true or false

tags(Optional) Comma-separated list of tags.any
url(Optional) Web page URL for the channel.string

Content-Type

application/x-www-form-urlencoded

Response

Success

HTTP Status Code

200 OK

Body

 JSON Example

 XML Example

Error

For the full list, see Error Codes.

Examples

expand all

You can use POSTMAN to try out your HTTP requests using the RESTful API for ThingSpeak. This example shows how to create a new channel using POSTMAN.

Create a channel titled "My Channel" with three named fields: "Stuff", "Things", and "Data". Make the channel shared with everyone by setting the public_flag to true. Here is the format of the request.

POST https://api.thingspeak.com/channels.json
    api_key=XXXXXXXXXXXXXXXX
    name=My Channel
    public_flag=true
    field1=Stuff
    field=Things
    field3=Data

  1. In POSTMAN, select POST from the drop-down list of HTTP verbs, and enter https://api.thingspeak.com/channels.json in the address bar.

  2. Enter the parameter api_key and your User API Key, which is found in Account > My Profile.

  3. Enter the additional parameters and values:

    • public_flag, Value: true

    • field1, Value: Stuff

    • field2, Value: Things

    • field3, Value: Data

The response is in JSON format. Note the server response value of 200 OK, indicating successful creation of the channel.

The new channel is now available on your channels page.