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": "39d3b2d6-adfb-4661-8606-0c4fd0528a45",
  "environment_variables": {
    "open": "source"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxMSIsImVtYWlsIjoiZW1haWwtMjEzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjkwMzg3MTR9.y-ztFgudjCZr2ENLYfSIZHgh8CsGr57g9o2tAG8AfmI
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": "39d3b2d6-adfb-4661-8606-0c4fd0528a45",
  "environment_variables": {
    "open": "source"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxMSIsImVtYWlsIjoiZW1haWwtMjEzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjkwMzg3MTR9.y-ztFgudjCZr2ENLYfSIZHgh8CsGr57g9o2tAG8AfmI" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "1e6304f8-5861-45a4-bbd1-3f7a00fd9795",
  "name": "my_app",
  "desired_state": "STOPPED",
  "environment_variables": {
    "open": "source"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/1e6304f8-5861-45a4-bbd1-3f7a00fd9795"
    },
    "processes": {
      "href": "/v3/apps/1e6304f8-5861-45a4-bbd1-3f7a00fd9795/processes"
    },
    "packages": {
      "href": "/v3/apps/1e6304f8-5861-45a4-bbd1-3f7a00fd9795/packages"
    },
    "space": {
      "href": "/v2/spaces/39d3b2d6-adfb-4661-8606-0c4fd0528a45"
    },
    "start": {
      "href": "/v3/apps/1e6304f8-5861-45a4-bbd1-3f7a00fd9795/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/1e6304f8-5861-45a4-bbd1-3f7a00fd9795/stop",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: e79ededd-471b-41c9-9e68-0bcc171fd28d
Content-Length: 762
X-Content-Type-Options: nosniff