> ## 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.

# Create Token

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>;
  });
};

Opal tokens are used as the starting point and authentication key to instantiate
Method's embeddable UI components within your experience.

<Note>
  For security purposes, Opal tokens are for one-time use only, and expire after
  30 minutes.
</Note>

## Body

The structure of the request body differs slightly depending on the Opal mode you are trying to use. See the [Opal Modes](/opal/identity/overview) section for more information about specific modes.

<Note>
  Only `entity_id` or `entity` is required. If both are provided, `entity_id`
  will be ignored.
</Note>

<ParamList
  items={[
{
  name: "mode",
  type: "enum",
  required: true,
  description: "The mode of the Opal flow.",
  enums: [
    "identity_verification",
    "connect",
    "card_connect",
    "account_verification",
    "transactions",
  ],
},
{
  name: "entity_id",
  type: "string",
  required: false,
  description:
    "The ID of the Entity. If you provide this, entity must not be provided.",
},
{
  name: "entity",
  type: "object",
  required: false,
  description:
    "The Entity object. If you provide this, entity_id must not be provided as this will create a new entity.",
},
{
  name: "session_id",
  type: "string",
  required: false,
  description: (
    <>
    The ID of the session. If you provide this, it must be for the same mode. All other fields are ignored.
    
    Sessions are long-lived stateful connections that allows a user to leave and resume their journey through Opal while maintaining the user’s data and progress.

    A previously created Session can be resumed by creating a new Opal Token with the previously created
    <code>session_id</code> in the request body.
    </>

  ),
},

]}
/>

## Mode parameters

<Tabs>
  <Tab title="Identity Verification">
    <ParamList
      items={[
    {
      name: "identity_verification",
      type: "object",
      required: true,
      description: (
        <>
          The Identity Verification object. Required when mode is{" "}
          <code>identity_verification</code>.
        </>
      ),
      items: [
        {
          name: "identity_verification.skip_pii",
          type: "string[]",
          required: false,
          default: [],
          description: "The PII to skip.",
          enums: [
            { name: "name" },
            { name: "dob" },
            { name: "address" },
            { name: "ssn_4" },
          ],
        },
      ],
    },
  ]}
    />
  </Tab>

  <Tab title="Connect">
    <ParamList
      items={[
    {
      name: "connect",
      type: "object",
      required: true,
      description: (
        <>
          The Connect object. Required when mode is <code>connect</code>.
        </>
      ),
      items: [
        {
          name: "connect.selection_type",
          type: "enum",
          required: true,
          description:
            "Whether to select a single account, multiple accounts, or all eligible accounts.",
          enums: ["single", "multiple", "all"],
        },
        {
          name: "connect.account_filters",
          type: "object",
          required: false,
          description:
            "Filters that limit which accounts a user can select. If no filters are provided, all eligible accounts will be shown.",
          items: [
            {
              name: "connect.account_filters.include",
              type: "object",
              required: false,
              description: "Accounts to explicitly include.",
              items: [
                {
                  name: "connect.account_filters.include.account_types",
                  type: "string[]",
                  required: false,
                  description:
                    "Only surface specific liability types for selection. If no filters are provided, all eligible accounts will be shown.",
                  enums: [
                    { name: "credit_card" },
                    { name: "auto_loan" },
                    { name: "mortgage" },
                    { name: "student_loan" },
                    { name: "personal_loan" },
                  ],
                },
                {
                  name: "connect.account_filters.include.products",
                  type: "string[]",
                  required: false,
                  description:
                    "Only surface accounts that support these products. If not provided, all eligible accounts will be shown.",
                  enums: [
                    { name: "balance" },
                    { name: "sensitive" },
                    { name: "payoff" },
                    { name: "update" },
                    { name: "payment" },
                  ],
                },
              ],
            },
            {
              name: "connect.account_filters.exclude",
              type: "object",
              required: false,
              description: "Accounts to mark as ineligible.",
              items: [
                {
                  name: "connect.account_filters.exclude.account_types",
                  type: "string[]",
                  required: false,
                  description: "Mark unwanted liability types as ineligible.",
                  enums: [
                    { name: "credit_card" },
                    { name: "auto_loan" },
                    { name: "mortgage" },
                    { name: "student_loan" },
                    { name: "personal_loan" },
                  ],
                },
                {
                  name: "connect.account_filters.exclude.mch_ids",
                  type: "string[]",
                  required: false,
                  description:
                    "Mark accounts belonging to specific merchants as ineligible.",
                },
                {
                  name: "connect.account_filters.exclude.unverified_account_numbers",
                  type: "boolean",
                  required: false,
                  description:
                    "Mark accounts with unverified account numbers as ineligible.",
                },
              ],
            },
          ],
        },
        {
          name: "connect.skip_pii",
          type: "string[]",
          required: false,
          default: [],
          description: "The PII to skip.",
          enums: [
            { name: "name" },
            { name: "dob" },
            { name: "address" },
            { name: "ssn_4" },
          ],
        },
      ],
    },
  ]}
    />
  </Tab>

  <Tab title="Card Connect">
    <ParamList
      items={[
    {
      name: "card_connect",
      type: "object",
      required: true,
      description: (
        <>
          The Card Connect object. Required when mode is{" "}
          <code>card_connect</code>.
        </>
      ),
      items: [
        {
          name: "card_connect.selection_type",
          type: "enum",
          required: true,
          description: "Whether to select a single card or multiple cards.",
          enums: ["single", "multiple"],
        },
        {
          name: "card_connect.account_filters",
          type: "object",
          required: false,
          description: "Filters that limit which cards a user can select. If no filters are provided, all eligible cards will be shown.",
          items: [
            {
              name: "card_connect.account_filters.exclude",
              type: "object",
              required: false,
              description: "Cards to mark as ineligible.",
              items: [
                {
                  name: "card_connect.account_filters.exclude.mch_ids",
                  type: "string[]",
                  required: false,
                  description:
                    "Mark cards belonging to specific merchants as ineligible.",
                },
                {
                  name: "card_connect.account_filters.exclude.unverified_account_numbers",
                  type: "boolean",
                  required: false,
                  description:
                    "Mark cards with unverified account numbers as ineligible.",
                },
              ],
            },
          ],
        },
        {
          name: "card_connect.skip_pii",
          type: "string[]",
          required: false,
          default: [],
          description: "The PII to skip.",
          enums: [
            { name: "name" },
            { name: "dob" },
            { name: "address" },
            { name: "ssn_4" },
          ],
        },
      ],
    },
  ]}
    />
  </Tab>

  <Tab title="Account Verification">
    <ParamList
      items={[
    {
      name: "account_verification",
      type: "object",
      required: true,
      description: (
        <>
          The Account Verification object. Required when mode is{" "}
          <code>account_verification</code>.
        </>
      ),
      items: [
        {
          name: "account_verification.account_id",
          type: "string",
          required: true,
          description: "The account to verify.",
        },
      ],
    },
  ]}
    />
  </Tab>

  <Tab title="Transactions">
    <ParamList
      items={[
    {
      name: "transactions",
      type: "object",
      required: true,
      description: (
        <>
          The Transactions object. Required when mode is{" "}
          <code>transactions</code>. Because of how transaction enrollments
          are handled by Method, no additional parameters are needed.
        </>
      ),
      items: [],
    },
  ]}
    />
  </Tab>
</Tabs>

<RequestExample>
  ```bash cURL theme={null}
  curl https://production.methodfi.com/opal/token \
    -X POST \
    -H "Method-Version: 2026-03-30" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "entity_id": "ent_fc92i43kc34",
      "mode": "identity_verification",
      "identity_verification": {
        "skip_pii": ["name", "dob", "address"]
      }
    }'

  ```

  ```javascript Node.js theme={null}
  const token = await method.opal.token.create({
    entity_id: "ent_fc92i43kc34",
    mode: "identity_verification",
    identity_verification: {
      skip_pii: ["name", "dob", "address"],
    },
  });
  ```

  ```python Python theme={null}
  token = method.opal.token.create({
    'entity_id': 'ent_fc92i43kc34',
    'mode': 'identity_verification',
    'identity_verification': {
      'skip_pii': ['name', 'dob', 'address']
    }
  })
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "data": {
      "token": "otkn_THpBacqVBBrDkfqUf9htjm4QWAEJLY9a",
      "valid_until": "2025-05-08T22:21:40.312Z",
      "session_id": "osess_zde3mW34pEHqV"
    },
    "message": null
  }
  ```
</ResponseExample>
