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": "25fe21b8-8de2-40d0-93b0-c819101d1a11",
  "environment_variables": {
    "open": "source"
  },
  "buildpack": "name-244"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTc4IiwiZW1haWwiOiJlbWFpbC00OUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM2ODI5Nzc2fQ.1h-vD49PFj8Ff6YpIsp01pLBjbMcwZv3DGmL46-DPWg
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": "25fe21b8-8de2-40d0-93b0-c819101d1a11",
  "environment_variables": {
    "open": "source"
  },
  "buildpack": "name-244"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTc4IiwiZW1haWwiOiJlbWFpbC00OUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIucmVhZCIsImNsb3VkX2NvbnRyb2xsZXIud3JpdGUiXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM2ODI5Nzc2fQ.1h-vD49PFj8Ff6YpIsp01pLBjbMcwZv3DGmL46-DPWg" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "4c6483a5-c795-4133-9fa9-d7edd0294812",
  "name": "my_app",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "name-244",
  "created_at": "2015-07-06T23:22:56Z",
  "updated_at": null,
  "environment_variables": {
    "open": "source"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/4c6483a5-c795-4133-9fa9-d7edd0294812"
    },
    "processes": {
      "href": "/v3/apps/4c6483a5-c795-4133-9fa9-d7edd0294812/processes"
    },
    "packages": {
      "href": "/v3/apps/4c6483a5-c795-4133-9fa9-d7edd0294812/packages"
    },
    "space": {
      "href": "/v2/spaces/25fe21b8-8de2-40d0-93b0-c819101d1a11"
    },
    "start": {
      "href": "/v3/apps/4c6483a5-c795-4133-9fa9-d7edd0294812/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/4c6483a5-c795-4133-9fa9-d7edd0294812/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/4c6483a5-c795-4133-9fa9-d7edd0294812/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: dbba26b0-6552-4d7b-b39e-cf031a16d5ac
Content-Length: 1023
X-Content-Type-Options: nosniff