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

# Create session

> Create a new session for the Travel Rule Widget.

export const RestEndpointSubjects = ({subjects = []}) => {
  const subjectToIconMap = {
    'client': 'browser',
    'user:individual': 'user',
    'user:business': 'briefcase'
  };
  if (subjects.length === 0) {
    return null;
  }
  return <>
      {subjects.map(subject => <a key={subject} href="/rest-apis/authentication#subjects" className="border-0 opacity-85 hover:opacity-100 transition-opacity">
          <Badge stroke size="lg" icon={subjectToIconMap[subject]} color="gray" className="mr-1">
            {subject}
          </Badge>
        </a>)}
    </>;
};

<RestEndpointSubjects subjects={["user:individual", "user:business"]} />


## OpenAPI

````yaml _media/specs/widgets-openapi.mintlify.json post /widgets/travel-rule/sessions
openapi: 3.1.0
info:
  version: 0.1.0
  title: Widget API
  description: The Widgets API provides resources to interact with the widgets.
  contact:
    name: Uphold API Team
    email: developer@uphold.com
    url: https://developer.uphold.com
servers:
  - url: https://api.enterprise.sandbox.uphold.com
    description: Sandbox
  - url: https://api.enterprise.uphold.com
    description: Production
security:
  - OAuth2: []
tags:
  - name: Payment
    description: Payment.
  - name: Travel rule
    description: Travel rule.
  - name: KYC
    description: KYC.
paths:
  /widgets/travel-rule/sessions:
    post:
      tags:
        - Travel rule
      summary: Create session
      description: Create a new session for the Travel Rule Widget.
      operationId: widgets.create-travel-rule-widget-session
      requestBody:
        $ref: >-
          #/components/requestBodies/create-travel-rule-widget-session-request-body
      responses:
        '201':
          $ref: '#/components/responses/create-travel-rule-widget-session-response'
        '404':
          $ref: >-
            #/components/responses/create-travel-rule-widget-session-not-found-response
        '409':
          $ref: >-
            #/components/responses/create-travel-rule-widget-session-conflict-response
      security:
        - OAuth2:
            - widgets.travel-rule.sessions:create
components:
  requestBodies:
    create-travel-rule-widget-session-request-body:
      content:
        application/json:
          schema:
            type: object
            discriminator:
              propertyName: flow
              mapping:
                deposit-form:
                  $ref: >-
                    #/components/schemas/create-travel-rule-widget-session-deposit-form-flow
                withdrawal-form:
                  $ref: >-
                    #/components/schemas/create-travel-rule-widget-session-withdrawal-form-flow
            oneOf:
              - $ref: >-
                  #/components/schemas/create-travel-rule-widget-session-deposit-form-flow
                title: Deposit form
              - $ref: >-
                  #/components/schemas/create-travel-rule-widget-session-withdrawal-form-flow
                title: Withdrawal form
            required:
              - flow
          examples:
            Create Deposit Form Session:
              value:
                flow: deposit-form
                data:
                  requestForInformationId: a5280aa4-4bff-4f5c-a0a5-0431771b5705
            Create Withdrawal Form Session:
              value:
                flow: withdrawal-form
                data:
                  quoteId: 623000c8-9bdf-4a2b-aa3d-6a6b44a7f6a0
  responses:
    create-travel-rule-widget-session-response:
      description: Session created.
      content:
        application/json:
          schema:
            type: object
            properties:
              session:
                $ref: '#/components/schemas/travel-rule-widget-session'
            required:
              - session
          examples:
            Deposit Form Session Created:
              value:
                session:
                  flow: deposit-form
                  url: https://travel-rule.enterprise.uphold.com/
                  token: GEbRxBN...edjnXbL
                  data:
                    provider: notabene
                    parameters:
                      init:
                        authToken: eyJhbGc...6oX8QoM
                        nodeUrl: https://api.notabene.id
                      options:
                        proofs:
                          fallbacks:
                            - self-declaration
                          reuseProof: true
                          deminimis:
                            currency: EUR
                            proofTypes: []
                            threshold: 1000
                      transaction:
                        amountDecimal: 1.23
                        asset: XRP-XRP
                        customer:
                          name: John Doe
                          type: natural
                        source:
                          - rDkjqf1YFGjt39ZrRQu9gMqcNEBmcQaXyC
            Withdrawal Form Session Created:
              value:
                session:
                  flow: withdrawal-form
                  url: https://travel-rule.enterprise.uphold.com/
                  token: GEbRxBN...edjnXbL
                  data:
                    provider: notabene
                    parameters:
                      init:
                        authToken: eyJhbGc...6oX8QoM
                        nodeUrl: https://api.notabene.id
                      options:
                        allowedAgentTypes:
                          - WALLET
                          - VASP
                        allowedCounterpartyTypes:
                          - natural
                          - legal
                          - self
                        counterpartyAssist: false
                        proofs:
                          deminimis:
                            currency: USD
                            proofTypes: []
                            threshold: 1000
                          fallbacks:
                            - self-declaration
                          reuseProof: true
                        vasps:
                          addUnknown: true
                      transaction:
                        amountDecimal: 1.23
                        asset: XRP-XRP
                        destination: rBUN3thXZqVk7czm8huFaahNkL4LMByATd
      headers:
        x-uphold-request-id:
          description: >-
            A unique identifier for the request that can be shared with Uphold
            for troubleshooting purposes.
          required: true
          schema:
            type: string
            format: uuid
          examples:
            Request ID:
              value: 9092ee4d-f0fb-42e9-8787-b668dbcec531
    create-travel-rule-widget-session-not-found-response:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          examples:
            Quote Not Found:
              value:
                code: entity_not_found
                message: The quote cannot be found
                details:
                  entity: quote
            Request For Information Not Found:
              value:
                code: entity_not_found
                message: The request for information cannot be found
                details:
                  entity: request-for-information
      headers:
        x-uphold-request-id:
          description: >-
            A unique identifier for the request that can be shared with Uphold
            for troubleshooting purposes.
          required: true
          schema:
            type: string
            format: uuid
          examples:
            Request ID:
              value: 9092ee4d-f0fb-42e9-8787-b668dbcec531
    create-travel-rule-widget-session-conflict-response:
      description: Business logic error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          examples:
            Quote Missing Travel Rule Requirement:
              value:
                code: operation_not_allowed
                message: The quote does not require travel rule
                details:
                  reasons:
                    - quote-missing-travel-rule-requirement
      headers:
        x-uphold-request-id:
          description: >-
            A unique identifier for the request that can be shared with Uphold
            for troubleshooting purposes.
          required: true
          schema:
            type: string
            format: uuid
          examples:
            Request ID:
              value: 9092ee4d-f0fb-42e9-8787-b668dbcec531
  schemas:
    create-travel-rule-widget-session-deposit-form-flow:
      type: object
      properties:
        flow:
          description: The flow of the Travel Rule widget session.
          type: string
          enum:
            - deposit-form
        data:
          description: The data for the deposit form flow.
          type: object
          properties:
            requestForInformationId:
              description: The request for information id to create the session for.
              type: string
              format: uuid
          required:
            - requestForInformationId
      required:
        - flow
        - data
    create-travel-rule-widget-session-withdrawal-form-flow:
      type: object
      properties:
        flow:
          description: The flow of the Travel Rule widget session.
          type: string
          enum:
            - withdrawal-form
        data:
          description: The data for the withdrawal form flow.
          type: object
          properties:
            quoteId:
              description: The quote id to create the session for.
              type: string
              format: uuid
          required:
            - quoteId
      required:
        - flow
        - data
    travel-rule-widget-session:
      type: object
      properties:
        flow:
          type: string
          description: The flow of the Travel Rule widget session.
          enum:
            - deposit-form
            - withdrawal-form
        url:
          description: The URL of the widget session that should be opened.
          type: string
          format: uri
        token:
          description: The token identifying the authenticated user.
          type: string
        data:
          type: object
          discriminator:
            propertyName: provider
            mapping:
              notabene:
                $ref: '#/components/schemas/travel-rule-widget-session-data-notabene'
          oneOf:
            - $ref: '#/components/schemas/travel-rule-widget-session-data-notabene'
              title: Notabene
      required:
        - flow
        - url
        - token
        - data
    error:
      description: The error information.
      type: object
      properties:
        code:
          description: >-
            A short string with a brief explanation about the error code
            reported.
          type: string
        message:
          description: A human-readable message providing more details about the error.
          type: string
        details:
          description: Additional information about the error reported.
          type: object
          additionalProperties: true
      required:
        - code
        - message
    travel-rule-widget-session-data-notabene:
      type: object
      properties:
        provider:
          type: string
          description: The provider of the Travel Rule service.
          enum:
            - notabene
        parameters:
          type: object
          description: The parameters for the Travel Rule provider.
          properties:
            init:
              type: object
              description: The configuration options.
              properties:
                authToken:
                  description: The authentication token.
                  type: string
                nodeUrl:
                  description: The node URL.
                  type: string
              required:
                - authToken
                - nodeUrl
            options:
              type: object
              description: The transaction options.
              additionalProperties: true
            transaction:
              type: object
              description: The transaction details.
              additionalProperties: true
          required:
            - init
            - options
            - transaction
      required:
        - provider
        - parameters
  securitySchemes:
    OAuth2:
      type: oauth2
      description: OAuth 2.0
      flows:
        clientCredentials:
          tokenUrl: /core/oauth2/token
          scopes:
            widgets.payment.sessions:create: Grants access to create payment widget sessions.
            widgets.travel-rule.sessions:create: Grants access to create Travel Rule widget sessions.
            widgets.kyc.sessions:create: Grants access to create KYC widget sessions.

````