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.eyJ1c2VyX2lkIjoidWFhLWlkLTMyNCIsImVtYWlsIjoiZW1haWwtMjE3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3MjF9.oh_BulAjkAifAgNpR7Ur5Nr0JGiNqJNnKEue7DQkxbE
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.eyJ1c2VyX2lkIjoidWFhLWlkLTMyNCIsImVtYWlsIjoiZW1haWwtMjE3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjM2MTg3MjF9.oh_BulAjkAifAgNpR7Ur5Nr0JGiNqJNnKEue7DQkxbE" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "aca08070-1541-41fe-add9-1548ccdc7264",
    "url": "/v2/stacks/aca08070-1541-41fe-add9-1548ccdc7264",
    "created_at": "2016-05-12T00:45:21Z",
    "updated_at": null
  },
  "entity": {
    "name": "example_stack",
    "description": "Description for the example stack"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/stacks/aca08070-1541-41fe-add9-1548ccdc7264
X-VCAP-Request-ID: 5ae3d39e-6f55-4711-a67b-85964f35cecc
Content-Length: 305
X-Content-Type-Options: nosniff