# PostAccountLinks

From **Stripe API**.

`POST /v1/account_links`

<p>Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow.</p>

## Request body

- Required: true
### `application/x-www-form-urlencoded`

- Type: `object`

```json
{"additionalProperties":false,"properties":{"account":{"description":"The identifier of the account to create an account link for.","maxLength":5000,"type":"string"},"collect":{"description":"Which information the platform needs to collect from the user. One of `currently_due` or `eventually_due`. Default is `currently_due`.","enum":["currently_due","eventually_due"],"type":"string"},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"refresh_url":{"description":"The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user.","type":"string"},"return_url":{"description":"The URL that the user will be redirected to upon leaving or completing the linked flow.","type":"string"},"type":{"description":"The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`.","enum":["account_onboarding","account_update"],"type":"string","x-stripeBypassValidation":true}},"required":["account","type"],"type":"object"}
```

## Security

### `basicAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `basic`
Send credentials in the `Authorization` request header using the `Basic` scheme.

Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>

### `bearerAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `bearer`
- Bearer format: `auth-scheme`
Send the token in the `Authorization` request header using the `Bearer` scheme.

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

## Responses

### `200`

Successful response.

### `application/json`

- Type: `object`

Account Links are the means by which a Connect platform grants a connected account permission to access
Stripe-hosted applications, such as Connect Onboarding.

Related guide: [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding).

```json
{"description":"Account Links are the means by which a Connect platform grants a connected account permission to access\nStripe-hosted applications, such as Connect Onboarding.\n\nRelated guide: [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding).","properties":{"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"expires_at":{"description":"The timestamp at which this account link will expire.","format":"unix-time","type":"integer"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["account_link"],"type":"string"},"url":{"description":"The URL for the account link.","maxLength":5000,"type":"string"}},"required":["created","expires_at","object","url"],"title":"AccountLink","type":"object","x-expandableFields":[],"x-resourceId":"account_link"}
```

### `default`

Error response.

### `application/json`

- Type: `object`

An error response from the Stripe API

```json
{"description":"An error response from the Stripe API","properties":{"error":{"$ref":"#/components/schemas/api_errors"}},"required":["error"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url https://api.stripe.com/v1/account_links \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "account": "string",
  "collect": "string",
  "expand": [
    "string"
  ],
  "refresh_url": "string",
  "return_url": "string",
  "type": "string"
}'
```
