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": "31627bdc-5bc4-4c4d-a883-c7b2f53db249",
  "environment_variables": {
    "open": "source"
  },
  "buildpack": "name-410"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1NCIsImVtYWlsIjoiZW1haWwtMTA4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE3OTV9.nlr1gnyyYbmgsRWUnC0VQiA0_z6AFx1KWvVik4QXckc
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": "31627bdc-5bc4-4c4d-a883-c7b2f53db249",
  "environment_variables": {
    "open": "source"
  },
  "buildpack": "name-410"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE1NCIsImVtYWlsIjoiZW1haWwtMTA4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE3OTV9.nlr1gnyyYbmgsRWUnC0VQiA0_z6AFx1KWvVik4QXckc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "8b51db6f-7bae-47ca-bc75-74bc957ed460",
  "name": "my_app",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "name-410",
  "created_at": "2015-07-27T22:43:15Z",
  "updated_at": null,
  "environment_variables": {
    "open": "source"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/8b51db6f-7bae-47ca-bc75-74bc957ed460"
    },
    "processes": {
      "href": "/v3/apps/8b51db6f-7bae-47ca-bc75-74bc957ed460/processes"
    },
    "packages": {
      "href": "/v3/apps/8b51db6f-7bae-47ca-bc75-74bc957ed460/packages"
    },
    "space": {
      "href": "/v2/spaces/31627bdc-5bc4-4c4d-a883-c7b2f53db249"
    },
    "start": {
      "href": "/v3/apps/8b51db6f-7bae-47ca-bc75-74bc957ed460/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/8b51db6f-7bae-47ca-bc75-74bc957ed460/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/8b51db6f-7bae-47ca-bc75-74bc957ed460/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 03b88630-3aaa-4f2f-ba35-a4807bb21545
Content-Length: 1023
X-Content-Type-Options: nosniff