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-233/organizations/2d7be1cc-355a-4675-b3ec-cc0879793fb0

Parameters

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

Headers

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

cURL

curl "https://api.[your-domain.com]/v2/users/uaa-id-233/organizations/2d7be1cc-355a-4675-b3ec-cc0879793fb0" -d '' -X PUT \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIzNCIsImVtYWlsIjoiZW1haWwtMTQyQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjEzNzQ2MzJ9.sPH_LpJ8q8KhVTEcuUlEkjaFrmy4hFe5qGgz5RxcNU8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "uaa-id-233",
    "url": "/v2/users/uaa-id-233",
    "created_at": "2016-04-16T01:23:52Z",
    "updated_at": null
  },
  "entity": {
    "admin": false,
    "active": false,
    "default_space_guid": "10584b8f-8d4f-4466-ab0d-3c3cc8ed85f9",
    "default_space_url": "/v2/spaces/10584b8f-8d4f-4466-ab0d-3c3cc8ed85f9",
    "spaces_url": "/v2/users/uaa-id-233/spaces",
    "organizations_url": "/v2/users/uaa-id-233/organizations",
    "managed_organizations_url": "/v2/users/uaa-id-233/managed_organizations",
    "billing_managed_organizations_url": "/v2/users/uaa-id-233/billing_managed_organizations",
    "audited_organizations_url": "/v2/users/uaa-id-233/audited_organizations",
    "managed_spaces_url": "/v2/users/uaa-id-233/managed_spaces",
    "audited_spaces_url": "/v2/users/uaa-id-233/audited_spaces"
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: b32a400f-991e-48c1-ba0b-bb626dc849e2
Content-Length: 845
X-Content-Type-Options: nosniff