Managing Customers
The Customers requests feature allows you to manage customers and requests inside of Linear.
Data Models
The Customer requests relies on two objects: Customer
and CustomerNeed
.
Customer
Customer
The Customer
object represents an external company.
Fields
id
string
The id of the Customer in Linear.
name
string
The name of the Customer.
logoUrl
string
domains
string[]
The list of domains associated with the Customer. Only apex domains are supported. Domains associated with public email providers are not allowed. Only contains distinct values.
externalIds
string[]
A list of external ids associated with the Customer in various external systems. Only contains distinct values.
slackChannelId
string
The id of the Slack channel this customer has been associated with, if any. Requests coming from this channel will be automatically associated with this Customer.
revenue
number
The annual revenue of the Customer, if available.
size
number
The size of the Customer.
This could be used to either represent the number of employees, or the number of seats or subscriptions this Customer represents. Note that some integrations like Intercom will default to using this field to represent a number of employees.
tier
uuid
Id of the CustomerTier associated with the Customer.
status
uuid
Id of the CustomerStatus associated with the Customer.
CustomerNeed
CustomerNeed
The CustomerNeed
object represents a customer request. It is attached to an Issue
and optionally, to a specific Customer
.
Fields
customerId
uuid
The id of the Customer in Linear this request is associated with. Can be undefined
if the request is not attached to a Customer.
issueId
uuid
The id of the Issue
this request is associated with.
attachmentId
uuid
The id of the Attachment
this request is associated with. All requests with a source URL are backed by an Attachment
.
priority
number
Whether the customer request is important or not. 0 = Not important, 1 = Important.
body
string
An optional content for the request, in markdown format.
creatorId
uuid
The id of the Linear user who created the request.
Create a Customer
The customerCreate
mutation allows to create a customer through the API:
Basic customer:
Customer with metadata
The following request creates a customer with additional metadata:
tierId
is the id of Linear tier this customer is associated with. Tiers must be created with mutationcustomerTierCreate
before they can be used with a CustomerexternalIds
contains a list of all unique external identifiers for this Customer. It can be the uuid of the Customer in your own database or any other external system you are getting customer information from. Setting this value allows to refer to this customer by this specific external id when creating customer requests rather than the Linear defined Customer id.domains
must contain unique values and cannot contain any public email provider.
Create a Customer Request
Once a Customer has been created, it is possible to use it to create a Customer Request on a specific issue.
Alternatively, it is possible to use one of the external id of the Customer to attach the request to the Customer:
When passing an url
to the input, an Attachment
will be created and attached to the request:
Update a Customer
The customerUpdate
mutation allows to update a Customer. Linear will automatically attempt to match created Customers against customers in your integrations (Intercom, Zendesk or Front). When a match happens, the Customer object in Linear becomes managed by the integration and only certain fields can be updated:
Customers managed by Intercom:
Customers managed by Zendesk or Front:
If you are building an integration with Linear and need to manage or operate with Customers that could have been created by other integrations, please refer to the Upsert Customers section
Upsert Customers
Customers get created automatically when an issue is created from one of the supported sources: Intercom, Zendesk, Front, Email intake or Slack. If you are building an integration that will create Customer Requests and associate them with Customers, it is likely that you will encounter the case where the request should be attached to a Customer that's been already created by another integration. As there is a uniqueness constraint on domains
, you cannot create a duplicate Customer in Linear. Instead, you must re-use this existing Customer. The customerUpsert
mutation allows you to append domains and external identifiers to an existing Customer and contribute to its definition.
Starting with the following Customer, assuming it has been created by the Intercom integration
It is possible to upsert this existing Customer with your integration's own definition:
Your integration's Customer id has been appended to the list of externalIds
of the Customer, after it matched by domain. If there had been no match, a new Customer would have been created.
This allows your integration to push Customers into Linear without having to check ahead of time if there is already an existing Customer for the same domains. Either the Customer does not exist and will be created, either it exists already and will be reused. The domains
and externalIds
will be merged.
Your integration can then attach Customer Requests using your integration's customer id:
Last updated