> ## Documentation Index
> Fetch the complete documentation index at: https://docs.methodfi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Withdraw an Entity's Consent

export const ParamList = ({items = [], is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen || false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map((enum_item, index) => <div key={`enum-${index}`}>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </div>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Withdraws an Entity's consent. This endpoint sets the entity's status to `disabled`, withdraws consent on all the entity's accounts,
and removes all active Products or Subscriptions across all the Entity's accounts.

## Path Parameters

<ParamList
  items={[
{
name: 'ent_id',
type: 'string',
required: true,
description: 'ID of the Entity.',
},
]}
/>

## Body

<ParamList
  items={[
{
name: 'type',
type: 'enum',
required: true,
description: (
  <>
    Available types: <code>withdraw</code>.
  </>
),
},
{
name: 'reason',
type: 'string',
required: true,
description: (
  <>
    Available Reasons: <code>entity_withdrew_consent</code>.
  </>
),
}
]}
/>

## Returns

Returns the entity with `status` set to `disabled`.

<RequestExample>
  ```bash cURL theme={null}
  curl https://production.methodfi.com/entities/ent_au22b1fbFJbp8/consent \
    -X POST \
    -H "Method-Version: 2026-03-30" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "withdraw",
      "reason": "entity_withdrew_consent"
    }'
  ```

  ```javascript Node.js theme={null}
  const entity = await method.entities.withdrawConsent('ent_au22b1fbFJbp8');
  ```

  ```python Python theme={null}
  entity = method.entities.withdraw_consent('ent_au22b1fbFJbp8', {
    'type': 'withdraw',
    'reason': 'entity_withdrew_consent'
  })
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
   {
    "id": "ent_qJk8AJ9grkGHg",
    "type": null,
    "individual": null,
    "corporation": null,
    "receive_only": null,
    "verification": null,
    "error": {
      "type": "ENTITY_DISABLED",
      "sub_type": "ENTITY_CONSENT_WITHDRAWN",
      "code": 12004,
      "message": "Entity was disabled due to consent withdrawal."
    },
    "address": {},
    "status": "disabled",
    "metadata": null,
    "created_at": "2024-05-31T21:27:46.044Z",
    "updated_at": "2024-05-31T21:27:49.468Z"
  }

  ```
</ResponseExample>
