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

# Delete an instant payment alias

> Removes one of your aliases from the instant payment directory. Payers can no longer reach your account through it, and HUB2 stops accepting it as your leg. An alias that is not yours is refused exactly like one that does not exist. The alias HUB2 enrolled as the account primary cannot be deleted this way (409). Inside a merchant group the aliases are the group owner's and are managed by its sub-merchants: the owner calling under its own id is refused (403 group_owner_transaction_forbidden). Live mode only.



## OpenAPI

````yaml delete /instant-payment/accounts/{accountType}/aliases/{aliasKey}
openapi: 3.0.0
info:
  title: Hub2 Service · Api
  description: |-
    This is the Hub2 api reference |
          Please check https://docs.hub2.io/ for the full documentation |
          Rate limits of endpoints are here : https://docs.hub2.io/en/details/limits.html.
  version: 2.185.0
  contact:
    name: Hub2
    url: https://www.hub2.io/
    email: contact@hub2.io
servers: []
security: []
tags:
  - name: Payments
    description: >-
      Best known as the PAY-IN API, it provides endpoints for merchants to
      perform Hub2 PAY-IN transactions.
  - name: Transfers
    description: >-
      Best known as the PAY-OUT API, it provides endpoints for merchants to
      perform Hub2 PAY-OUT transactions.
  - name: IRT
    description: International Remittance Transfers
  - name: Balance
    description: ''
  - name: Webhooks
    description: ''
  - name: Provisioning
    description: ''
  - name: Payment on Terminal
    description: ''
  - name: Receipt
    description: ''
  - name: Sms
    description: ''
  - name: Data
    description: ''
  - name: Compliance
    description: ''
  - name: Recipient
    description: ''
  - name: Delegation
    description: ''
  - name: Deposits
    description: ''
  - name: Payment Links
    description: ''
  - name: Subscription Links
    description: ''
  - name: Submerchants
    description: ''
  - name: Bill Payments
    description: ''
  - name: Subscriptions
    description: ''
  - name: Subscription Intents
    description: >-
      Enrolls a customer in card-on-file recurring debits and tracks how each
      enrollment ended.
  - name: Instant Payment
    description: >-
      Instant payment (PI SPI, BCEAO) resources, such as the aliases naming your
      accounts in the national directory.
paths:
  /instant-payment/accounts/{accountType}/aliases/{aliasKey}:
    delete:
      tags:
        - Instant Payment
      summary: Delete an instant payment alias
      description: >-
        Removes one of your aliases from the instant payment directory. Payers
        can no longer reach your account through it, and HUB2 stops accepting it
        as your leg. An alias that is not yours is refused exactly like one that
        does not exist. The alias HUB2 enrolled as the account primary cannot be
        deleted this way (409). Inside a merchant group the aliases are the
        group owner's and are managed by its sub-merchants: the owner calling
        under its own id is refused (403 group_owner_transaction_forbidden).
        Live mode only.
      operationId: InstantPaymentAliasesController_delete
      parameters:
        - name: accountType
          required: true
          in: path
          description: >-
            The account the aliases belong to: collection (receives instant
            payments) or transfer (pays them out)
          schema:
            example: collection
            type: string
            enum:
              - collection
              - transfer
        - name: aliasKey
          required: true
          in: path
          description: The alias key, as returned when the alias was created
          schema:
            maxLength: 64
            example: b9a4c2e1-7f3d-4e5a-9c8b-1d2e3f4a5b6c
            type: string
        - name: ApiKey
          in: header
          description: >-
            Your api key. To create a key, please get into our dashboard. If you
            don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: MerchantId
          in: header
          description: >-
            Your merchant ID. This information is available in our dashboard. If
            you don't have access to it, please reach the Support team.
          required: true
          schema:
            type: string
        - name: Environment
          in: header
          description: >-
            Allow you to choose between the sandbox mode to perform some tests
            or the live mode for real world transactions.
          required: true
          schema:
            type: string
            enum:
              - live
              - sandbox
      responses:
        '204':
          description: The alias was removed from the directory
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadRequestErrorAlias'
        '401':
          description: Wrong credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorizedErrorAlias'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbiddenRequestErrorAlias'
        '409':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInvalidRequestErrorAlias'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnprocessableEntityErrorAlias'
        '429':
          description: 'ThrottlerException: Too Many Requests'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiTooManyRequestErrorAlias'
        '500':
          description: Internal error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiInternalErrorAlias'
        '502':
          description: Bad gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUpstreamErrorAlias'
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUpstreamErrorAlias'
components:
  schemas:
    ApiBadRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP error code.
          example: 400
        error:
          description: HTTP error description.
          allOf:
            - $ref: '#/components/schemas/InternalApiBadRequestError'
      required:
        - status
        - error
    ApiUnauthorizedErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP error code.
          example: 401
        error:
          description: HTTP error description.
          allOf:
            - $ref: '#/components/schemas/InternalApiUnauthorizedError'
      required:
        - status
        - error
    ApiForbiddenRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 403
          example: 403
        error:
          description: Error object
          allOf:
            - $ref: '#/components/schemas/ForbiddenErrorObject'
      required:
        - status
        - error
    ApiInvalidRequestErrorAlias:
      type: object
      properties:
        httpStatus:
          type: number
          description: Http status
          enum:
            - 409
          example: 409
        type:
          type: string
          description: Error type
          example: invalid_request
        code:
          type: string
          description: Error code
          enum:
            - unsupported_action
          example: unsupported_action
        message:
          type: string
          description: Error message
          example: This action is not supported
      required:
        - httpStatus
        - type
        - code
        - message
    ApiUnprocessableEntityErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 422
          example: 422
        error:
          type: string
          description: Unprocessable Entity
          example: Unable to process this transaction
      required:
        - status
        - error
    ApiTooManyRequestErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: status
          enum:
            - 429
          example: 429
        error:
          type: string
          description: Error
          example: 'ThrottlerException: Too Many Requests'
      required:
        - status
        - error
    ApiInternalErrorAlias:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: internal_error
        code:
          type: string
          description: The error code for this error.
          example:
            - internal_error
            - wrong_credentials
            - not_granted
            - live_mode_not_granted
        message:
          type: string
          description: The error message describing what happens to throw this error.
          example: An error occurred on our system. Please try again later.
      required:
        - type
        - code
        - message
    ApiUpstreamErrorAlias:
      type: object
      properties:
        status:
          type: number
          description: HTTP status.
          enum:
            - 502
            - 503
          example: 503
        code:
          type: string
          description: >-
            The error code. 503: `instant_payment_alias_rail_unavailable`,
            `merchant_group_unavailable` (the merchant group of the caller could
            not be verified, so money movement is refused). 502:
            `instant_payment_alias_not_recorded`,
            `instant_payment_alias_deletion_not_recorded`,
            `instant_payment_alias_divergence`.
          example: merchant_group_unavailable
        message:
          type: string
          description: What went wrong, and whether the call is safe to retry.
          example: >-
            Your merchant group could not be verified. Please retry in a few
            moments.
        request_id:
          type: string
          description: >-
            Identifier of the request, to quote when contacting the Support
            team.
      required:
        - status
        - code
        - message
        - request_id
    InternalApiBadRequestError:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP error code.
          example: 400
        message:
          description: >-
            Detailed error message or array of messages to describe what's
            wrong.
          example:
            - destination.provider must be a string
          type: array
          items:
            type: string
        error:
          type: string
          description: The error message
          example: Bad Request
      required:
        - statusCode
        - message
        - error
    InternalApiUnauthorizedError:
      type: object
      properties:
        type:
          type: string
          description: The type of this error.
          example: authorization_error
        code:
          type: string
          description: The internal error code describing what happened.
          enum:
            - bad_payment_intent_token
            - wrong_credentials
          example: wrong_credentials
        message:
          type: string
          description: Detailed error message which describe what happened.
          example: L'ID marchand et/ou la clé d'API sont incorrects.
      required:
        - type
        - code
        - message
    ForbiddenErrorObject:
      type: object
      properties:
        statusCode:
          type: number
          description: Http status
          enum:
            - 403
          example: 403
        message:
          type: string
          description: Detailed error message
          example: Forbidden
        error:
          type: string
          description: Error name
      required:
        - statusCode
        - message
        - error

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.