Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Create an App

POST /v3/apps

Request

Route

POST /v3/apps

Parameters

Name Description 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

Body

Name Description Default Valid Values Example Values
{
  "name": "my_app",
  "space_guid": "fe03a4a5-5bd3-41a2-ade2-ba075c46b939",
  "environment_variables": {
    "open": "source"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OSIsImVtYWlsIjoiZW1haWwtMTY2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzM5ODExMTF9.-YFgGbLgQNnvgMB1gZBWYsE11blolKcC555iPN2h_1k
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": "fe03a4a5-5bd3-41a2-ade2-ba075c46b939",
  "environment_variables": {
    "open": "source"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OSIsImVtYWlsIjoiZW1haWwtMTY2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzM5ODExMTF9.-YFgGbLgQNnvgMB1gZBWYsE11blolKcC555iPN2h_1k" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "d5b7e921-4f2b-40b7-ad82-e0f14dcfa7f3",
  "name": "my_app",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-06-04T00:05:11Z",
  "updated_at": null,
  "environment_variables": {
    "open": "source"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/d5b7e921-4f2b-40b7-ad82-e0f14dcfa7f3"
    },
    "processes": {
      "href": "/v3/apps/d5b7e921-4f2b-40b7-ad82-e0f14dcfa7f3/processes"
    },
    "packages": {
      "href": "/v3/apps/d5b7e921-4f2b-40b7-ad82-e0f14dcfa7f3/packages"
    },
    "space": {
      "href": "/v2/spaces/fe03a4a5-5bd3-41a2-ade2-ba075c46b939"
    },
    "start": {
      "href": "/v3/apps/d5b7e921-4f2b-40b7-ad82-e0f14dcfa7f3/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/d5b7e921-4f2b-40b7-ad82-e0f14dcfa7f3/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/d5b7e921-4f2b-40b7-ad82-e0f14dcfa7f3/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 74eed048-3a0d-4ea4-80b4-a214618e5c71
Content-Length: 996
X-Content-Type-Options: nosniff