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": "743d03e5-433d-47ff-82ab-1a076c085654",
  "name": "name-2083"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NCIsImVtYWlsIjoiZW1haWwtMTc1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTY0NTIyMzd9.tXP4QN7ZXZb36jRqBLyHAykwMMP18rfHjOS9rl4oeoM
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": "743d03e5-433d-47ff-82ab-1a076c085654",
  "name": "name-2083"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NCIsImVtYWlsIjoiZW1haWwtMTc1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTY0NTIyMzd9.tXP4QN7ZXZb36jRqBLyHAykwMMP18rfHjOS9rl4oeoM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "2337a7da-c271-4672-bd2a-27dcb3f6576a",
    "url": "/v2/service_keys/2337a7da-c271-4672-bd2a-27dcb3f6576a",
    "created_at": "2016-02-19T02:03:57Z",
    "updated_at": null
  },
  "entity": {
    "name": "name-2083",
    "service_instance_guid": "743d03e5-433d-47ff-82ab-1a076c085654",
    "credentials": {
      "creds-key-45": "creds-val-45"
    },
    "service_instance_url": "/v2/service_instances/743d03e5-433d-47ff-82ab-1a076c085654"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_keys/2337a7da-c271-4672-bd2a-27dcb3f6576a
X-VCAP-Request-ID: 
Content-Length: 475
X-Content-Type-Options: nosniff