Manage Projects
EventBunker has support for multi projects under one account. This enables you to leverage your single EventBunker account under one billing for many of your separate projects as a serial entrepreneur.
Using management api, you can create project, reset project master key and delete projects. You can of course use web ui to do all of these actions by clicking buttons, however for big scale usage of EventBunker, it is convenient to call api to manage projects and api keys.
You will use your account master key for project management apis, please copy the key from Account page
Let's review api methods now;
Create Project
Mandatory and optional fields are used in create request;
Field Name | Type | Required | Description |
---|---|---|---|
account_id | String | Yes | Your account id |
name | String | Yes | Name of the project |
description | String | Optional | A descrition of project |
Endpoint;
POST https://api.eventbunker.io/v1/manage/project/create
Example Request;
Please copy your account id and master api key from web ui and replace with placeholders in example code below. Copy and run the sample code below in your terminal window.
curl --request POST 'https://api.eventbunker.io/v1/manage/project/create' \
--header 'x-eventbunker-apikey: <YOUR-ACCOUNT-MASTER-API-KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"account_id": "<YOUR-ACCOUNT-ID>",
"name": "your project name",
"description": "your project description",
}'
Example Response;
Response will be a JSON contaning your new project's id and master api key. Project master api key is used for Managing Api Keys
{
"account_id": "your account id",
"project_id": "your project's id",
"master_api_key": "your project's master key",
"status": "ACTIVE"
}
That's it! Congratulations, you have created your first project. You can implement this request in any language since it is just a http post request to EventBunker api endpoint.
List Projects
Mandatory and optional fields are used in list project request;
Field Name | Type | Required | Description |
---|---|---|---|
account_id | String | Yes | Your account id |
Endpoint;
POST https://api.eventbunker.io/v1/manage/project/list
Example Request;
Please copy your account id and master api key from web ui and replace with placeholders in example code below. Copy and run the sample code below in your terminal window.
curl --request POST 'https://api.eventbunker.io/v1/manage/project/list' \
--header 'x-eventbunker-apikey: <YOUR-ACCOUNT-MASTER-API-KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"account_id": "<YOUR-ACCOUNT-ID>"
}'
Example Response;
Response will be a JSON contaning list of your active project ids. You can use project id to reset project master key in the request below.
{
"account_id": "your account id",
"project_ids": ["project1's id", "project2's id"]
}
You can use a project id in the response list to reset project's master key in the request below.
Reset Project Master Key
Sometimes you might need to reset your project's master key, without deleting your project. Mandatory and optional fields are used in this request;
Field Name | Type | Required | Description |
---|---|---|---|
account_id | String | Yes | Your account id |
project_id | String | Yes | Your project id |
Endpoint;
POST https://api.eventbunker.io/v1/manage/project/reset-key
Example Request;
Please copy your account master api key from web ui and replace with placeholders in example code below. Copy and run the sample code below in your terminal window.
curl --request POST 'https://api.eventbunker.io/v1/manage/project/reset-key' \
--header 'x-eventbunker-apikey: <YOUR-ACCOUNT-MASTER-API-KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"account_id": "<YOUR-ACCOUNT-ID>",
"project_id": "<YOUR-PROJECT-ID>"
}'
Example Response;
Response will be a JSON contaning your new project master api key. Project master api key is used for Managing Api Keys
{
"project_id": "your project's id",
"master_api_key": "your project's NEW master key"
}
You will get an error if this project is not active or project does not exist. Master api key change will be effective immediately.
Delete Project
If you no longer need this project, you can de-activate your project via this api. Your project will be visible in web ui with DELETED
status for tracebility.
After calling delete api, you can not modify this project and project's api keys anymore.
All api-keys connected to this project will also be de-activated in an hour by EventBunker backend.
Mandatory and optional fields are used in this request;
Field Name | Type | Required | Description |
---|---|---|---|
account_id | String | Yes | Your account id |
project_id | String | Yes | Your project id to delete |
Endpoint;
POST https://api.eventbunker.io/v1/manage/project/delete
Example Request;
Please copy your account master api key from web ui and replace with placeholders in example code below. Copy and run the sample code below in your terminal window.
curl --request POST 'https://api.eventbunker.io/v1/manage/project/delete' \
--header 'x-eventbunker-apikey: <YOUR-ACCOUNT-MASTER-API-KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"project_id": "<YOUR-PROJECT-ID>"
}'
Example Response;
Response will be a JSON confirming your project status.
{
"account_id": "your account id",
"project_id": "your project id",
"status": "DELETED"
}
You will get an error if this project is not active or project does not exist. Master api key will not work immediately. All api-keys connected to this project will also be de-activated in an hour by EventBunker backend.
Error Codes
For successful cases api returns HTTP 200
Also for each api response, you are given a reference id in eventbunker_api_reference
field, you can use this reference if contact us for support so we can check exact logs.
For all api methods in project management you can possibly get the following errors with HTTP 400
error code.
- Invalid x-eventbunker-apikey or account_id
- Invalid x-eventbunker-apikey or account_id or project_id
- Project Name is a mandatory field
- Can not modify inactive account
- Can not modify inactive project
- Can not modify deleted project
- Internal Error caused by ... (something happened, you can contact us with request json and
eventbunker_api_reference
in the error message from api) - Invalid request, given; ... error= ... (Generic error when you forgot something mandatory)
- Too Many Requests (if you exceed rate limit, which is very high)