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
{
  "service_instance_guid": "f29ecf97-2706-4f8d-a02c-efb14224f7a1",
  "name": "name-1276"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MSIsImVtYWlsIjoiZW1haWwtMTEzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxMzl9.uBY5JIYtrftCSH3rFPdSb1wC9hDr-vg8a8YQfkyRI3g
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": "f29ecf97-2706-4f8d-a02c-efb14224f7a1",
  "name": "name-1276"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE5MSIsImVtYWlsIjoiZW1haWwtMTEzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mjk2NjQxMzl9.uBY5JIYtrftCSH3rFPdSb1wC9hDr-vg8a8YQfkyRI3g" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "8287d888-2311-4ec7-ac0b-23e6f1a92971",
    "url": "/v2/service_keys/8287d888-2311-4ec7-ac0b-23e6f1a92971",
    "created_at": "2015-04-15T00:55:39Z",
    "updated_at": null
  },
  "entity": {
    "name": "name-1276",
    "service_instance_guid": "f29ecf97-2706-4f8d-a02c-efb14224f7a1",
    "credentials": {
      "creds-key-256": "creds-val-256"
    },
    "service_instance_url": "/v2/service_instances/f29ecf97-2706-4f8d-a02c-efb14224f7a1"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_keys/8287d888-2311-4ec7-ac0b-23e6f1a92971
X-VCAP-Request-ID: cd7115b8-839a-4bd5-a2e7-18365fe1fe6c
Content-Length: 477
X-Content-Type-Options: nosniff