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

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "0fc19ff5-678c-4ff9-a63b-da90f41d33d3",
    "url": "/v2/stacks/0fc19ff5-678c-4ff9-a63b-da90f41d33d3",
    "created_at": "2015-07-27T22:43:09Z",
    "updated_at": null
  },
  "entity": {
    "name": "example_stack",
    "description": "Description for the example stack"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/stacks/0fc19ff5-678c-4ff9-a63b-da90f41d33d3
X-VCAP-Request-ID: 74a351e8-481e-4d39-89ea-a1c23e633d62
Content-Length: 305
X-Content-Type-Options: nosniff