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/a09b3fc7-b3a7-4ada-acb5-b677af275bd5

Parameters

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

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxIiwiZW1haWwiOiJlbWFpbC0xNUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM2ODI5Nzc0fQ.ajQfkgc6W-kCULCYozAQX552o_rlfvN4VpkQcjQ3PK8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-30/organizations/a09b3fc7-b3a7-4ada-acb5-b677af275bd5" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMxIiwiZW1haWwiOiJlbWFpbC0xNUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDM2ODI5Nzc0fQ.ajQfkgc6W-kCULCYozAQX552o_rlfvN4VpkQcjQ3PK8" \
	-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-07-06T23:22:54Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "9b7920f7-d86c-4db7-8157-777f59c37cc8",
    "default_space_url": "/v2/spaces/9b7920f7-d86c-4db7-8157-777f59c37cc8",
    "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: 26dc1faf-bbba-4994-aaa8-5edf20d91f1c
Content-Length: 836
X-Content-Type-Options: nosniff