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": "3260c04f-8f8d-4bcd-914e-4f1bc791c94d",
  "environment_variables": {
    "open": "source"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1MyIsImVtYWlsIjoiZW1haWwtMjY5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NjR9.ZB5GqDQS6kGp7qRJetyB4pXUnv2zoNtsAwzUxZtgioY
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": "3260c04f-8f8d-4bcd-914e-4f1bc791c94d",
  "environment_variables": {
    "open": "source"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1MyIsImVtYWlsIjoiZW1haWwtMjY5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzUxMDI4NjR9.ZB5GqDQS6kGp7qRJetyB4pXUnv2zoNtsAwzUxZtgioY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "c756595b-345f-438a-a9c9-378a9c35aa46",
  "name": "my_app",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-06-16T23:41:04Z",
  "updated_at": null,
  "environment_variables": {
    "open": "source"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/c756595b-345f-438a-a9c9-378a9c35aa46"
    },
    "processes": {
      "href": "/v3/apps/c756595b-345f-438a-a9c9-378a9c35aa46/processes"
    },
    "packages": {
      "href": "/v3/apps/c756595b-345f-438a-a9c9-378a9c35aa46/packages"
    },
    "space": {
      "href": "/v2/spaces/3260c04f-8f8d-4bcd-914e-4f1bc791c94d"
    },
    "start": {
      "href": "/v3/apps/c756595b-345f-438a-a9c9-378a9c35aa46/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/c756595b-345f-438a-a9c9-378a9c35aa46/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/c756595b-345f-438a-a9c9-378a9c35aa46/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 4f523eaa-f662-4061-9d6a-34615d70f682
Content-Length: 996
X-Content-Type-Options: nosniff