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

Parameters

Name Description Valid Values Example Values
accepts_incomplete Set to `true` if the client allows asynchronous provisioning. The cloud controller may respond before the service is ready for use.
  • true
  • false

Request

Headers

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

Route

POST /v2/service_instances

Body

{
  "space_guid": "c04a7022-760a-4698-8e37-2f6a4125d1c7",
  "name": "my-service-instance",
  "service_plan_guid": "e49b2017-51b6-4276-a230-9d2fe33c4906"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances" -d '{
  "space_guid": "c04a7022-760a-4698-8e37-2f6a4125d1c7",
  "name": "my-service-instance",
  "service_plan_guid": "e49b2017-51b6-4276-a230-9d2fe33c4906"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIxNSIsImVtYWlsIjoiZW1haWwtMTQ3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQ0NzE2OTZ9.jdLPcweULPtAZUcIvJy9gVv0B5t4ma5WMI8l0E_S2fI" \
	-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/e44b57ed-c344-4232-a72e-df4950b648be
X-VCAP-Request-ID: d0bba968-4d6f-4c02-bd0f-7586607e6314
Content-Length: 994
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "e44b57ed-c344-4232-a72e-df4950b648be",
    "url": "/v2/service_instances/e44b57ed-c344-4232-a72e-df4950b648be",
    "created_at": "2015-02-13T22:34:56Z",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-326": "creds-val-326"
    },
    "service_plan_guid": "e49b2017-51b6-4276-a230-9d2fe33c4906",
    "space_guid": "c04a7022-760a-4698-8e37-2f6a4125d1c7",
    "gateway_data": "CONFIGURATION",
    "dashboard_url": "http://dashboard.example.com",
    "type": "managed_service_instance",
    "last_operation": {
      "type": "create",
      "state": "succeeded",
      "description": "",
      "updated_at": "2015-02-13T22:34:56Z"
    },
    "space_url": "/v2/spaces/c04a7022-760a-4698-8e37-2f6a4125d1c7",
    "service_plan_url": "/v2/service_plans/e49b2017-51b6-4276-a230-9d2fe33c4906",
    "service_bindings_url": "/v2/service_instances/e44b57ed-c344-4232-a72e-df4950b648be/service_bindings"
  }
}