Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-c4837177-7d63-4a6b-b060-8b7bd8f02019

Parameters

Name Description Valid Values Example Values
name Name of the App
environment_variables Environment variables to be used for the App when running

Body

Name Description Default Valid Values Example Values
{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NSIsImVtYWlsIjoiZW1haWwtMjIyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzIzMTM2MjF9.TkgBVybvoh2ehMzzTVmRa_MRslBRnYu68VA3I8sjHGg
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-c4837177-7d63-4a6b-b060-8b7bd8f02019" -d '{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}' -X PATCH \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5NSIsImVtYWlsIjoiZW1haWwtMjIyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzIzMTM2MjF9.TkgBVybvoh2ehMzzTVmRa_MRslBRnYu68VA3I8sjHGg" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-c4837177-7d63-4a6b-b060-8b7bd8f02019",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-05-15T16:53:41Z",
  "updated_at": "2015-05-15T16:53:41Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-c4837177-7d63-4a6b-b060-8b7bd8f02019"
    },
    "processes": {
      "href": "/v3/apps/guid-c4837177-7d63-4a6b-b060-8b7bd8f02019/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-c4837177-7d63-4a6b-b060-8b7bd8f02019/packages"
    },
    "space": {
      "href": "/v2/spaces/f82c0578-2e51-461c-bdf4-aebb81f1eda5"
    },
    "start": {
      "href": "/v3/apps/guid-c4837177-7d63-4a6b-b060-8b7bd8f02019/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-c4837177-7d63-4a6b-b060-8b7bd8f02019/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-c4837177-7d63-4a6b-b060-8b7bd8f02019/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 7bd0c681-1515-46ba-b7a7-9ad108e1708b
Content-Length: 1085
X-Content-Type-Options: nosniff