Home
Version 3
Stacks API

Stacks API

Create a Stack

POST /v2/stacks

Request

Route

POST /v2/stacks

Body

Name Description Default Valid Values Example Values
name The name for the stack.
description The description for the stack
{"name":"example_stack","description":"Description for the example stack"}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OSIsImVtYWlsIjoiZW1haWwtMTg1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDV9.93dj3kMNlr_PI7p-BsclCDsr7h82FXWaAvnNx6ho3VM
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/stacks" -d '{"name":"example_stack","description":"Description for the example stack"}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OSIsImVtYWlsIjoiZW1haWwtMTg1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTg0MDV9.93dj3kMNlr_PI7p-BsclCDsr7h82FXWaAvnNx6ho3VM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "a3d2a710-95be-4dc5-bbe5-6e17dab59811",
    "url": "/v2/stacks/a3d2a710-95be-4dc5-bbe5-6e17dab59811",
    "created_at": "2016-04-22T19:33:25Z",
    "updated_at": null
  },
  "entity": {
    "name": "example_stack",
    "description": "Description for the example stack"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/stacks/a3d2a710-95be-4dc5-bbe5-6e17dab59811
X-VCAP-Request-ID: c0389a08-c73b-4168-85c8-8df19455c1ae
Content-Length: 305
X-Content-Type-Options: nosniff