Home
Version 3
Users API

Users API

Associate Organization with the User

PUT /v2/users/:guid/organizations/:organization_guid

Request

Route

PUT /v2/users/uaa-id-30/organizations/0caacb63-4a66-4817-bb67-ac05e29d8cca

Parameters

Name Description Valid Values Example Values
guid The guid of the User
organization_guid The guid of the organization

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxIiwiZW1haWwiOiJlbWFpbC0xNEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQxNjYyNTk0fQ.jaxaviHoRue2d4PYQCLHWwkNL7x58nORXRU0AdzY2q8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-30/organizations/0caacb63-4a66-4817-bb67-ac05e29d8cca" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxIiwiZW1haWwiOiJlbWFpbC0xNEBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDQxNjYyNTk0fQ.jaxaviHoRue2d4PYQCLHWwkNL7x58nORXRU0AdzY2q8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-30",
    "url": "/v2/users/uaa-id-30",
    "created_at": "2015-08-31T21:49:54Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "a191f49e-331d-4dca-90c8-6cee6ac91b72",
    "default_space_url": "/v2/spaces/a191f49e-331d-4dca-90c8-6cee6ac91b72",
    "spaces_url": "/v2/users/uaa-id-30/spaces",
    "organizations_url": "/v2/users/uaa-id-30/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-30/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-30/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-30/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-30/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-30/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: b5f4b042-e09d-4912-82ae-9394a5be6076
Content-Length: 836
X-Content-Type-Options: nosniff