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

# Migrate Token for a Linked Account

This API is used to Migrate Auth Object (API keys, Access Tokens, etc;) of an application to an integration in Refold.

## Request description

#### Headers

<ParamField header="linked_account_id" type="string" required>
  Unique customer identification id. For Eg: [markwood@some\_email.com](mailto:markwood@some_email.com)
</ParamField>

#### Body Parameters

<ParamField body="auth_object" type="object" required>
  An object containing the details of your application associated with your account

  <Expandable title="Example properties">
    <ResponseField name="bot_token" type="string">
      Example property: Eg: for `slack` - Bot Token
    </ResponseField>

    <ResponseField name="workspace_token" type="string">
      Example property: Eg: for `slack` - workspace\_token
    </ResponseField>
  </Expandable>
</ParamField>

<ParamField path="slug" type="string" required>
  Application slug. For Eg: `slack`
</ParamField>

## Response description

<Tabs>
  <Tab title="200">
    <ResponseField name="success" type="boolean">
      Success status
    </ResponseField>

    <ResponseField name="message" type="string">
      Success message
    </ResponseField>
  </Tab>

  <Tab title="Error response">
    <ResponseField name="status_code" type="integer">
      System generated status Code
    </ResponseField>

    <ResponseField name="error_type" type="string">
      System generated error type
    </ResponseField>

    <ResponseField name="message" type="string">
      Error message
    </ResponseField>

    <ResponseField name="request_id" type="string">
      System generated request id
    </ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```JSON 200 theme={null}
  {
      "success": true,
      "message": "Integration - slack created"
  }
  ```

  ```JSON 200 theme={null}
  {
      "success": true,
      "message": "Integration - slack updated"
  }
  ```

  ```JSON 400 theme={null}
  {
      "status_code": 400,
      "http_error_type": "BAD_REQUEST",
      "error_code": "SERVER_ERROR",
      "message": "linked account with id account_id does not exist in test environment",
      "request_id": "90e83618-5743-4953-92cb-675220470272"
  }
  ```

  ```JSON 400 theme={null}
  {
      "status_code": 400,
      "http_error_type": "BAD_REQUEST",
      "error_code": "SERVER_ERROR",
      "message": "auth_object values must be valid strings",
      "request_id": "212047f0-df39-4ef2-abc1-7e66495643c4"
  }
  ```

  ```JSON 400 theme={null}
  {
      "status_code": 400,
      "http_error_type": "BAD_REQUEST",
      "error_code": "SERVER_ERROR",
      "message": "access_token and/or refresh_token only permitted in auth_object for OAuth2 based applications",
      "request_id": "ea455085-d124-4cea-aae1-6defe1cc3b30"
  }
  ```

  ```JSON 400 theme={null}
  {
      "status_code": 400,
      "http_error_type": "BAD_REQUEST",
      "error_code": "SERVER_ERROR",
      "message": "server_url,api_key only permitted in auth_object of auth_type: key_based for application app_name.",
      "request_id": "4c4a494b-250c-46c5-95d4-b8f1def56f01"
  }
  ```

  ```JSON 401 theme={null}
  {
      "status_code": 401,
      "http_error_type": "UNAUTHORIZED",
      "error_code": "SERVER_ERROR",
      "message": "Invalid Credentials"
      "request_id": "89bd1675-a826-46cb-9210-6cb2ae169f67"
  }
  ```
</ResponseExample>
