# Connect Facebook Page to Account

```http
POST https://api.synup.com/api/v4/connected-accounts/connect-facebook
```

This API initiates the process of connecting a new Facebook Page account to the system. The response provides a URL for the user to complete Facebook’s OAuth authentication flow.

**Important Notes:**
- The response includes a URL that the user must visit to authenticate and connect their Facebook Page account.
- The provided URL is valid for 24 hours.
- When the user accesses the URL, they are redirected to Facebook’s OAuth authentication flow.
- During OAuth, the user must:
    - Review and accept Facebook’s terms and conditions.
    - Grant necessary permissions for integration.
- After OAuth authentication:
    - If successful, the user is redirected to the successUrl specified in the request.
    - If permissions are declined or the process fails, the user is redirected to the errorUrl.

Source: https://developer.synup.com/api/connected-accounts/connect-facebook-page-to-account

## Header parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Content-Type` | string | required |  |

## Request body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `input` | object | optional |  |
| `input.errorUrl` | string | required | Redirect URL in case of Error |
| `input.successUrl` | string | required | Redirect URL in case of Success |

## Example request

```bash
curl -X POST 'https://api.synup.com/api/v4/connected-accounts/connect-facebook' \
  -H 'Authorization: API YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "input": {
    "errorUrl": "http://www.errorurl.com",
    "successUrl": "http://www.successurl.com"
  }
}'
```

## Responses

| Status | Description |
| --- | --- |
| `200` | Successfully generated connection URL |
| `400` | Bad request - invalid input |
