Create a widget
POST
/widgets
const url = 'https://api.example.com/v1/widgets';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"My first widget","description":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.example.com/v1/widgets \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "My first widget", "description": "example" }'Creates a new widget on the authenticated account.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ” Media type application/json
object
name
required
string
Example
My first widget description
string
Responses
Section titled “ Responses ”The newly created widget.
Media type application/json
object
id
required
string
name
required
string
description
string
created_at
required
string format: date-time
Example
{ "id": "wdg_01H8Z9XJ7M3K4P5Q6R7S8T9V0W", "name": "My first widget", "description": "Optional human-readable description."}The request was malformed.
Media type application/json
object
code
required
string
message
required
string
request_id
string
Example
{ "code": "invalid_request", "message": "The `name` field is required.", "request_id": "req_01H8Z9XJ7M3K4P5Q6R7S8T9V0W"}Authentication failed or was not provided.
Media type application/json
object
code
required
string
message
required
string
request_id
string
Example
{ "code": "invalid_request", "message": "The `name` field is required.", "request_id": "req_01H8Z9XJ7M3K4P5Q6R7S8T9V0W"}Maintained by EkLine