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": "35ccb595-6464-43ce-82c1-7e131098b0fc",
  "environment_variables": {
    "open": "source"
  },
  "buildpack": "name-361"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzMiIsImVtYWlsIjoiZW1haWwtNzhAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0MTY2MjU5OH0.XJoqHlTmx-kPLgjsQgj9Mb1q1ZCigQ2R_6kia8zq5nk
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": "35ccb595-6464-43ce-82c1-7e131098b0fc",
  "environment_variables": {
    "open": "source"
  },
  "buildpack": "name-361"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzMiIsImVtYWlsIjoiZW1haWwtNzhAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ0MTY2MjU5OH0.XJoqHlTmx-kPLgjsQgj9Mb1q1ZCigQ2R_6kia8zq5nk" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "972d3e73-5487-4549-9faa-38e4589c0e76",
  "name": "my_app",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "buildpack": "name-361",
  "created_at": "2015-08-31T21:49:58Z",
  "updated_at": null,
  "environment_variables": {
    "open": "source"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/972d3e73-5487-4549-9faa-38e4589c0e76"
    },
    "space": {
      "href": "/v2/spaces/35ccb595-6464-43ce-82c1-7e131098b0fc"
    },
    "processes": {
      "href": "/v3/apps/972d3e73-5487-4549-9faa-38e4589c0e76/processes"
    },
    "routes": {
      "href": "/v3/apps/972d3e73-5487-4549-9faa-38e4589c0e76/routes"
    },
    "packages": {
      "href": "/v3/apps/972d3e73-5487-4549-9faa-38e4589c0e76/packages"
    },
    "droplets": {
      "href": "/v3/apps/972d3e73-5487-4549-9faa-38e4589c0e76/droplets"
    },
    "start": {
      "href": "/v3/apps/972d3e73-5487-4549-9faa-38e4589c0e76/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/972d3e73-5487-4549-9faa-38e4589c0e76/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/972d3e73-5487-4549-9faa-38e4589c0e76/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 5dd5aa5f-1d84-4070-a67c-41588845c2cc
Content-Length: 1211
X-Content-Type-Options: nosniff