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-434/organizations/2f76cda9-09fc-42a1-9a88-fc9924270ece

Parameters

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

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQzNSIsImVtYWlsIjoiZW1haWwtMzI1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NTV9.BgvZK6K-_MHfGJVEKeTppX3fnxFqHvRUKuaV-3V3w50
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-434/organizations/2f76cda9-09fc-42a1-9a88-fc9924270ece" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQzNSIsImVtYWlsIjoiZW1haWwtMzI1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NTV9.BgvZK6K-_MHfGJVEKeTppX3fnxFqHvRUKuaV-3V3w50" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-434",
    "url": "/v2/users/uaa-id-434",
    "created_at": "2016-03-14T22:30:55Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "5a407f88-5acc-4820-bd95-c6a1a70ef077",
    "default_space_url": "/v2/spaces/5a407f88-5acc-4820-bd95-c6a1a70ef077",
    "spaces_url": "/v2/users/uaa-id-434/spaces",
    "organizations_url": "/v2/users/uaa-id-434/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-434/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-434/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-434/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-434/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-434/audited_spaces"
  }
}

Headers

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