Bunnyshell API

post
Authentication

https://api.bunnyshell.com/v1/auth
This endpoint allows you obtain the authentication token for future requests.
Request
Response
Request
Headers
Content-Type
optional
string
application/json
Body Parameters
access_key
required
string
The API User Access Key
secret_key
required
string
The API User Secret Key
Response
200: OK
Authentication successful.
{ "token": "<TOKEN>"}
401: Unauthorized
Authentication failed.
{
"code": 401,
"message": "Invalid credentials."
}

Curl Syntax

curl -X POST https://api.bunnyshell.com/v1/auth \
-H "Content-Type: application/json" \
--data '{"access_key":"<my_access_key>","secret_key":"<my_secret_key>"}'

get
Get All Servers

https://api.bunnyshell.com/v1/servers
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authorization
required
string
Bearer $TOKEN
Response
200: OK
Returned a list of created jobs for each environment associated with the application
[
{
"id": <server id>,
"name": <server name>,
"cloud": ["Azure"|"Digital Ocean"|...],
"application_ids": [...]
},
...
]

Curl Syntax

curl -X GET https://api.bunnyshell.com/servers \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN"

get
Get Server

https://api.bunnyshell.com/v1/servers/:serverId
Request
Response
Request
Path Parameters
serverId
required
number
Server Id
Headers
Content-Type
required
string
application/json
Authorization
required
string
Bearer $TOKEN
Response
200: OK
Returned a list of created jobs for each environment associated with the application
[
{
"id": <server id>,
"name": <server name>,
"cloud": ["Azure"|"Digital Ocean"|...],
"application_ids": [...]
}
]

Curl Syntax

curl -X GET https://api.bunnyshell.com/v1/<serverId> \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN"

get
Get All Applications

https://api.bunnyshell.com/v1/applications
Get job status after an Application Deployment
Request
Response
Request
Headers
Authorization
required
string
Bearer $TOKEN
Content-Type
required
string
application/json
Response
200: OK
Get job status
[
{
"id": <application id>,
"name": <applicatin name>,
"deploy_type": ["none"|"git"|"upload_file"],
"application_type": ["Custom"|"Wordpress"...],
"deploy_point": <application deploy point>,
"server_ids": [...]
},
...
]

Curl Syntax

curl -X GET https://api.bunnyshell.com/v1/applications \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN"

get
Get Application

https://api.bunnyshell.com/v1/applications/:applicationId
Ge Application Info
Request
Response
Request
Path Parameters
applicationId
optional
number
Application Id
Headers
Authorization
required
string
Bearer $TOKEN
Content-Type
required
string
application/json
Response
200: OK
Get job status
[
{
"id": <application id>,
"name": <applicatin name>,
"deploy_type": ["none"|"git"|"upload_file"],
"application_type": ["Custom"|"Wordpress"...],
"deploy_point": <application deploy point>,
"server_ids": [...]
}
]

Curl Syntax

curl -X GET https://api.bunnyshell.com/v1/applications/<applicationId> \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN"

post
Deploy Application

https://api.bunnyshell.com/v1/applications/:applicationId/deploy
Start Application Deployment
Request
Response
Request
Path Parameters
applicationId
required
number
Application Id
Headers
Content-Type
required
string
application/json
Authorization
required
string
Bearer $TOKEN
Response
200: OK
Returned a list of created jobs for each environment associated with the application
{
"error": null,
"jobs": [
{
"id": <job_id>,
"server_id": <server_id>,
"application_id": <application_id>
},
...
]
}
401: Unauthorized
Access denied
{
"code": 401,
"message": "Expired JWT Token"
}
403: Forbidden
{
"error": {
"message": "Not all servers are ready to deploy",
"code": 1002,
"details": {
"servers": [
{
"id": <server_id>,
"name": "<server_name>",
"reason": "The server is not ready for operations. Current status: In Progress"
},
...
]
}
}
}

Curl Syntax

curl -X POST https://api.bunnyshell.com/v1/applications/<applicationId>/deploy \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN"

get
Get All Jobs

https://api.bunnyshell.com/v1/jobs
Get all existing jobs
Request
Response
Request
Headers
Content-Type
required
string
application/json
Authorization
required
string
Bearer $TOKEN
Response
200: OK
Returned a list of created jobs for each environment associated with the application
{
{
"id": <job id>,
"created": <job created date>,
"type": <job type>,
"status": <job status>,
"messages": <job message>,
"server_id": <job server id>,
"application_id": <job server id| null>
}
...
}

Curl Syntax

curl -X POST https://api.bunnyshell.com/v1/jobs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN"

get
Get Job

https://api.bunnyshell.com/v1/jobs/:jobId
Get all existing jobs
Request
Response
Request
Path Parameters
jobId
required
number
Job Id
Headers
Content-Type
required
string
application/json
Authorization
required
string
Bearer $TOKEN
Response
200: OK
Returned a list of created jobs for each environment associated with the application
{
"id": <job id>,
"created": <job created date>,
"type": <job type>,
"status": <job status>,
"messages": <job message>,
"server_id": <job server id>,
"application_id": <job server id| null>
}

Curl Syntax

curl -X POST https://api.bunnyshell.com/v1/jobs/<jobId> \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN"

get
Get Job Logs

https://api.bunnyshell.com/v1/jobs/:jobId/logs
Get all existing jobs
Request
Response
Request
Path Parameters
jobId
required
number
Job Id
Headers
Content-Type
required
string
application/json
Authorization
required
string
Bearer $TOKEN
Response
200: OK
Returned a list of created jobs for each environment associated with the application
"logs": {
"deployer": [
... logs ...
],
"<instance ip>": [
... logs ...
]
...
}

Curl Syntax

curl -X POST https://api.bunnyshell.com/v1/jobs/<jobId>/logs \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN"