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-221/organizations/abe4d977-2d3b-4528-8810-2a9d0e0fc8ee

Parameters

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

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMiIsImVtYWlsIjoiZW1haWwtMTgxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTQ0NTE2MjJ9.c_rVXdLEJuudemjvG-n-JNQVl4Yc8D2i9jpwyrzwEyc
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-221/organizations/abe4d977-2d3b-4528-8810-2a9d0e0fc8ee" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMiIsImVtYWlsIjoiZW1haWwtMTgxQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTQ0NTE2MjJ9.c_rVXdLEJuudemjvG-n-JNQVl4Yc8D2i9jpwyrzwEyc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-221",
    "url": "/v2/users/uaa-id-221",
    "created_at": "2016-01-26T22:20:22Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "ea249308-7c66-4f74-9cf9-4c687bc9b598",
    "default_space_url": "/v2/spaces/ea249308-7c66-4f74-9cf9-4c687bc9b598",
    "spaces_url": "/v2/users/uaa-id-221/spaces",
    "organizations_url": "/v2/users/uaa-id-221/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-221/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-221/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-221/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-221/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-221/audited_spaces"
  }
}

Headers

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