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": "54e8fd11-dca8-4131-af67-6b6dbbb6604e",
  "name": "name-783"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3MyIsImVtYWlsIjoiZW1haWwtMTQwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTQ0NTE2MTh9.YD_A5JRJjI_AjWGdxBeSDnVcjupVcwYxrVVf9CrQV9c
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": "54e8fd11-dca8-4131-af67-6b6dbbb6604e",
  "name": "name-783"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE3MyIsImVtYWlsIjoiZW1haWwtMTQwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTQ0NTE2MTh9.YD_A5JRJjI_AjWGdxBeSDnVcjupVcwYxrVVf9CrQV9c" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "a6eb17f8-ce85-4781-a60b-7bcd81f8c97b",
    "url": "/v2/service_keys/a6eb17f8-ce85-4781-a60b-7bcd81f8c97b",
    "created_at": "2016-01-26T22:20:18Z",
    "updated_at": null
  },
  "entity": {
    "name": "name-783",
    "service_instance_guid": "54e8fd11-dca8-4131-af67-6b6dbbb6604e",
    "credentials": {
      "creds-key-42": "creds-val-42"
    },
    "service_instance_url": "/v2/service_instances/54e8fd11-dca8-4131-af67-6b6dbbb6604e"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_keys/a6eb17f8-ce85-4781-a60b-7bcd81f8c97b
X-VCAP-Request-ID: 
Content-Length: 474
X-Content-Type-Options: nosniff