Home
Version 3
Service Brokers API

Service Brokers API

Create a Service Broker

POST /v2/service_brokers

Request

Route

POST /v2/service_brokers

Body

Name Description Default Valid Values Example Values
name The name of the service broker.
  • service-broker-name
broker_url The URL of the service broker.
  • https://broker.example.com
auth_username The username with which to authenticate against the service broker.
  • admin
auth_password The password with which to authenticate against the service broker.
  • secretpassw0rd
space_guid Guid of a space the broker is scoped to. Space developers are able to create service brokers scoped to a space.
{
  "name": "service-broker-name",
  "broker_url": "https://broker.example.com",
  "auth_username": "admin",
  "auth_password": "secretpassw0rd"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1MSIsImVtYWlsIjoiZW1haWwtMjUzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjEzNzQ2NDJ9.Uwdrm4aTJfKUNRpMgn-1jDKycmfhonmB9R5B0-Qtg24
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/service_brokers" -d '{
  "name": "service-broker-name",
  "broker_url": "https://broker.example.com",
  "auth_username": "admin",
  "auth_password": "secretpassw0rd"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1MSIsImVtYWlsIjoiZW1haWwtMjUzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjEzNzQ2NDJ9.Uwdrm4aTJfKUNRpMgn-1jDKycmfhonmB9R5B0-Qtg24" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "01905186-e1c0-4d81-bbbc-08aef22dcc6f",
    "created_at": "2016-04-16T01:24:02Z",
    "updated_at": null,
    "url": "/v2/service_brokers/01905186-e1c0-4d81-bbbc-08aef22dcc6f"
  },
  "entity": {
    "name": "service-broker-name",
    "broker_url": "https://broker.example.com",
    "auth_username": "admin",
    "space_guid": null
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_brokers/01905186-e1c0-4d81-bbbc-08aef22dcc6f
X-VCAP-Request-ID: 2a645725-a62b-4ffb-81e8-39f58c7b1c56
Content-Length: 366
X-Content-Type-Options: nosniff
X-Cf-Warnings: Warning%3A+Warning+message+may+go+here.