API & MCP

Build around the workspace you already use

Use scoped API keys to connect your own software or an MCP client. Work with records, agents, approvals, tasks and workspace information through documented interfaces.

API & MCP

Give the integration only what it needs

Choose the permissions the integration requires. Keep the secret in your server or client configuration.

REST API · Read workspace identity
curl https://app.lineer.ai/api/v1/whoami \
  -H "Authorization: Bearer $LINEER_API_KEY"

REST reference

Authentication, pagination, errors and endpoint details are included below.

MCP guide

Connect a client and review the tools exposed by its key.

Shared permissions

Both interfaces use workspace-scoped keys.

In your workflow

Scoped access

Grant the specific capabilities the integration needs. Revoke a credential when the integration is no longer needed. Review approvals and agent work in the same product interface.

Northstar Supplies

Primary contact
Alex Morgan
Service
Logistics
Renewal
September 30, 2026
Annual spend
$24,000

Example custom record

Getting started

  1. 01

    Create a workspace key

    Choose the permissions the integration requires. Keep the secret in your server or client configuration.

  2. 02

    Read the schema

    Discover the workspace’s record types and fields before creating or updating records.

  3. 03

    Choose REST or MCP

    Call HTTP endpoints from your code, or connect a compatible assistant to the MCP server.

  4. 04

    Review consequential actions

    Sending, starting agents and deleting data have explicit permissions and effects.

25 available scopes · 41 REST operations · 32 MCP tools

REST API reference

Go to MCP guide

Getting started

Every request needs an API key. Keys belong to a workspace, not to a person, so they keep working after the person who created them leaves.

  1. 1 In the app, open Settings, API Keys, then New key. You need to be an owner or an admin.
  2. 2 Tick the permissions the integration needs. Nothing is granted by default.
  3. 3 Copy the key. It is shown once and cannot be recovered. If you lose it, delete the key and make another.

Base URL

https://app.lineer.ai/api/v1

Your first request

/whoami needs no permissions, so it works with any key. It answers which workspace the key belongs to and what it may do.

cURL
curl https://app.lineer.ai/api/v1/whoami \
  -H "Authorization: Bearer $LINEER_API_KEY"
Response
{
  "workspaceId": "ws_8fJ2kQ",
  "keyId": "Kyq5lIHq",
  "principal": "api_key",
  "scopes": ["objects:read", "objects:write", "tasks:read"]
}

Authentication

Send the key as a bearer token on every request. Keys look like ln_live_<id>_<secret>.

Authorization: Bearer ln_live_Kyq5lIHq_XCoYVdT8mPFjU...

The workspace is part of the key, so no request takes a workspace parameter and a key cannot be pointed at another workspace. A missing, malformed, unknown, expired or deleted key all return the same 401.

Keep keys server-side. A key carries every permission it was granted, with no user behind it to prompt for confirmation. Put it in an environment variable, never in a browser bundle or a mobile app.

Scopes

A key holds exactly the permissions someone ticked when creating it. There is no default set, and permissions cannot be added to a key afterwards. Widening access means creating a new key.

Scopes marked below destroy data, spend credits, or reach real people.

CRM records

3

Contacts, companies, deals, segments and any custom types.

objects:read
List and fetch records.
objects:write
Add new records and edit existing ones.
objects:delete Careful
Permanently delete records. There is no undo.

Schema

4

How this workspace models its data.

object_types:read
Field definitions for each record type.
object_types:write
Add or change types, fields, pipelines and tags.
objects_views:read
Saved filters and column layouts.
objects_views:write
Create and change saved views.

Inbox

5

Mailboxes and synced messages.

emails:read
Messages, threads, folders and unread counts.
emails:send Careful
Send and reply from this workspace's mailboxes. Reaches real people.
emails:delete Careful
Remove messages from Lineer. They stay in the provider mailbox.
mailboxes:read
Connected mailboxes and their send settings. Never credentials.
mailboxes:write Careful
Rename a mailbox and change unsubscribe and warming options.

Agents

5

Automated outreach.

agents:read
Agents, their prospects and progress.
agents:write
Configure agents without starting them.
agents:run Careful
Start and stop agents. Consumes credits and sends outreach.
agents:delete Careful
Delete an agent and every prospect thread under it.
agent_messages:read
Message threads between agents and prospects.

Approvals

3

Outbound email waiting for a human decision.

approvals:read
Pending drafts and their context.
approvals:draft
Change a pending draft without sending it.
approvals:respond Careful
Approving sends the email immediately.

Tasks

3

Follow-ups and reminders.

tasks:read
Open and completed tasks.
tasks:write
Add tasks, edit them and mark them done.
tasks:delete Careful
Permanently delete tasks. There is no undo.

Workspace

2

The workspace itself and who belongs to it.

members:read
Names, emails and roles. Needed to attribute tasks, agents and approvals to a person.
workspace:read
Workspace name, general settings and menu layout.

Pagination

List endpoints return up to page_size records, 25 by default and 100 at most, alongside a nextCursor. A null cursor means you have reached the end.

cURL
curl "https://app.lineer.ai/api/v1/objects/contact?page_size=2" \
  -H "Authorization: Bearer $LINEER_API_KEY"
Response
{
  "objects": [
    {
      "id": "obj_3nR7pW",
      "type": "contact",
      "data": {
        "email": "ada@example.com",
        "firstName": "Ada",
        "lastName": "Lovelace",
        "company": "Analytical Engines"
      },
      "url": "https://app.lineer.ai/o/contacts/obj_3nR7pW",
      "createdAt": "2026-03-02T09:14:21.882Z",
      "updatedAt": "2026-08-11T16:02:55.104Z"
    }
  ],
  "nextCursor": "MjAyNi0wOC0xMVQxNjowMjo1NS4xMDRafG9iaV8zblI3cFc"
}

Pass the cursor back to get the next page. Paging is keyset-based, so records created or updated while you page will not shift rows onto a page you already read.

cURL
curl "https://app.lineer.ai/api/v1/objects/contact?page_size=2&cursor=$CURSOR" \
  -H "Authorization: Bearer $LINEER_API_KEY"

On /objects/{type} you can also pass count=true for the total number of matching records, and filter and sort as JSON, using the same grammar as the saved views in the app.

Errors

Every error is JSON with an error field. Validation errors name what to fix.

Status Meaning
400The request is malformed, or a field or filter name does not exist on that type.
401The key is missing, malformed, unknown or expired.
403The key is valid but was not granted the scope this endpoint needs.
404No such record in this workspace. Records in other workspaces also return 404.
409The record already exists, or the agent is in a state this action does not apply to.
429The mailbox hit its daily send cap. Try the send again tomorrow.
502Sending or agent control could not reach the service behind it. Safe to retry.

A missing scope

403
{
  "error": "Insufficient scope",
  "required": "objects:write",
  "granted": ["objects:read", "tasks:read"]
}

A field that does not exist

400
{
  "error": "Unknown fields for type 'contact': emial",
  "knownFields": ["email", "firstName", "lastName", "company", "title"]
}

Endpoint reference

All paths are relative to https://app.lineer.ai/api/v1.

CRM records

6
Method Path Scope What it does
GET /objects/{type} objects:read List records. Filterable, sortable, paginated.
POST /objects/{type} objects:write Create a record.
GET /objects/{type}/{id} objects:read Fetch one record.
PATCH /objects/{type}/{id} objects:write Update a record.
DELETE /objects/{type}/{id} objects:delete Delete a record. No undo.
PUT /objects/{type}/by-natural-key/{value} objects:write Create or update by email (contacts) or name (companies). Safe to retry.

Schema

7
Method Path Scope What it does
GET /object-types object_types:read Every record type and its fields.
PATCH /object-types/{type} object_types:write Change a type's fields.
GET /views objects_views:read Saved views.
POST /views objects_views:write Create a saved view.
GET /views/{id} objects_views:read One saved view.
PATCH /views/{id} objects_views:write Update a saved view.
DELETE /views/{id} objects_views:write Delete a saved view.

Inbox

8
Method Path Scope What it does
GET /emails emails:read Synced messages, newest first.
POST /emails emails:send Send a message. Reaches real people.
GET /emails/{id} emails:read One message, including its body.
DELETE /emails/{id} emails:delete Remove Lineer's copy. The provider keeps its own.
POST /emails/{id}/reply emails:send Reply on the message's thread.
GET /mailboxes mailboxes:read Connected mailboxes.
GET /mailboxes/{id} mailboxes:read One mailbox and its send settings.
PATCH /mailboxes/{id} mailboxes:write Rename, or change unsubscribe and warming options.

Agents

9
Method Path Scope What it does
GET /agents agents:read Campaigns and their prospect threads.
POST /agents agents:write Create an agent. Requires userId.
GET /agents/{id} agents:read One agent.
PATCH /agents/{id} agents:write Update an agent's configuration.
DELETE /agents/{id} agents:delete Delete an agent and every thread under it.
POST /agents/{id}/start agents:run Start a campaign. Consumes credits and sends outreach.
POST /agents/{id}/stop agents:run Pause a running campaign.
GET /agents/{id}/messages agent_messages:read The conversation under an agent, prospect threads folded in.
GET /campaigns/analysis agents:read Campaign results as CSVs. Also needs agent_messages:read and emails:read.

Approvals

4
Method Path Scope What it does
GET /approvals approvals:read Drafts waiting on a decision.
GET /approvals/{id} approvals:read One approval and its context.
PATCH /approvals/{id} approvals:draft Edit a draft without sending it.
POST /approvals/{id}/respond approvals:respond Approve or reject. Use queue: true for throttled release instead of an immediate send.

Tasks

5
Method Path Scope What it does
GET /tasks tasks:read Open and completed tasks.
POST /tasks tasks:write Create a task. Requires userId.
GET /tasks/{id} tasks:read One task.
PATCH /tasks/{id} tasks:write Update a task or mark it done.
DELETE /tasks/{id} tasks:delete Delete a task. No undo.

Workspace

3
Method Path Scope What it does
GET /whoami None Which workspace this key belongs to and what it may do.
GET /workspace workspace:read Workspace name and settings.
GET /members members:read People in the workspace. Use these ids for userId.

Writing without duplicates

Syncing from another system usually means "create this contact, or update it if we already have it". Use the natural key endpoint, which matches on email for contacts and name for companies. Running it twice produces one record, so a retry after a timeout is safe.

cURL
curl -X PUT \
  "https://app.lineer.ai/api/v1/objects/contact/by-natural-key/ada@example.com" \
  -H "Authorization: Bearer $LINEER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "data": { "firstName": "Ada", "company": "Analytical Engines" } }'

Endpoints that need a person

A key has no user of its own, so creating a task or an agent, starting a campaign, and responding to an approval all take a userId naming the workspace member the action belongs to. GET /members lists the ids you can use.

Limits

Page size
100 records per request. Page with the cursor to read more.
Sending
Each mailbox has a daily send cap, set in the app. Sends past it return 429. The API cannot raise the cap.
Expiry
You choose an expiry when creating a key, or none. To rotate without downtime, create the new key first: both work until the old one expires.
Campaign analysis
Up to 5 campaigns per request.

Connecting an AI client?

The same key works with the MCP server, which exposes these endpoints as tools an AI assistant can call directly.

Read the MCP guide

Getting started

MCP is how AI clients call tools. Point one at this server and it can read your CRM, look through the inbox, check on agents and act on approvals, in conversation, without you writing any integration code.

It uses the same API key as the REST API. Create one in the app under Settings, API Keys, granting only the permissions you want the assistant to have.

Server URL

https://app.lineer.ai/api/mcp

Transport is Streamable HTTP. The server keeps no session, so there is nothing to reconnect and nothing to expire except the key itself.

Connect a client

The server authenticates with a bearer key, so the client has to let you set a request header. That is a config file in most clients, and the two forms below cover nearly all of them.

Claude's web connector dialog will not work

Adding a custom connector at claude.ai asks for a URL and, optionally, OAuth client credentials. It has no field for a request header, and Lineer does not run an OAuth server, so there is no way to pass the key. Connect from Claude Code or Claude Desktop instead, both below.

Claude Code

Terminal
claude mcp add --transport http lineer https://app.lineer.ai/api/mcp \
  --header "Authorization: Bearer $LINEER_API_KEY"

Claude Desktop and other config-file clients

These take a config file holding the server URL and its headers. The shape varies slightly between clients; the URL and the Authorization header do not.

JSON
{
  "mcpServers": {
    "lineer": {
      "type": "http",
      "url": "https://app.lineer.ai/api/mcp",
      "headers": {
        "Authorization": "Bearer ln_live_Kyq5lIHq_XCoYVdT8mPFjU..."
      }
    }
  }
}

Check it works

Ask for the tool list. What comes back is what your key can do, so this doubles as a check on the permissions you granted.

cURL
curl -X POST https://app.lineer.ai/api/mcp \
  -H "Authorization: Bearer $LINEER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }'

Tools

32 tools, each mapping to a REST endpoint and its permission. A client only sees the ones its key covers, so a read-only key never lists a tool that writes.

CRM records

7
Tool Scope What it does
lineer_query_objects objects:read Search and filter records of a type.
lineer_count_objects objects:read How many records match, without listing them.
lineer_get_object objects:read One record by id.
lineer_create_object objects:write Create a record.
lineer_update_object objects:write Update a record.
lineer_upsert_object_by_natural_key objects:write Create or update by email or name. Safe to repeat.
lineer_delete_object objects:delete Delete a record. No undo.

Schema

2
Tool Scope What it does
lineer_list_object_types object_types:read Record types and their fields. Worth calling first.
lineer_list_views objects_views:read Saved views and their filters.

Inbox

3
Tool Scope What it does
lineer_list_emails emails:read Messages, filtered by mailbox, folder or thread.
lineer_get_email emails:read One message, including its body.
lineer_list_mailboxes mailboxes:read Connected mailboxes.

Agents

9
Tool Scope What it does
lineer_list_agents agents:read Campaigns and their prospect threads.
lineer_get_agent agents:read One agent and its progress.
lineer_get_agent_conversation agent_messages:read What an agent said and what came back.
lineer_create_agent agents:write Create an agent without starting it.
lineer_update_agent agents:write Change an agent's configuration.
lineer_start_agent agents:run Start a campaign. Consumes credits and sends outreach.
lineer_stop_agent agents:run Pause a running campaign.
lineer_delete_agent agents:delete Delete an agent and every thread under it.
lineer_analyze_campaign agents:read Campaign results as CSVs. Also needs agent_messages:read and emails:read.

Approvals

4
Tool Scope What it does
lineer_list_approvals approvals:read Drafts waiting on a decision.
lineer_get_approval approvals:read One approval and its context.
lineer_edit_approval_draft approvals:draft Change a draft without sending it.
lineer_respond_to_approval approvals:respond Approve or reject. Approval sends immediately unless queue is true for throttled release.

Tasks

5
Tool Scope What it does
lineer_list_tasks tasks:read Open and completed tasks.
lineer_get_task tasks:read One task.
lineer_create_task tasks:write Create a task.
lineer_update_task tasks:write Update a task or mark it done.
lineer_delete_task tasks:delete Delete a task. No undo.

Workspace

2
Tool Scope What it does
lineer_list_members members:read People in the workspace.
lineer_get_workspace workspace:read Workspace name and settings.

Some permissions have no tool, because they belong in the app rather than in a conversation: sending and deleting email, editing mailbox settings, and changing object types or saved views. Grant those to a key and the tool list stays the same.

What the model can do

The key decides, not the client. Filtering the tool list is a convenience for the model; every call is checked again on the way through, so a tool invoked by name without appearing in the list is still refused.

Two permissions act on the outside world

approvals:respond approves a draft, which sends it to a real person and cannot be recalled. agents:run starts a campaign, which spends credits and begins outreach. Leave both off unless the assistant is meant to do those things, and keep the approval step with a person if you want a human deciding what goes out.

A key belongs to one workspace, and no tool takes a workspace argument, so an assistant connected to one workspace cannot read or change another.

Protocol

JSON-RPC 2.0 over HTTP POST. The server implements initialize, ping, tools/list and tools/call. It declares tools and nothing else, so a client will not probe for resources or prompts that do not exist.

Protocol versions 2025-06-18, 2025-03-26, 2024-11-05
Transport Streamable HTTP, stateless. POST only.
Batching Not supported. Send one request per call.

Calling a tool

Request body
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "lineer_query_objects",
    "arguments": {
      "type": "contact",
      "filter": [{ "field": "company", "op": "eq", "value": "Analytical Engines" }],
      "page_size": 10
    }
  }
}

A tool that runs and fails returns a successful response carrying the error message, so the model can read what went wrong and correct its next call. Protocol errors are reserved for malformed requests and unknown methods.

Building an integration instead?

Every tool here is a REST endpoint underneath, with the same permissions and the same responses.

Read the REST reference

Keep exploring

See how it fits your work

Walk through your records, mailboxes and approval process with the Lineer team.