Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

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": "af869585-b0d8-403d-ad21-ce6fdbede1c8",
  "environment_variables": {
    "open": "source"
  },
  "buildpack": "name-2502"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NCIsImVtYWlsIjoiZW1haWwtMzMyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NTV9.V9hnZoTHjcaTJWhfBR1Ol2MM74iGpDhFi-9FbCvm7J4
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps" -d '{
  "name": "my_app",
  "space_guid": "af869585-b0d8-403d-ad21-ce6fdbede1c8",
  "environment_variables": {
    "open": "source"
  },
  "buildpack": "name-2502"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQ2NCIsImVtYWlsIjoiZW1haWwtMzMyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NTV9.V9hnZoTHjcaTJWhfBR1Ol2MM74iGpDhFi-9FbCvm7J4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "4b21d7d8-3c4d-4ad6-935a-c4280cd5def7",
  "name": "my_app",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "name-2502",
  "created_at": "2015-09-11T18:39:14Z",
  "updated_at": null,
  "environment_variables": {
    "open": "source"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/4b21d7d8-3c4d-4ad6-935a-c4280cd5def7"
    },
    "space": {
      "href": "/v2/spaces/af869585-b0d8-403d-ad21-ce6fdbede1c8"
    },
    "processes": {
      "href": "/v3/apps/4b21d7d8-3c4d-4ad6-935a-c4280cd5def7/processes"
    },
    "routes": {
      "href": "/v3/apps/4b21d7d8-3c4d-4ad6-935a-c4280cd5def7/routes"
    },
    "packages": {
      "href": "/v3/apps/4b21d7d8-3c4d-4ad6-935a-c4280cd5def7/packages"
    },
    "droplets": {
      "href": "/v3/apps/4b21d7d8-3c4d-4ad6-935a-c4280cd5def7/droplets"
    },
    "start": {
      "href": "/v3/apps/4b21d7d8-3c4d-4ad6-935a-c4280cd5def7/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/4b21d7d8-3c4d-4ad6-935a-c4280cd5def7/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/4b21d7d8-3c4d-4ad6-935a-c4280cd5def7/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 613b761a-e459-43fe-b8bb-86a4c5248fd7
Content-Length: 1212
X-Content-Type-Options: nosniff