> ## Documentation Index
> Fetch the complete documentation index at: https://plai-a079b342.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ad Account Connection

> This endpoint generates a link that allows users to seamlessly connect their Ad accounts for the purpose of creating advertisements.

## Request Body

<ParamField body="userId" type="string" required>
  User Id, If not already created, make a user on [create user
  page](/api-reference/endpoint/auth/create_user) first. If already created,
  retrieve the user ID from [get profile
  page](/api-reference/endpoint/auth/get_profile).
</ParamField>

<ParamField body="platform" type="string" initialValue="FACEBOOK" required>
  For Facebook or Instagram, set `platform = FACEBOOK`, for LinkedIn, set
  `platform = LINKEDIN`, for Google, set `platform = GOOGLE`.
</ParamField>

<ParamField body="redirectUri" type="URL">
  The URL users are redirected to after linking their accounts
</ParamField>

<ParamField body="state" type="string">
  State, (if you want to send object make sure it is stringify)
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indicates that the HTTP response was successful (status code 200 OK).
</ResponseField>

<ResponseField name="results" type="object">
  <Expandable title="Results">
    <ResponseField name="success" type="boolean">
      Indicates whether the specific operation or API action was successful.
    </ResponseField>

    <ResponseField name="link" type="string">
      Generated URL with parameters and redirect URL
    </ResponseField>

    <ResponseField name="error" type="string">
      Error message if something went wrong
    </ResponseField>
  </Expandable>
</ResponseField>
