Home
Version 3
Apps (Experimental) API

Apps (Experimental) API

Updating an App

PATCH /v3/apps/:guid

Request

Route

PATCH /v3/apps/guid-8567259a-2bf3-455e-ba33-08c9de19f049

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.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NyIsImVtYWlsIjoiZW1haWwtMTY0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzM5ODExMTF9.TRcKU3-MwMkt5UfF3jABbdhIfkQ0lOM7SeHk2Veh1-s
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-8567259a-2bf3-455e-ba33-08c9de19f049" -d '{
  "name": "new_name",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  }
}' -X PATCH \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NyIsImVtYWlsIjoiZW1haWwtMTY0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzM5ODExMTF9.TRcKU3-MwMkt5UfF3jABbdhIfkQ0lOM7SeHk2Veh1-s" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-8567259a-2bf3-455e-ba33-08c9de19f049",
  "name": "new_name",
  "desired_state": "STOPPED",
  "total_desired_instances": 0,
  "created_at": "2015-06-04T00:05:11Z",
  "updated_at": "2015-06-04T00:05:11Z",
  "environment_variables": {
    "MY_ENV_VAR": "foobar",
    "FOOBAR": "MY_ENV_VAR"
  },
  "_links": {
    "self": {
      "href": "/v3/apps/guid-8567259a-2bf3-455e-ba33-08c9de19f049"
    },
    "processes": {
      "href": "/v3/apps/guid-8567259a-2bf3-455e-ba33-08c9de19f049/processes"
    },
    "packages": {
      "href": "/v3/apps/guid-8567259a-2bf3-455e-ba33-08c9de19f049/packages"
    },
    "space": {
      "href": "/v2/spaces/4fd9084c-a236-440f-817e-479ea3b74792"
    },
    "start": {
      "href": "/v3/apps/guid-8567259a-2bf3-455e-ba33-08c9de19f049/start",
      "method": "PUT"
    },
    "stop": {
      "href": "/v3/apps/guid-8567259a-2bf3-455e-ba33-08c9de19f049/stop",
      "method": "PUT"
    },
    "assign_current_droplet": {
      "href": "/v3/apps/guid-8567259a-2bf3-455e-ba33-08c9de19f049/current_droplet",
      "method": "PUT"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: ec5b361c-ea30-4006-b81a-d6afbc7976fd
Content-Length: 1085
X-Content-Type-Options: nosniff