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-304/organizations/5c37ebee-ff2b-4970-a0d3-ca3d86c01410

Parameters

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

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-304/organizations/5c37ebee-ff2b-4970-a0d3-ca3d86c01410" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMwNSIsImVtYWlsIjoiZW1haWwtMjEzQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1MzB9.XzxrImPfD80r_HYc_psJckoQVJ8l2vQViTKdTlEYtl8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-304",
    "url": "/v2/users/uaa-id-304",
    "created_at": "2015-11-30T23:38:50Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "dab54d1d-631b-4975-9d74-36f442a79a5d",
    "default_space_url": "/v2/spaces/dab54d1d-631b-4975-9d74-36f442a79a5d",
    "spaces_url": "/v2/users/uaa-id-304/spaces",
    "organizations_url": "/v2/users/uaa-id-304/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-304/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-304/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-304/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-304/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-304/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 
Content-Length: 845
X-Content-Type-Options: nosniff