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": "996260b8-e0b4-417d-9177-838925288e9b",
  "environment_variables": {
    "open": "source"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMwMiIsImVtYWlsIjoiZW1haWwtMjI5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzIzMTM2MjF9.DhNC6AFpBpX2JgdvFlQEcjuoYKdMGmIbgrxyKwu5ybE
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": "996260b8-e0b4-417d-9177-838925288e9b",
  "environment_variables": {
    "open": "source"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMwMiIsImVtYWlsIjoiZW1haWwtMjI5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzIzMTM2MjF9.DhNC6AFpBpX2JgdvFlQEcjuoYKdMGmIbgrxyKwu5ybE" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "946b9497-42bc-4ecf-94bb-9e0e82b423e5",
  "name": "my_app",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-05-15T16:53:41Z",
  "updated_at": null,
  "environment_variables": {
    "open": "source"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/946b9497-42bc-4ecf-94bb-9e0e82b423e5"
    },
    "processes": {
      "href": "/v3/apps/946b9497-42bc-4ecf-94bb-9e0e82b423e5/processes"
    },
    "packages": {
      "href": "/v3/apps/946b9497-42bc-4ecf-94bb-9e0e82b423e5/packages"
    },
    "space": {
      "href": "/v2/spaces/996260b8-e0b4-417d-9177-838925288e9b"
    },
    "start": {
      "href": "/v3/apps/946b9497-42bc-4ecf-94bb-9e0e82b423e5/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/946b9497-42bc-4ecf-94bb-9e0e82b423e5/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/946b9497-42bc-4ecf-94bb-9e0e82b423e5/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: fa05a136-6ecb-4c06-b05e-fce6e5f5727a
Content-Length: 996
X-Content-Type-Options: nosniff