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

# Create a label reallocation

> Reallocates funds between two labels belonging to the same Verified Customer. Moves the specified amount from the source label to the destination label, creating ledger entries for both. The reallocation only succeeds if the source label has sufficient funds.



## OpenAPI

````yaml post /label-reallocations
openapi: 3.1.0
info:
  title: Dwolla API
  description: Dwolla API Documentation
  contact:
    name: Dwolla Developer Relations Team
    url: https://developers.dwolla.com
    email: api@dwolla.com
  version: '2.0'
  termsOfService: https://www.dwolla.com/legal/tos/
  license:
    name: MIT
    url: https://github.com/Dwolla/dwolla-openapi/blob/master/LICENSE
servers:
  - url: https://api.dwolla.com
    description: Production server
  - url: https://api-sandbox.dwolla.com
    description: Sandbox server
security:
  - clientCredentials: []
tags:
  - name: tokens
    description: Operations related to Application Access Tokens
  - name: root
    description: Root API operations
  - name: accounts
    description: Operations related to Accounts
  - name: customers
    description: Operations related to Customers
  - name: kba
    description: Operations related to Knowledge-Based Authentication
  - name: beneficial owners
    description: Operations related to Beneficial Owners
  - name: documents
    description: Operations related to Documents
  - name: exchanges
    description: Operations related to Exchanges
  - name: exchange sessions
    description: Operations related to Exchange Sessions
  - name: funding sources
    description: Operations related to Funding Sources
  - name: transfers
    description: Operations related to Transfers
  - name: labels
    description: Operations related to Labels
  - name: mass payments
    description: Operations related to Mass Payments
  - name: events
    description: Operations related to Events
  - name: webhook subscriptions
    description: Operations related to Webhook Subscriptions
  - name: webhooks
    description: Operations related to Webhooks
  - name: client tokens
    description: Operations related to Client Tokens
  - name: sandbox simulations
    description: Sandbox-only operations for simulating processing of bank transfers
paths:
  /label-reallocations:
    post:
      tags:
        - labels
      summary: Create a label reallocation
      description: >-
        Reallocates funds between two labels belonging to the same Verified
        Customer. Moves the specified amount from the source label to the
        destination label, creating ledger entries for both. The reallocation
        only succeeds if the source label has sufficient funds.
      operationId: createLabelReallocation
      parameters:
        - $ref: '#/components/parameters/Accept'
      requestBody:
        required: true
        description: Parameters to create a label reallocation
        content:
          application/json:
            schema:
              required:
                - _links
                - amount
              type: object
              properties:
                _links:
                  type: object
                  properties:
                    from:
                      type: object
                      properties:
                        href:
                          type: string
                          example: >-
                            https://api.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45
                    to:
                      type: object
                      properties:
                        href:
                          type: string
                          example: >-
                            https://api.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc
                amount:
                  type: object
                  properties:
                    currency:
                      type: string
                      example: USD
                    value:
                      type: string
                      example: '15.00'
      responses:
        '201':
          description: created
          headers:
            Location:
              $ref: '#/components/headers/Location'
        '400':
          description: Bad Request
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '403':
          description: Forbidden
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: Forbidden
                  message:
                    type: string
                    example: Not authorized to create label reallocation
        '404':
          description: Not Found
          headers: {}
          content:
            application/vnd.dwolla.v1.hal+json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: NotFound
                  message:
                    type: string
                    example: Label not found
      x-codeSamples:
        - lang: bash
          source: >
            POST https://api-sandbox.dwolla.com/label-reallocations

            Content-Type: application/vnd.dwolla.v1.hal+json

            Accept: application/vnd.dwolla.v1.hal+json

            Authorization: Bearer
            pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY


            {
             "_links":{
               "from": {
                 "href": "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45"
               },
               "to": {
                 "href": "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc"
               }
             },
             "amount": {
               "value": "15.00",
               "currency": "USD"
             }
            }
        - lang: javascript
          source: |
            // Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
            var requestBody = {
              _links: {
                from: {
                  href: "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45",
                },
                to: {
                  href: "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc",
                },
              },
              amount: {
                currency: "USD",
                value: "1.00",
              },
            };

            dwolla
              .post("label-reallocations", requestBody)
              .then((res) => res.headers.get("location")); // => 'https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21'
        - lang: python
          source: >
            # Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python

            request_body = {
              '_links': {
                'from': {
                  'href': 'https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45'
                },
                'to': {
                  'href': 'https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc'
                }
              },
              'amount': {
                'currency': 'USD',
                'value': '15.00'
              }
            }


            labelReallocation = app_token.post('label-reallocations',
            request_body)

            labelReallocation.headers['location'] # =>
            'https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21'
        - lang: php
          source: >
            <?php

            // Using dwollaswagger -
            https://github.com/Dwolla/dwolla-swagger-php

            $labelReallocationsApi = new
            DwollaSwagger\LabelreallocationsApi($apiClient);


            $labelReallocation = $labelReallocationsApi->reallocateLabel([
              '_links' => [
                'from' => [
                  'href' => 'https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45',
                ],
                'to' => [
                  'href' => 'https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc'
                ]
              ],
              'amount' => [
                'currency' => 'USD',
                'value' => '15.00'
              ]
            ]);

            $labelReallocation; # =>
            "https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21"

            ?>
        - lang: ruby
          source: >
            # Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby

            request_body = {
              :_links => {
                :from => {
                  :href => "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45"
                },
                :to => {
                  :href => "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc"
                }
              },
              :amount => {
                :currency => "USD",
                :value => "15.00"
              }
            }


            labelReallocation = app_token.post "label-reallocations",
            request_body

            labelReallocation.response_headers[:location] # =>
            "https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21"
components:
  parameters:
    Accept:
      name: Accept
      in: header
      required: true
      description: >-
        The media type of the response. Must be
        application/vnd.dwolla.v1.hal+json
      schema:
        type: string
        enum:
          - application/vnd.dwolla.v1.hal+json
        default: application/vnd.dwolla.v1.hal+json
  headers:
    Location:
      description: The location of the created resource
      schema:
        type: string
  schemas:
    BadRequestError:
      title: BadRequestError
      description: Error response schema for 400 Bad Request
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: BadRequest
        message:
          type: string
          example: The request body contains bad syntax or is incomplete.
  securitySchemes:
    clientCredentials:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /token
          x-speakeasy-token-endpoint-authentication: client_secret_basic
          scopes: {}

````