# Fetching a list of Account Memberships

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.

Endpoint: GET /account_memberships
Version: 1.0.0

## Query parameters:

  - `by_full_name` (string)
    Search account memberships by full name of the user.

  - `by_user_id` (integer)
    Only includes account membership for the specified user ID.

  - `can_log_in` (boolean)
    Return account memberships based on whether or not the member is allowed to login.

  - `created_after` (string)
    Filter for records created after a specified datetime. The datetime must be in ISO 8601 format.

  - `created_before` (string)
    Filter for records created before a specified datetime. The datetime must be in ISO 8601 format.

  - `include` (string)
    Any of the below associations can be included in your request by providing the include param, e.g. include=association1,association2.
- backup_approver_associations (BackupApproverAssociation) - Retrieves the backup approver associations for the user this account membership is for, which represent a backup time approver for a specific date range. The response will include backup_approver_association_ids, which references the data in the backup_approver_associations top-level key.
- cost_rates (CostRate) - Retrieves all the cost rates in different currencies for the user this account membership is for. The response will include cost_rate_ids, which references the data in the cost_rates top-level key.
- default_role (Role) - Retrieves the default role, if any, for this account membership. The response will include default_role_id, which references the data in the roles top-level key.
- effective_workweek (Workweek) - Retrieves the workweek that is in effect today for the user this account membership is for. The response will include effective_workweek_id, which references the data in the workweeks top-level key.
- future_billable_utilizations (BillableUtilization) - Retrieves the future billable utilizations for the user this account membership is for. The response will include future_billable_utilization_ids, which references the data in the billable_utilizations top-level key.
- managees (User) - Retrieves the direct reports of the user this account membership is for. The response will include managee_ids, which references the data in the users top-level key.
- manager (User) - Retrieves the manager of the user this account membership is for. The response will include manager_id, which references the data in the users top-level key.
- possible_managees (User) - Retrieves a list of users who can become the direct reports of the user this account membership is for. The response will include possible_managee_ids, which references the data in the users top-level key.
- possible_managers (User) - Retrieves a list of users who can be set as the manager of the user this account membership is for. The response will include possible_manager_ids, which references the data in the users top-level key.
- skill_memberships (SkillMembership) - Retrieves the skill memberships for the user this account membership is for, which represent skills assigned to a user. The response will include skill_membership_ids, which references the data in the skill_memberships top-level key.
- user (User) - Retrieves the user for this account membership. The response will include user_id, which references the data in the users top-level key.

  - `only` (string)
    Allows you to request one or more resources directly by ID. Multiple IDs can be supplied
in a comma separated list, like GET /api/v1/workspaces.json?only=5,6,7.

  - `only_active` (boolean)
    Only includes users with an active membership (disabled_at is null).

  - `only_inactive` (boolean)
    Only includes users with an inactive membership (disabled_at is not null).

  - `optional_fields` (array)
    Allows you to request one or more optional fields as an array.
    Enum: "non_participant"

  - `order` (string)
    Supply order with the name of a valid sort field for the endpoint and a direction.

Valid values: bill_rate:asc, bill_rate:desc, cost_rate:asc, cost_rate:desc, created_at:asc, created_at:desc, full_name:asc, full_name:desc, permission:asc, permission:desc, role:asc, role:desc, updated_at:asc, and updated_at:desc.

  - `page` (integer)

  - `per_page` (integer)

  - `search` (string)

  - `updated_after` (string)
    Filter for records updated after a specified datetime. The datetime must be in ISO 8601 format.

  - `updated_before` (string)
    Filter for records updated before a specified datetime. The datetime must be in ISO 8601 format.

  - `with_user_ids` (string)
    Only includes account memberships for the specified user IDs. For example, '1,2,3'.

## Request fields (application/json):

  - `with_skills` (object)
    Return account memberships with the requested skills and levels.
{ '91': [2, 3], '92':[1], 'ids':[91, 92, 93], 'operation': 'and' }.

  - `with_skills.ids` (array)
    IDs of skills to be included.

  - `with_skills.operation` (string)
    Use and or or to include account memberships with all or any of the skills.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

  - `account_memberships` (object)

  - `users` (object)

  - `roles` (object)

  - `workweeks` (object)

  - `skill_memberships` (object)

  - `backup_approver_associations` (object)

  - `cost_rates` (object)

  - `billable_utilizations` (object)

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 403 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 404 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 422 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 503 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)


