Home
Version 3
Service Keys API

Service Keys API

Create a Service Key

POST /v2/service_keys

Request

Route

POST /v2/service_keys

Body

Name Description Default Valid Values Example Values
service_instance_guid The guid of the service instance for which to create service key
name The name of the service key
parameters Arbitrary parameters to pass along to the service broker. Must be a JSON object
{
  "service_instance_guid": "132944c8-c31d-4bb8-9155-ae4e2ebe1a0c",
  "name": "name-960"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1MiIsImVtYWlsIjoiZW1haWwtMTc3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE4MDJ9.h3-Zk0y_rWKs49fJUh2wVhEd3i6ZUDhtJW9c__ts3iM
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/service_keys" -d '{
  "service_instance_guid": "132944c8-c31d-4bb8-9155-ae4e2ebe1a0c",
  "name": "name-960"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI1MiIsImVtYWlsIjoiZW1haWwtMTc3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE4MDJ9.h3-Zk0y_rWKs49fJUh2wVhEd3i6ZUDhtJW9c__ts3iM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "79aa4b11-99f3-484b-adfc-a63fa818c4d1",
    "url": "/v2/service_keys/79aa4b11-99f3-484b-adfc-a63fa818c4d1",
    "created_at": "2015-07-27T22:43:22Z",
    "updated_at": null
  },
  "entity": {
    "name": "name-960",
    "service_instance_guid": "132944c8-c31d-4bb8-9155-ae4e2ebe1a0c",
    "credentials": {
      "creds-key-392": "creds-val-392"
    },
    "service_instance_url": "/v2/service_instances/132944c8-c31d-4bb8-9155-ae4e2ebe1a0c"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_keys/79aa4b11-99f3-484b-adfc-a63fa818c4d1
X-VCAP-Request-ID: 0678271e-9799-40ff-a56c-8df14b1f7679
Content-Length: 476
X-Content-Type-Options: nosniff