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

# Authorize With a Data Provider

> Use this endpoint to initiate the authorization process with a particular Data Provider.

Use this endpoint to initiate the authorization process with a particular Data Provider.

## Authorization Example

```url URL theme={null}
{{host}}//api/v1/authorize?client_id={{recipient_id}}&redirect_uri={{redirect_uri}}&state=abc&response_type=code&scope={{scope}}&provider_id={}
```

**Success Response:**

```url URL theme={null}
https://www.example.com/callback?
code=code
&state=state
```

**Failure Response:**

```url URL theme={null}
https://www.example.com/callback?
error=access_denied
&error_description=The user denied the access
&state=state
```

### How to handle an error response

If you receive an error response, refer to the [List of Authorization Errors](./errors) for more information about the error and how to resolve it.


## OpenAPI

````yaml /openapi-outbound-auth.yaml GET /api/v1/authorize
openapi: 3.0.3
info:
  title: Flinks Outbound Auth API
  description: |
    Flinks Outbound Authentication API.
    Endpoints for generating authorization tokens and authenticating requests.
  version: 3.0.0
servers:
  - url: https://{host}
    description: Flinks Outbound Auth Server
    variables:
      host:
        default: '{host}'
        description: Host URL
security: []
tags:
  - name: Authorization
    description: Endpoints for generating authorization tokens and authenticating requests
paths:
  /api/v1/authorize:
    get:
      tags:
        - Outbound
      summary: Authorize With a Data Provider
      description: >-
        Use this endpoint to initiate the authorization process with a
        particular Data Provider.
      operationId: authorizeWithDataProvider
      parameters:
        - name: client_id
          in: query
          required: true
          description: >-
            The ID of the Data Recipient that you want to initiate the
            authorization process with.
          schema:
            type: string
        - name: redirect_uri
          in: query
          required: true
          description: The URI to redirect to after authorization is complete.
          schema:
            type: string
        - name: state
          in: query
          required: true
          description: >-
            A randomly generated, unique string that's linked to this particular
            request. This adds an extra layer of security and is an OAuth 2.0
            standard. For the request to be successful, this string must be
            validated to confirm it's being passed with the correct request.
          schema:
            type: string
        - name: response_type
          in: query
          required: true
          description: >-
            Tells your server the type of response it can expect to receive from
            this request. For this use case, pass `code` as the value for this
            field to tell your server that you're sending an authorization code.
          schema:
            type: string
            default: code
        - name: scope
          in: query
          required: true
          description: >
            The scope of data that the Data Recipient collects from the
            customer, and is populated on the consent screen. To work with this
            Data Recipient, the customer must provide consent to share the scope
            of data they require. Possible values include:

            - `ACCOUNT_BASIC` - Basic account information

            - `ACCOUNT_DETAILED` - Detailed account information

            - `ACCOUNT_PAYMENTS` - Payment information linked to the account

            - `INVESTMENTS` - Investment information linked to the account

            - `STATEMENTS` - PDF statements for the account

            - `CUSTOMER_CONTACT` - Business contact information for the account

            - `CUSTOMER_PERSONAL` - Information about the customer who owns the
            account

            - `TRANSACTIONS` - List of transactions for the account


            This is a space separated list. The minimum scope required is
            `ACCOUNT_BASIC`.
          schema:
            type: string
        - name: provider_id
          in: query
          required: true
          description: The ID of the Data Provider that you are authorizing.
          schema:
            type: string
        - name: correlation_id
          in: query
          description: >-
            A randomly-generated, unique identifier that correlates two or more
            requests.
          schema:
            type: string
        - name: lang
          in: query
          description: |
            The language that you want to display on the consent screen:
            - `en` - English
            - `fr` - French

            If this field is left empty, the default value is English.
          schema:
            type: string
            default: en
      responses:
        '302':
          description: >
            Upon successful authorization, the user is redirected to the
            `redirect_uri` with a `code` parameter containing the authorization
            code and the `state` parameter.


            If authorization fails, the user is redirected to the `redirect_uri`
            with `error`, `error_description`, and `state` parameters.
          content:
            application/json:
              schema:
                type: object

````