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-222/organizations/8eec9757-9db9-4f08-a003-56b7708754ea

Parameters

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

Body

Name Description Default Valid Values Example Values

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-222/organizations/8eec9757-9db9-4f08-a003-56b7708754ea" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMyIsImVtYWlsIjoiZW1haWwtMTcxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjczMjM5Njl9.qw7ZwSlw_4iiIrtlRTPCYSR09R6QJKDvtmGRbdTLwWU" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-222",
    "url": "/v2/users/uaa-id-222",
    "created_at": "2015-03-18T22:52:49Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "369cadcb-51aa-4cad-b9c3-d8d544043b38",
    "default_space_url": "/v2/spaces/369cadcb-51aa-4cad-b9c3-d8d544043b38",
    "spaces_url": "/v2/users/uaa-id-222/spaces",
    "organizations_url": "/v2/users/uaa-id-222/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-222/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-222/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-222/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-222/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-222/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 70c181d0-14d7-4a04-80a5-9a0565359fdf
Content-Length: 845
X-Content-Type-Options: nosniff