> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/l/linear.md).

# Linear

|                           |                                |
| ------------------------- | ------------------------------ |
| Category                  | Project management             |
| Asset types               | Users                          |
| Authentication            | Personal API key               |
| Direction                 | OctoXLabs → Linear (read only) |
| Supported Linear versions | Not specified                  |
| Available since           | Not specified                  |

Linear is an issue tracking and project management tool. OctoXLabs reads the users of your Linear workspace through the GraphQL API and adds them to the user inventory.

## Use cases

* **Find Linear admins.** List users that have the admin flag.

```
Adapters = linear AND AdminStatus = true
```

* **Find Linear users with no directory account.** List Linear users that are not found in Active Directory. How accounts are matched depends on your user merge settings.

```
Adapters = linear AND NOT Adapters = active-directory
```

## Before you begin

### Network

| Source              | Destination                       | Port               | Protocol |
| ------------------- | --------------------------------- | ------------------ | -------- |
| OctoXLabs connector | api.linear.app (Domain parameter) | 443 (configurable) | HTTPS    |

Clear **Is Secure?** to use HTTP.

### Required permissions

| Scope or role    | Permission          | Needed for    |
| ---------------- | ------------------- | ------------- |
| Personal API key | Read only is enough | Listing users |

The baseline says you may give the API key read only permission. It advises the **All teams you have access to** option under Team access.

## Create credentials in Linear

{% stepper %}
{% step %}

### Open Security and Access

In Linear settings, open the **Security and Access** menu.
{% endstep %}

{% step %}

### Create a key

In the **Personal API keys** section, click **Create API Key**. You may give it read only permission.
{% endstep %}

{% step %}

### Choose team access

Choose **All teams you have access to** in the Team access setting. Copy the key.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter  | Required | Type    | Default        | Description                                                  |
| ---------- | -------- | ------- | -------------- | ------------------------------------------------------------ |
| Domain     | No       | String  | api.linear.app | Domain of the Linear API.                                    |
| Port       | No       | Integer | 443            | Port number.                                                 |
| API Key    | Yes      | String  | None           | Linear personal API key. Sent in the `Authorization` header. |
| Is Secure? | No       | Boolean | True           | Connect over HTTPS.                                          |
| Timeout    | No       | Integer | 30             | Seconds to wait for an API response.                         |

## What the connection test does

The test sends a GraphQL query for one user. It passes when the API answers with status 200.

## API endpoints called

| Method | Path     | Purpose                                                                                                      |
| ------ | -------- | ------------------------------------------------------------------------------------------------------------ |
| POST   | /graphql | GraphQL query `users` (50 per page, cursor paging) with name, id, email, createdAt, active, admin and teams. |

## Fields fetched

| Linear field                                | OctoXLabs field            |
| ------------------------------------------- | -------------------------- |
| email                                       | Email (primary identifier) |
| Part of the email name before the first dot | FirstName                  |
| Part of the email name after the last dot   | LastName                   |
| admin                                       | AdminStatus                |
| createdAt                                   | CreatedTime                |

## Troubleshooting

| Error message                                                  | Cause                                                                                   | Fix                                                                                            |
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Status Code: `, followed by URL, Method and the response body` | The API answered with a status other than 200. This is the shared REST connector error. | Read the status code and body in the message, then check the credentials, permissions and URL. |

## Change history
