Create Project
POST
/v2/projects
Create a new project by sending a POST request to the Qubitro API.
project.ts
import type { NextApiRequest, NextApiResponse } from 'next';
export default async function handler(
req: NextApiRequest,
res: NextApiResponse<any>
) {
const requestBody = {
name: "string",
description: "string"
};
const result = await fetch('https://api.qubitro.com/v2/projects', {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <API_KEY>'
},
method: "POST",
body: JSON.stringify(requestBody)
});
const data = await result.json();
res.status(200).json(data);
}
Request Body Parameters
Option | Type | Description |
---|---|---|
name | string | The name of the project. |
description | string | A brief description of the project. |
Response
On success, the API will return a JSON object with the following structure:
{
"success": true,
"action": "create project",
"status": 201,
"message": "Project created successfully.",
"data": {
"id": "string",
"name": "string",
"description": "string",
"created_at": "2024-01-08T17:20:48.95875597Z"
}
}
Response codes
Option | Type | Description |
---|---|---|
200 | OK | The request was successful. |
400 | Bad Request | The request could not be understood or was missing required parameters. |
401 | Unauthorized | Authentication failed or was not provided. |
403 | Forbidden | Authentication succeeded, but the authenticated user does not have access to the requested resource. |
404 | Not Found | The requested resource could not be found. |
500 | Internal Server Error | An error occurred on the server. |
Start building today
Collect, process, and activate device data. Scale from one device to thousands.