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

Route

POST /v2/service_instances

Body

{
  "space_guid": "8684ce51-5c4a-4567-a325-824d37a4ba60",
  "name": "my-service-instance",
  "service_plan_guid": "6a61ae5a-cda7-41df-a70c-2e34808ff5b6"
}

cURL

curl "https://api.[your-domain.com]/v2/service_instances" -d '{
  "space_guid": "8684ce51-5c4a-4567-a325-824d37a4ba60",
  "name": "my-service-instance",
  "service_plan_guid": "6a61ae5a-cda7-41df-a70c-2e34808ff5b6"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2IiwiZW1haWwiOiJlbWFpbC0xOUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE3NDYyMzUwfQ.NKxqOTpCpJ4G5jP5dxTnibWT2ycbmGzH6AyvZ3LjOZg" \
	-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/31132488-8299-4b69-8a2f-f9664ef972df
X-VCAP-Request-ID: 36fa571b-af98-4651-b1b4-9c4c8c73a761
Content-Length: 846
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "31132488-8299-4b69-8a2f-f9664ef972df",
    "url": "/v2/service_instances/31132488-8299-4b69-8a2f-f9664ef972df",
    "created_at": "2014-11-24T19:32:30+00:00",
    "updated_at": null
  },
  "entity": {
    "name": "my-service-instance",
    "credentials": {
      "creds-key-42": "creds-val-42"
    },
    "service_plan_guid": "6a61ae5a-cda7-41df-a70c-2e34808ff5b6",
    "space_guid": "8684ce51-5c4a-4567-a325-824d37a4ba60",
    "gateway_data": "CONFIGURATION",
    "dashboard_url": "http://dashboard.example.com",
    "type": "managed_service_instance",
    "space_url": "/v2/spaces/8684ce51-5c4a-4567-a325-824d37a4ba60",
    "service_plan_url": "/v2/service_plans/6a61ae5a-cda7-41df-a70c-2e34808ff5b6",
    "service_bindings_url": "/v2/service_instances/31132488-8299-4b69-8a2f-f9664ef972df/service_bindings"
  }
}