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

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "8fe13ad1-3df9-4778-af12-b6a99519ca7f",
    "url": "/v2/stacks/8fe13ad1-3df9-4778-af12-b6a99519ca7f",
    "created_at": "2015-08-06T00:36:32Z",
    "updated_at": null
  },
  "entity": {
    "name": "example_stack",
    "description": "Description for the example stack"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/stacks/8fe13ad1-3df9-4778-af12-b6a99519ca7f
X-VCAP-Request-ID: 9d59ff3a-a360-4a4a-b0a2-a0a473e97271
Content-Length: 305
X-Content-Type-Options: nosniff