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

# Account Recovery

> Use this to recover the customer's account for a given entitlement.

Please note that the base url for this endpoint is different:

- Sandbox: https://acr-b33f-resale.eu.uat.integrator.bango.com
- Production - US region: https://acr-b33f-resale.us.integrator.bango.com
- Production - EU region: https://acr-b33f-resale.eu.integrator.bango.com
- Production - AP region: https://acr-b33f-resale.ap.integrator.bango.com



## OpenAPI

````yaml /openapi/current/dvm/reseller-to-dvm/entitlement/openapi.json post /v1/entitlement/accountRecovery/{entitlementId}
openapi: 3.1.0
info:
  title: Reseller to DVM - Entitlement
  summary: Current / DVM / Reseller to DVM / Entitlement
  description: Create, get, update, cancel and revoke entitlements.
  version: 1.0.0
servers: []
security: []
tags:
  - name: Entitlements
    description: API methods to manage entitlements
paths:
  /v1/entitlement/accountRecovery/{entitlementId}:
    post:
      tags:
        - Entitlements
      summary: Account Recovery
      description: >-
        Use this to recover the customer's account for a given entitlement.


        Please note that the base url for this endpoint is different:


        - Sandbox: https://acr-b33f-resale.eu.uat.integrator.bango.com

        - Production - US region:
        https://acr-b33f-resale.us.integrator.bango.com

        - Production - EU region:
        https://acr-b33f-resale.eu.integrator.bango.com

        - Production - AP region:
        https://acr-b33f-resale.ap.integrator.bango.com
      operationId: Account_recovery_v1_entitlement_accountRecovery__entitlementId__post
      parameters:
        - name: entitlementId
          in: path
          required: true
          schema:
            type: string
            format: uuid
            description: The Bango entitlementId generated when the entitlement is created
            title: Entitlementid
          description: The Bango entitlementId generated when the entitlement is created
        - name: X-Request-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Unique request id generated by the reseller. Useful for e2e
              trouble-shooting. While listed as an optional header, some content
              providers consider this to be mandatory.
            title: X-Request-Id
          description: >-
            Unique request id generated by the reseller. Useful for e2e
            trouble-shooting. While listed as an optional header, some content
            providers consider this to be mandatory.
        - name: X-Operation-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Reseller-generated unique id per operation. Used by some content
              providers to identify an idempotent retry. While listed as an
              optional header, some content providers consider this to be
              mandatory.
            title: X-Operation-Id
          description: >-
            Reseller-generated unique id per operation. Used by some content
            providers to identify an idempotent retry. While listed as an
            optional header, some content providers consider this to be
            mandatory.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EntitlementAccountRecoveryRequest'
            examples:
              Base request:
                value:
                  resellerKey: BANGO_TEL
                  requestType: ACCOUNT_RECOVERY
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountRecoveryResponse'
              examples:
                Success:
                  value:
                    responseCode: Ok
                    responseMessage: Success
                    recoveryUrl: https://example.activation.url.bango.com
                    expiryTs: '2024-06-17T20:38:39Z'
        '400':
          description: Bad Request
          content:
            application/json:
              examples:
                Bad request:
                  value:
                    responseCode: BAD_REQUEST
                    responseMessage: Invalid request.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              examples:
                Not authorized:
                  value:
                    responseCode: UNAUTHORIZED
                    responseMessage: >-
                      You have not provided adequate credentials to access this
                      resource.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              examples:
                Not found:
                  value:
                    responseCode: NOT_FOUND
                    responseMessage: Resource not found
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Invalid State
          content:
            application/json:
              examples:
                Conflict:
                  value:
                    responseCode: INVALID_STATE
                    responseMessage: >-
                      The entitlement is not in the correct state to be
                      recovered.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Too Many Requests
          content:
            application/json:
              examples:
                Too many requests:
                  value:
                    responseCode: TOO_MANY_REQUESTS
                    responseMessage: Request limit has been reached
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              examples:
                Internal server error:
                  value:
                    responseCode: INTERNAL_ERROR
                    responseMessage: >-
                      The server encountered an unexpected condition which
                      prevented it from fulfilling the request.
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service Unavailable
          content:
            application/json:
              examples:
                Service unavailable:
                  value:
                    responseCode: SERVICE_UNAVAILABLE
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - XApiKey: []
        - BasicAuth: []
        - OAuth2: []
components:
  schemas:
    EntitlementAccountRecoveryRequest:
      properties:
        resellerKey:
          type: string
          title: Resellerkey
          description: Static value representing the reseller on the Bango system
          examples:
            - BANGO_TEL
        requestType:
          $ref: '#/components/schemas/RecoveryRequestType'
          description: |
            The type of account recovery required

            * `ACCOUNT_RECOVERY`
            * `ACCOUNT_UNLINK`
      type: object
      required:
        - resellerKey
        - requestType
      title: EntitlementAccountRecoveryRequest
      description: Account recovery request.
    AccountRecoveryResponse:
      properties:
        responseCode:
          type: string
          title: Responsecode
          description: Result of the account recovery request.
          examples:
            - Ok
        responseMessage:
          type: string
          title: Responsemessage
          description: Response message of the account recovery request.
          examples:
            - Success
        recoveryUrl:
          type: string
          title: Recoveryurl
          description: >-
            The url the customer should be redirected to in order to recover
            their account.
          examples:
            - https://example.activation.url.bango.com
        expiryTs:
          type: string
          format: date-time
          title: Expiryts
          description: Timestamp for when the recovery url expires. UTC ISO 8601 format.
          examples:
            - '2024-06-17T20:38:39Z'
      type: object
      required:
        - responseCode
        - responseMessage
      title: AccountRecoveryResponse
      description: Account recovery response.
    ErrorResponse:
      properties:
        responseCode:
          type: string
          title: Responsecode
          description: >-
            Bango code that identifies the error, for example `BAD_REQUEST`,
            `NOT_AVAILABLE`, `NOT_FOUND`, `INVALID_STATE` or `INTERNAL_ERROR`.
            See the examples on each response for the codes that the operation
            can return.
          examples:
            - BAD_REQUEST
        responseMessage:
          type: string
          title: Responsemessage
          description: Description of the error
        metadata:
          $ref: '#/components/schemas/ErrorMetadata'
          title: Metadata
          description: Error Metadata
      type: object
      required:
        - responseCode
      title: ErrorResponse
      description: Error response for Entitlement API.
    RecoveryRequestType:
      type: string
      enum:
        - ACCOUNT_RECOVERY
        - ACCOUNT_UNLINK
      title: RecoveryRequestType
      description: The type of account recovery required.
    ErrorMetadata:
      properties:
        responseMessageFrom:
          $ref: '#/components/schemas/ErrorOriginator'
          description: |
            The originator of the error (either Bango or the content provider)

            * `BANGO`
            * `MERCHANT`
      type: object
      required:
        - responseMessageFrom
      title: ErrorMetadata
      description: Error metadata.
    ErrorOriginator:
      type: string
      enum:
        - BANGO
        - MERCHANT
      title: ErrorOriginator
      description: Error originator.
  securitySchemes:
    XApiKey:
      type: apiKey
      in: header
      name: x-api-key
    BasicAuth:
      type: http
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        Bango uses
        https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/.
        Please note that when requesting a token, we only support the option to
        send the client secret in the request body. The token URL is for
        production. In the sandbox, use the sandbox authentication service at
        https://sandbox.auth.bango.com.
      flows:
        clientCredentials:
          scopes:
            any: >-
              grants Bango access to the merchant system based on merchant
              defined rules
          tokenUrl: https://auth.bango.com/oauth2/token

````

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