# Accept Link Request

Accept a request to link your company with another organization. Both organizations are emailed when the link starts.

`POST https://connect.mindcloud.co/v2/link-requests/:requestId/accept`

Permissions: `company:parent:manage`.

## Parameters

### Path

- `requestId` (string, required): The link request's id, from List Link Requests.

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

## Example request

```bash
curl --request POST \
  --url 'https://connect.mindcloud.co/v2/link-requests/clr_4fT9kQ2mXbLp/accept' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{}'
```

## Response fields

- `id` (string): Unique id of the link request.
- `direction` (string): outgoing when your company sent it, incoming when another organization sent it to you.
  Allowed values:
    - `incoming`
    - `outgoing`
- `side` (string): The side your company takes if it is accepted: parent or child.
  Allowed values:
    - `parent`
    - `child`
- `parentCompanyId` (string): The organization that would become the parent.
- `parentCompanyName` (string): That organization's name.
- `childCompanyId` (string): The organization that would become the child.
- `childCompanyName` (string): That organization's name.
- `status` (string): pending (waiting for the receiving organization), accepted (the organizations are linked), declined, canceled (the sender withdrew it), or expired (not answered in time; send a new one).
  Allowed values:
    - `pending`
    - `accepted`
    - `declined`
    - `canceled`
    - `expired`
- `expiresOn` (date): When a pending request stops being answerable.
- `respondedOn` (date): When it was accepted, declined, or canceled.
- `createdOn` (date): When it was sent.

## Errors

- 409 Already answered: `CONFLICT` / `COMPANY_LINK_REQUEST_CLOSED` "This request was already answered or withdrawn."
