Deepbits Platform: Create a project
This API endpoint (POST /project) allows users to create a new project on the Deepbits platform.
Users provide a project name (name) and an optional project description (description) in the request body. Authentication requires an API key (x-api-key header).
Upon successful creation, the API returns a JSON response (200 OK) containing the project details under the data field, including the project ID (_id).
Below is a demo script demonstrating how to create a project on the Deepbits Platform. Adjust the placeholders , , and with your specific values for integration.
import requests
API_KEY = '<Your API key generated from app.deepbits.com>'
API_BASE = 'https://api.deepbits.com/api/v1'
PROJECT_NAME = '<Your project name>'
PROJECT_DESCRIPTION = '<Your project description>'
def main():
response = create_project(PROJECT_NAME, PROJECT_DESCRIPTION)
print('Created Project ID:', response.get('_id', None))
def create_project(project_name, project_description=''):
url = f"{API_BASE}/project"
headers = {
"accept": "application/json",
"x-api-key": API_KEY
}
payload = {
'name': project_name,
'description': project_description,
}
response = requests.post(url, headers=headers, json=payload)
if response.status_code == 200:
response_data = response.json()
if response_data.get('meta', {}).get('code') == 200:
return response_data.get('data')
else:
response.raise_for_status()
print(response.text)
return None
if __name__ == "__main__":
main()
Updated 5 months ago