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-350/organizations/b69d05db-5500-4738-b8b3-be1c141edecc

Parameters

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

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-350/organizations/b69d05db-5500-4738-b8b3-be1c141edecc" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM1MSIsImVtYWlsIjoiZW1haWwtMjM5QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTMzMTA5ODh9.Bv4bU12f8BEPGHZf8fNIxjyV8x8eezppL6i8PZUT1Qs" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-350",
    "url": "/v2/users/uaa-id-350",
    "created_at": "2016-01-13T17:29:48Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "44f6e0d6-a2d5-4344-a994-be25436c3f6e",
    "default_space_url": "/v2/spaces/44f6e0d6-a2d5-4344-a994-be25436c3f6e",
    "spaces_url": "/v2/users/uaa-id-350/spaces",
    "organizations_url": "/v2/users/uaa-id-350/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-350/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-350/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-350/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-350/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-350/audited_spaces"
  }
}

Headers

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