Home
Version 3
Service Instances API

Service Instances API

Creating a Service Instance

POST /v2/service_instances/

Fields

Name Description Default Valid Values Example Values
name A name for the service instance
  • my-service-instance
service_plan_guid The guid of the service plan to associate with the instance
space_guid The guid of the space in which the instance will be created
gateway_data Configuration information for the broker gateway in v1 services

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwNyIsImVtYWlsIjoiZW1haWwtMTQ4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjIzMjM1NDN9.kLupuO1HHZ_vQTTqhkTfR4INDv5k8hzHVONM2N9RZCg
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/service_instances

Body

{
  "space_guid": "f24c6904-30e0-4559-9523-06d2d93f0c9c",
  "name": "my-service-instance",
  "service_plan_guid": "6df3af55-8f97-4dbe-9d6b-098eb53d8c17"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances" -d '{
  "space_guid": "f24c6904-30e0-4559-9523-06d2d93f0c9c",
  "name": "my-service-instance",
  "service_plan_guid": "6df3af55-8f97-4dbe-9d6b-098eb53d8c17"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIwNyIsImVtYWlsIjoiZW1haWwtMTQ4QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjIzMjM1NDN9.kLupuO1HHZ_vQTTqhkTfR4INDv5k8hzHVONM2N9RZCg" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_instances/7373157c-ff42-45a1-a4c0-0f71b62120e3
X-VCAP-Request-ID: 65e33492-736e-4142-900a-83c1d0b09e92
Content-Length: 898
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "7373157c-ff42-45a1-a4c0-0f71b62120e3",
    "url": "/v2/service_instances/7373157c-ff42-45a1-a4c0-0f71b62120e3",
    "created_at": "2015-01-20T01:52:23+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-327": "creds-val-327"
    },
    "service_plan_guid": "6df3af55-8f97-4dbe-9d6b-098eb53d8c17",
    "space_guid": "f24c6904-30e0-4559-9523-06d2d93f0c9c",
    "gateway_data": "CONFIGURATION",
    "dashboard_url": "http://dashboard.example.com",
    "type": "managed_service_instance",
    "state": null,
    "state_description": null,
    "space_url": "/v2/spaces/f24c6904-30e0-4559-9523-06d2d93f0c9c",
    "service_plan_url": "/v2/service_plans/6df3af55-8f97-4dbe-9d6b-098eb53d8c17",
    "service_bindings_url": "/v2/service_instances/7373157c-ff42-45a1-a4c0-0f71b62120e3/service_bindings"
  }
}