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.eyJ1c2VyX2lkIjoidWFhLWlkLTciLCJlbWFpbCI6ImVtYWlsLTdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQxNTc1NDEyOX0.wxsg8HiwruqgvhEzBw_QLnnF95nBzG4_5IFoDZnuWaI
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/service_instances

Body

{
  "space_guid": "09d66287-f3e9-488d-ac71-8425f56b8106",
  "name": "my-service-instance",
  "service_plan_guid": "255d5352-2e5a-4d8c-bc5f-9f500a934c8f"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances" -d '{
  "space_guid": "09d66287-f3e9-488d-ac71-8425f56b8106",
  "name": "my-service-instance",
  "service_plan_guid": "255d5352-2e5a-4d8c-bc5f-9f500a934c8f"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTciLCJlbWFpbCI6ImVtYWlsLTdAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQxNTc1NDEyOX0.wxsg8HiwruqgvhEzBw_QLnnF95nBzG4_5IFoDZnuWaI" \
	-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/a46e9562-5207-427c-b477-225a3e59f105
X-VCAP-Request-ID: 1efadfe3-0893-4d8d-99c0-baacb864bbdc
Content-Length: 846
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "a46e9562-5207-427c-b477-225a3e59f105",
    "url": "/v2/service_instances/a46e9562-5207-427c-b477-225a3e59f105",
    "created_at": "2014-11-05T01:02:09+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-16": "creds-val-16"
    },
    "service_plan_guid": "255d5352-2e5a-4d8c-bc5f-9f500a934c8f",
    "space_guid": "09d66287-f3e9-488d-ac71-8425f56b8106",
    "gateway_data": "CONFIGURATION",
    "dashboard_url": "http://dashboard.example.com",
    "type": "managed_service_instance",
    "space_url": "/v2/spaces/09d66287-f3e9-488d-ac71-8425f56b8106",
    "service_plan_url": "/v2/service_plans/255d5352-2e5a-4d8c-bc5f-9f500a934c8f",
    "service_bindings_url": "/v2/service_instances/a46e9562-5207-427c-b477-225a3e59f105/service_bindings"
  }
}