# Account Memberships

Each user on an account will have an account membership that describes their relationship to the account. When you add a user
to an account, create a new `account_membership`. When you remove a user from an account, delete their account_membership record.

## Fetching a list of Account Memberships

 - [GET /account_memberships](https://developer.kantata.com/kantata/specification/account-memberships/get-account-memberships.md): You can request either GET /api/v1/account_memberships.json?only=5 or
GET /api/v1/account_memberships/5.json. In both cases, default filters will be applied.
Unless you provide the is_active:false filter, you won't receive account membership for inactive users, and will get a 404 status
on the "show" route.


This endpoint returns structured Account Membership objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the account_memberships top-level JSON key.
Please see our Response Format section for more information.

## Fetching a single Account Membership

 - [GET /account_memberships/{id}](https://developer.kantata.com/kantata/specification/account-memberships/get-account-membership.md): This endpoint returns structured Account Membership objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the account_memberships top-level JSON key.
Please see our Response Format section for more information.

## Updating an existing Account Membership

 - [PUT /account_memberships/{id}](https://developer.kantata.com/kantata/specification/account-memberships/update-account-membership.md): This endpoint returns structured Account Membership objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the account_memberships top-level JSON key.
Please see our Response Format section for more information.

## Remove a user from an account

 - [DELETE /account_memberships/{id}](https://developer.kantata.com/kantata/specification/account-memberships/delete-account-membership.md): This removes the member from your account and places them on a separate Kantata OX account. It is important
to know that the account owner cannot be removed.

WARNING: Since the removed member gets their on own separate Kantata OX account,
they will remain on existing projects but will be View Only and no
longer be able to create projects in your account.

We suggest disabling an account member over removing them since it revokes their ability to access
your account and they will no longer have access to projects for which they were contributing.


The response will contain no content and an HTTP 204 status code if the request was
successful, or a standard Kantata OX error message explaining why the object could not be deleted.

## Make a user inactive

 - [PUT /account_memberships/{id}/disable](https://developer.kantata.com/kantata/specification/account-memberships/deactivate-account-membership.md): Disables a user in an account

This endpoint returns structured Account Membership objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the account_memberships top-level JSON key.
Please see our Response Format section for more information.

## Make a user active

 - [PUT /account_memberships/{id}/enable](https://developer.kantata.com/kantata/specification/account-memberships/activate-account-membership.md): Enables a user in an account

This endpoint returns structured Account Membership objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the account_memberships top-level JSON key.
Please see our Response Format section for more information.

