Create an App
POST /v3/apps
Request
Route
POST /v3/apps
Body
Name |
Description |
Default |
Valid Values |
Example Values |
name
|
Name of the App
|
|
|
|
space_guid
|
GUID of associated Space
|
|
|
|
environment_variables
|
Environment variables to be used for the App when running
|
|
|
|
buildpack
|
Default buildpack to use when staging the application packages.
Note: a null value will use autodetection
|
|
- null
- buildpack name
- git url
|
- ruby_buildpack
- https://github.com/cloudfoundry/ruby-buildpack
|
{
"name": "my_app",
"space_guid": "ffa06a35-5ae8-4ed6-be44-c581849960d2",
"environment_variables": {
"open": "source"
},
"buildpack": "name-2055"
}
Headers
cURL
curl "https://api.[your-domain.com]/v3/apps" -d '{
"name": "my_app",
"space_guid": "ffa06a35-5ae8-4ed6-be44-c581849960d2",
"environment_variables": {
"open": "source"
},
"buildpack": "name-2055"
}' -X POST \
-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM2MCIsImVtYWlsIjoiZW1haWwtMjUwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzk0MjYyMTJ9.VpjMqDGbKwUf-LT7UE6Dr8BdwM6OMIpu3hos0X0Fmmo" \
-H "Host: example.org" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Cookie: "
Response
Status
201 Created
Body
{
"guid": "8d1f60c3-d4fa-4751-8327-d6e68a98bb28",
"name": "my_app",
"desired_state": "STOPPED",
"total_desired_instances": 0,
"buildpack": "name-2055",
"created_at": "2015-08-06T00:36:52Z",
"updated_at": null,
"environment_variables": {
"open": "source"
},
"_links": {
"self": {
"href": "/v3/apps/8d1f60c3-d4fa-4751-8327-d6e68a98bb28"
},
"space": {
"href": "/v2/spaces/ffa06a35-5ae8-4ed6-be44-c581849960d2"
},
"processes": {
"href": "/v3/apps/8d1f60c3-d4fa-4751-8327-d6e68a98bb28/processes"
},
"routes": {
"href": "/v3/apps/8d1f60c3-d4fa-4751-8327-d6e68a98bb28/routes"
},
"packages": {
"href": "/v3/apps/8d1f60c3-d4fa-4751-8327-d6e68a98bb28/packages"
},
"droplets": {
"href": "/v3/apps/8d1f60c3-d4fa-4751-8327-d6e68a98bb28/droplets"
},
"start": {
"href": "/v3/apps/8d1f60c3-d4fa-4751-8327-d6e68a98bb28/start",
"method": "PUT"
},
"stop": {
"href": "/v3/apps/8d1f60c3-d4fa-4751-8327-d6e68a98bb28/stop",
"method": "PUT"
},
"assign_current_droplet": {
"href": "/v3/apps/8d1f60c3-d4fa-4751-8327-d6e68a98bb28/current_droplet",
"method": "PUT"
}
}
}
Headers