# GetSales API

The GetSales API lets you manage your CRM data, automations, messaging, AI agents, and integrations programmatically.

## Authentication

All requests require two headers:

| Header | Description |
|--------|-------------|
| `Authorization` | `Bearer {API_KEY}` — your API key from Workspace Settings → API Keys |
| `Team-ID` | Your team (workspace) ID |

## Rate Limits

300 requests per minute per API key.

## Pagination

All list endpoints support the following parameters:

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `limit` | integer | 20 | Items per page (max 100) |
| `offset` | integer | 0 | Number of items to skip |
| `order_field` | string | `created_at` | Field to sort by |
| `order_type` | string | `desc` | Sort direction: `asc` or `desc` |

List responses return:
```json
{
  "data": [...],
  "limit": 20,
  "offset": 0,
  "total": 150,
  "has_more": true
}
```

## Errors

All errors follow a consistent format:
```json
{
  "error": {
    "reason": "validation_error",
    "message": "The name field is required.",
    "data": {}
  },
  "message": "Validation failed",
  "code": 422
}
```

| Code | Reason | Description |
|------|--------|-------------|
| 400 | `bad_request` | Missing required headers or malformed request |
| 401 | `auth_exception` | Invalid or expired API key |
| 402 | `payment_required` | Insufficient credits |
| 403 | `access_denied` | No access to this resource |
| 422 | `validation_error` | Request body validation failed |


Version: 1.0.0

## Servers

Production
```
https://amazing.getsales.io
```

## Security

### bearerAuth

API key from Workspace Settings → API Keys. Pass as: `Authorization: Bearer {API_KEY}`

Type: http
Scheme: bearer
Bearer Format: JWT

### teamId

Your team (workspace) ID

Type: apiKey
In: header
Name: Team-ID

## Download OpenAPI description

[GetSales API](https://api.getsales.io/_bundle/bundled.yaml)

## User & Team

Current user profile and team management

### Get current user

 - [GET /id/api/users/current](https://api.getsales.io/bundled/user-and-team/getcurrentuser.md): Returns the authenticated user's profile, including personal info,
configuration preferences, and whitelabel context.

This is typically the first call you make after authenticating — use it
to verify credentials and retrieve the user's config.latest_team_id
for subsequent requests.

### List teams

 - [GET /id/api/teams](https://api.getsales.io/bundled/user-and-team/listteams.md): Returns a paginated list of teams (workspaces) the authenticated user
belongs to. Only teams where the user has an accepted invitation are returned.

Each team includes its current feature limits and credit balances,
which is useful for checking quotas before performing operations.

### Get team details

 - [GET /id/api/teams/{id}](https://api.getsales.io/bundled/user-and-team/getteam.md): Returns full details for a specific team, including feature limits,
credit balances, and configuration.

The authenticated user must be an accepted member of this team.
Returns 403 if the user does not have access.

## Leads (Contacts)

Create, search, update, and manage your contacts

### Upsert a contact

 - [POST /leads/api/leads/upsert](https://api.getsales.io/bundled/leads-(contacts)/upsertlead.md): Create a new contact or update an existing one. This is the primary import endpoint.

Deduplication logic: GetSales will try to find an existing contact by matching
(in priority order): ln_member_id, ln_id, sn_id, LinkedIn nickname, work_email,
personal_email, or name + company_name combination. If a match is found and
update_if_exists is true, the existing contact is updated.

Tags: Pass tags as an array of tag names inside the lead object.
Tags are created automatically if they don't exist yet. On creation, tags are
always applied. On update (update_if_exists: true), tags are added to the
existing contact's tag list (existing tags are preserved).

LinkedIn IDs: Use the universal linkedin_id field — pass any LinkedIn reference
(full profile URL, Sales Navigator URL, nickname, ln_id, sn_id) and the backend
auto-detects the format and writes it to the correct field. This is the recommended
approach. Individual fields (linkedin, ln_id, sn_id, ln_member_id) are also
supported if you know the exact ID type.

Every contact must belong to a list — pass list_uuid to specify which one.

### Search contacts

 - [POST /leads/api/leads/search](https://api.getsales.io/bundled/leads-(contacts)/searchleads.md): Search contacts with filters and pagination. Supports free-text search,
field-specific filters, and sorting.

The q filter field performs a full-text search across name, email, position,
headline, and about fields.

### Lookup a contact

 - [POST /leads/api/leads/lookup-one](https://api.getsales.io/bundled/leads-(contacts)/lookuponelead.md): Find a specific contact by a unique identifier. Provide at least one of:
linkedin_id, email, or a combination of name + company_name.

Returns null if no match is found (does not throw 404).

### Get contact by ID

 - [GET /leads/api/leads/{uuid}](https://api.getsales.io/bundled/leads-(contacts)/getleadbyuuid.md): Retrieve a single contact by UUID with full aggregation data including
markers, active flows, and custom field values.

### Update a contact

 - [PUT /leads/api/leads/{uuid}](https://api.getsales.io/bundled/leads-(contacts)/updatelead.md): Update an existing contact's fields. Only the provided fields are updated —
omitted fields are left unchanged.

Updatable fields: name, first_name, last_name, company_name,
position, headline, about, linkedin, facebook, twitter,
work_email, personal_email, work_phone_number, personal_phone_number,
raw_address, location, status, linkedin_status, email_status.

Custom fields can be updated via the custom_fields object.

### Delete a contact

 - [DELETE /leads/api/leads/{uuid}](https://api.getsales.io/bundled/leads-(contacts)/deletelead.md): Permanently delete a contact and all associated data (flow enrollments,
messages, tasks). This action cannot be undone.

### Count contacts

 - [POST /leads/api/leads/count](https://api.getsales.io/bundled/leads-(contacts)/countleads.md): Count contacts matching a filter without returning the full data.
Useful for dashboards or validating filters before bulk operations.

### Bulk action on contacts

 - [PUT /leads/api/leads/mass-action](https://api.getsales.io/bundled/leads-(contacts)/massactionleads.md): Perform a bulk operation on multiple contacts at once. Select contacts
by filter or by a list of UUIDs.

For large sets, the action is queued asynchronously and a mass_action tracking
object is returned. For small sets, it executes immediately.

Available action types:

| Type | Payload | Description |
|------|---------|-------------|
| contact_add_tags | added_tags: [string] | Add tags to contacts |
| contact_remove_tags | removed_tags: [string] | Remove tags |
| contact_replace_tags | tags: [string] | Replace all tags |
| contact_change_list | list_uuid: string | Move to a different list |
| contact_change_pipeline_stage | pipeline_stage_uuid: string | Change pipeline stage |
| contact_change_custom_field | custom_field_uuid, value | Set a custom field |
| contact_add_to_flow | flow_uuid: string | Enroll in a flow |
| contact_cancel_from_flows | flow_uuids: [string] | Cancel from flows |
| contact_assign_ai_agent | ai_agent_uuid: string | Assign AI agent |
| contact_cancel_ai_agent | — | Remove AI agent |
| contact_delete | reason: string | Delete contacts |
| contact_export_csv | — | Export to CSV |

## Companies (Accounts)

Manage company records

### List companies

 - [POST /leads/api/companies/list](https://api.getsales.io/bundled/companies-(accounts)/listcompanies.md): Search and filter companies with pagination. Returns company aggregation
objects including markers and custom field values.

The q filter performs a text search across company name and domain.

### Lookup a company

 - [POST /leads/api/companies/lookup](https://api.getsales.io/bundled/companies-(accounts)/lookupcompany.md): Find a company by a unique identifier. Provide at least one of:
linkedin, website, domain, ln_id, or name.

Returns the full company aggregation or null if not found.

### Get company by ID

 - [GET /leads/api/companies/{uuid}](https://api.getsales.io/bundled/companies-(accounts)/getcompanybyuuid.md): Retrieve a single company by UUID with full aggregation data
including activity markers and custom field values.

### Update a company

 - [PUT /leads/api/companies/{uuid}](https://api.getsales.io/bundled/companies-(accounts)/updatecompany.md): Update an existing company's fields. Only the provided fields are updated —
omitted fields are left unchanged.

Custom fields can be updated via the custom_fields object.

### Delete a company

 - [DELETE /leads/api/companies/{uuid}](https://api.getsales.io/bundled/companies-(accounts)/deletecompany.md): Permanently delete a company. Associated contacts are NOT deleted —
their company_uuid is set to null. This action cannot be undone.

### Create a company

 - [POST /leads/api/companies](https://api.getsales.io/bundled/companies-(accounts)/createcompany.md): Create one or more companies. Accepts a single company object or an array
of company objects for batch creation.

Each company requires at least a name. Use domain and linkedin for
deduplication — the system will link contacts with matching email domains
automatically.

## Lists

Organize contacts into lists

### List all lists

 - [GET /leads/api/lists](https://api.getsales.io/bundled/lists/listlists.md): Returns all contact lists for the current team. Lists are the primary way to segment contacts for outreach campaigns — each contact belongs to exactly one list at a time.

Use the filter query parameter to search by name or narrow down to specific list UUIDs.

### Create a list

 - [POST /leads/api/lists](https://api.getsales.io/bundled/lists/createlist.md): Creates a new contact list. List names must be unique within the team. After creating a list, you can add contacts to it using the upsert contact endpoint with list_uuid, or move existing contacts via the mass action change_list.

### Get list details

 - [GET /leads/api/lists/{uuid}](https://api.getsales.io/bundled/lists/getlist.md): Retrieves a single list by its UUID.

### Update a list

 - [PUT /leads/api/lists/{uuid}](https://api.getsales.io/bundled/lists/updatelist.md): Renames an existing list. The new name must be unique within the team.

### Delete a list

 - [DELETE /leads/api/lists/{uuid}](https://api.getsales.io/bundled/lists/deletelist.md): Soft-deletes a list. All contacts in the list will be unlinked from this list in the background. Associated companies also lose their reference to this list. This action cannot be undone via the API.

## Tags

Label contacts and companies with tags

### List all tags

 - [GET /leads/api/tags](https://api.getsales.io/bundled/tags/listtags.md): Returns all tags for the current team. Tags are flexible labels that can be attached to both contacts and companies — unlike lists, a contact can have multiple tags simultaneously.

Common uses in outreach: marking contacts as decision_maker, replied_positive, do_not_contact, or campaign-specific labels like q1_2025_outreach.

### Create a tag

 - [POST /leads/api/tags](https://api.getsales.io/bundled/tags/createtag.md): Creates a new tag. Tag names must be unique within the team. Tags can be applied to contacts and companies — use them for status tracking, campaign segmentation, or any custom categorisation.

### Update a tag

 - [PUT /leads/api/tags/{uuid}](https://api.getsales.io/bundled/tags/updatetag.md): Renames an existing tag. The new name must be unique within the team. All contacts and companies that have this tag will reflect the updated name automatically.

### Delete a tag

 - [DELETE /leads/api/tags/{uuid}](https://api.getsales.io/bundled/tags/deletetag.md): Soft-deletes a tag. The tag will be removed from all contacts and companies in the background. This action cannot be undone via the API.

## Custom Fields

Define custom data fields for contacts and companies

### List custom fields

 - [GET /leads/api/custom-fields](https://api.getsales.io/bundled/custom-fields/listcustomfields.md): Returns all custom fields defined for the team. Custom fields let you
store arbitrary data on contacts, companies, or sender profiles.

Each team can have up to 100 custom fields per object type.
Fields are identified by a numeric key (1–100) used internally for
efficient storage.

### Create a custom field

 - [POST /leads/api/custom-fields](https://api.getsales.io/bundled/custom-fields/createcustomfield.md): Create a new custom field for contacts, companies, or sender profiles.

Naming rules: Field names must start with a letter or underscore and
contain only alphanumeric characters and underscores (/^A-Za-z_*$/).
Names are unique per team and object type (case-insensitive).

A numeric key (1–100) is auto-assigned. Maximum 100 custom fields
per object type.

### Update a custom field

 - [PUT /leads/api/custom-fields/{uuid}](https://api.getsales.io/bundled/custom-fields/updatecustomfield.md): Rename a custom field. The object type and key cannot be changed
after creation. Existing values are preserved.

### Delete a custom field

 - [DELETE /leads/api/custom-fields/{uuid}](https://api.getsales.io/bundled/custom-fields/deletecustomfield.md): Delete a custom field and all its values across all contacts/companies.
Values are deleted asynchronously in the background. This action cannot
be undone.

## Pipeline Stages

Manage deal pipeline stages

### List pipeline stages

 - [GET /leads/api/pipeline-stages](https://api.getsales.io/bundled/pipeline-stages/listpipelinestages.md): Returns all pipeline stages for the team, ordered by position.
Stages exist separately for contacts and companies — use the
filter[object] parameter to get stages for a specific entity.

Each stage has a category that groups it into a funnel phase:
cold → engaging → positive / negative.

Default stages are auto-generated when a team is created.

### Create a pipeline stage

 - [POST /leads/api/pipeline-stages](https://api.getsales.io/bundled/pipeline-stages/createpipelinestage.md): Create a custom pipeline stage. The stage is appended at the end
of the current order — use the update endpoint to reposition it.

Categories determine funnel phase and how stage transitions
are interpreted (forward vs. backward):
- cold — not yet contacted
- engaging — outreach in progress
- positive — showing interest / converted
- negative — rejected / lost

### Update a pipeline stage

 - [PUT /leads/api/pipeline-stages/{uuid}](https://api.getsales.io/bundled/pipeline-stages/updatepipelinestage.md): Update a pipeline stage's name, category, or position. The object
type and type cannot be changed after creation.

To reorder stages, set the order field — all other stages in the
same object type are automatically repositioned.

## Notes

Add notes to contacts and companies

### List notes

 - [GET /leads/api/notes](https://api.getsales.io/bundled/notes/listnotes.md): Returns notes attached to contacts or companies. Filter by object and object_uuid to fetch notes for a specific record. Notes are free-text entries created by team members — use them to log call summaries, meeting takeaways, or research insights about a prospect.

### Create a note

 - [POST /leads/api/notes](https://api.getsales.io/bundled/notes/createnote.md): Creates a note attached to a contact or company. A note_left activity is automatically logged on the related record.

### Update a note

 - [PUT /leads/api/notes/{uuid}](https://api.getsales.io/bundled/notes/updatenote.md): Updates the text content of an existing note. Only the note field can be modified.

### Delete a note

 - [DELETE /leads/api/notes/{uuid}](https://api.getsales.io/bundled/notes/deletenote.md): Soft-deletes a note. The note will no longer appear in listing responses.

## Activities

Activity feed and custom activity logging

### List activities

 - [GET /leads/api/activities](https://api.getsales.io/bundled/activities/listactivities.md): Returns the activity log for contacts and companies. Activities are created automatically by the system (e.g. email sent, LinkedIn connection accepted, flow started) and can also be logged manually via the POST endpoint.

Filter by lead_uuid or company_uuid to get the timeline for a specific record. Filter by type to narrow down to specific event types (e.g. all email opens, all LinkedIn replies).

## Blacklist

Block contacts and companies from outreach

### List blacklisted contacts

 - [GET /leads/api/leads-blacklist](https://api.getsales.io/bundled/blacklist/listleadblacklist.md): Returns all blacklisted contact entries. When a contact is blacklisted, any existing matching contact in your CRM is automatically deleted, and future imports or scraped data matching the blacklist criteria will be rejected.

Blacklist entries match on LinkedIn URL, LinkedIn ID, work email, personal email, or the combination of name + company name.

### Add contact to blacklist

 - [POST /leads/api/leads-blacklist](https://api.getsales.io/bundled/blacklist/addleadtoblacklist.md): Adds a contact to the blacklist. If a matching contact already exists in your CRM, it will be automatically deleted in the background.

You must provide at least one unique identifier: linkedin, ln_id, work_email, or personal_email. Alternatively, you can provide both name and company_name together as a composite identifier.

### Remove contact from blacklist

 - [DELETE /leads/api/leads-blacklist/{uuid}](https://api.getsales.io/bundled/blacklist/removeleadfromblacklist.md): Removes a contact from the blacklist. Previously deleted contacts are not automatically restored — you would need to re-import them.

### List blacklisted companies

 - [GET /leads/api/companies-blacklist](https://api.getsales.io/bundled/blacklist/listcompanyblacklist.md): Returns all blacklisted company entries. When a company is blacklisted by domain, all contacts with a matching work email domain are also deleted. Future imports matching the blacklist criteria will be rejected.

Blacklist entries match on company name, domain, LinkedIn URL, or LinkedIn ID.

### Add company to blacklist

 - [POST /leads/api/companies-blacklist](https://api.getsales.io/bundled/blacklist/addcompanytoblacklist.md): Adds a company to the blacklist. If a matching company exists, it will be updated with blacklist status. If a domain is provided, all contacts whose work email matches that domain will also be deleted in the background.

Provide at least one of: name, domain, linkedin, or ln_id.

### Remove company from blacklist

 - [DELETE /leads/api/companies-blacklist/{uuid}](https://api.getsales.io/bundled/blacklist/removecompanyfromblacklist.md): Removes a company from the blacklist. Previously deleted companies and contacts are not automatically restored.

## Data Sources (LinkedIn Imports)

Create and manage LinkedIn scraping imports — Sales Navigator, basic search, post engagements

### List imports

 - [GET /leads/api/data-sources](https://api.getsales.io/bundled/data-sources-(linkedin-imports)/listdatasources.md): Returns a paginated list of LinkedIn imports (data sources). Each import represents
a scraping job that pulls contacts or companies from LinkedIn into a GetSales list.

Filter by type to see only specific import sources:

| Category | Types |
|----------|-------|
| LinkedIn Basic | ln_leads_search, ln_accounts_search, ln_my_network, ln_my_messenger |
| Sales Navigator | sn_leads_search, sn_leads_saved_search, sn_leads_list, sn_accounts_search, sn_accounts_saved_search, sn_accounts_list |
| Recruiter | recruiter_leads_search |
| Engagements | post_engagement |

Filter by status to monitor progress: not_started, in_progress, on_hold, completed, failed, contacts_limit_achieved.

### Create import

 - [POST /leads/api/data-sources](https://api.getsales.io/bundled/data-sources-(linkedin-imports)/createdatasource.md): Create a new LinkedIn import (data source). This starts a scraping job that will pull
contacts or companies from the specified LinkedIn URL into your list.

Import types:

| Type | Description |
|------|-------------|
| sn_leads_search | Sales Navigator people search results |
| sn_leads_saved_search | Sales Navigator saved leads search |
| sn_leads_list | Sales Navigator lead list |
| sn_accounts_search | Sales Navigator company search |
| sn_accounts_saved_search | Sales Navigator saved company search |
| sn_accounts_list | Sales Navigator account list |
| ln_leads_search | LinkedIn basic people search |
| ln_accounts_search | LinkedIn basic company search |
| ln_my_network | Your LinkedIn connections |
| ln_my_messenger | Your LinkedIn messenger contacts |
| post_engagement | People who engaged with a LinkedIn post (likes, comments) |
| recruiter_leads_search | LinkedIn Recruiter search results |

Required: list_uuid (target list), type (import type), and payload (must contain the LinkedIn url to scrape).

Optional: sender_profile_uuid (which LinkedIn account runs the import), tags (auto-tag imported contacts), repeat_after_minutes (re-run periodically).

### Get import

 - [GET /leads/api/data-sources/{uuid}](https://api.getsales.io/bundled/data-sources-(linkedin-imports)/getdatasource.md): Retrieve a single import by UUID. Returns full details including current status, payload (LinkedIn URL), errors, and scheduling info.

### Update import

 - [PUT /leads/api/data-sources/{uuid}](https://api.getsales.io/bundled/data-sources-(linkedin-imports)/updatedatasource.md): Update an existing import. You can change the target list, tags, status,
scheduling, or payload.

Common use cases:
- Pause an import: set status to on_hold
- Resume an import: set status to in_progress
- Change target list: update list_uuid
- Enable recurring: set repeat_after_minutes (e.g. 1440 for daily)
- Disable recurring: set repeat_after_minutes to null

Only provided fields are updated — omitted fields stay unchanged.

### Delete import

 - [DELETE /leads/api/data-sources/{uuid}](https://api.getsales.io/bundled/data-sources-(linkedin-imports)/deletedatasource.md): Delete an import and stop any active scraping. Already imported contacts remain in the list — only the import job is removed.

### Get import metrics

 - [PUT /leads/api/data-sources/metrics](https://api.getsales.io/bundled/data-sources-(linkedin-imports)/datasourcemetrics.md): Returns progress metrics for one or more imports. Pass an array of import UUIDs
and get back per-import counters showing how many records were saved, duplicated,
blacklisted, or errored.

Metric fields:

| Field | Description |
|-------|-------------|
| queued_records | Records waiting to be processed |
| saved_records | Successfully imported as new contacts/companies |
| duplicate_records | Skipped — already exist in the list |
| blacklisted_records | Skipped — match a blacklist entry |
| error_records | Failed to import (data issues) |

Fields prefixed with child_ count nested results (e.g. contacts found
under a company in an account search).

## Enrichment

Queue contacts and companies for LinkedIn data enrichment and monitor progress

### Enrich contacts

 - [PUT /leads/api/leads/advanced-enrichment](https://api.getsales.io/bundled/enrichment/enrichleads.md): Queue contacts for LinkedIn data enrichment. GetSales will visit each contact's
LinkedIn profile and update their data — name, position, company, skills,
education, location, and more.

How it works:
1. Select contacts by filter or specific UUIDs
2. The system validates your team has enough enrichment credits
3. Contacts are added to the enrichment queue
4. A LinkedIn browser visits each profile and updates the data automatically

Credit system: Each contact queued for enrichment costs one credit.
Credits are counted per calendar month. Check your remaining balance
via the POST /leads/api/enrichment-queue/metrics endpoint and your
team's credits.advanced_enrichment limit via GET /id/api/teams/{id}.

You can pass either a filter object (same format as search/mass-action filters)
or an array of specific uuids. At least one matching contact must exist.

### Enrich companies

 - [PUT /leads/api/companies/advanced-enrichment](https://api.getsales.io/bundled/enrichment/enrichcompanies.md): Queue companies for LinkedIn data enrichment. GetSales will visit each company's
LinkedIn page and update their data — description, industry, employee count,
specialties, headquarters, logo, and more.

Works identically to lead enrichment: pass a filter or uuids, and the
system will validate credits and queue companies for processing.

Credit system: Shares the same monthly credit pool as contact enrichment.

### List enrichment queue

 - [GET /leads/api/enrichment-queue](https://api.getsales.io/bundled/enrichment/listenrichmentqueue.md): View the current enrichment queue — contacts and companies waiting to be enriched
or currently being processed. Use this to monitor enrichment progress.

Each entry shows the status (waiting, processing, or done), which
LinkedIn account is handling it, and how many enrichment attempts have been made.

### Get enrichment queue entry

 - [GET /leads/api/enrichment-queue/{id}](https://api.getsales.io/bundled/enrichment/getenrichmentqueueentry.md): Retrieve a single enrichment queue entry by its ID. Use this to check the status of a specific enrichment task.

### Get enrichment metrics

 - [POST /leads/api/enrichment-queue/metrics](https://api.getsales.io/bundled/enrichment/enrichmentqueuemetrics.md): Returns the total number of enrichment entries processed this calendar month.
Compare this number against your team's credits.advanced_enrichment limit
to see how many credits remain.

Example: If your plan allows 1,000 enrichments/month and this endpoint
returns this_month_count: 350, you have 650 enrichments remaining.

## File Import / Export

Import and export contacts and companies via CSV

### Upload a CSV file

 - [POST /leads/api/file-imports/upload-csv](https://api.getsales.io/bundled/file-import-export/uploadcsv.md): Uploads a CSV file and returns a preview with auto-detected column mappings. This is the first step of a two-step import flow:

1. Upload — call this endpoint with the file and import type.
   The response includes csv_headers (columns found in the file),
   csv_preview (first 10 rows), and matches (auto-detected
   column mappings).

2. Import — call import-leads or import-companies with the
   confirmed column mapping to start background processing.


Max file size is 15 MB. The CSV is parsed with auto-detected delimiters (comma, semicolon, or pipe).

### Import contacts from uploaded file

 - [POST /leads/api/file-imports/{uuid}/import-leads](https://api.getsales.io/bundled/file-import-export/importleadsfromfile.md): Starts background import of contacts from a previously uploaded CSV. Pass the confirmed column mapping in the columns field — keys are field names, values are 0-indexed column numbers from the CSV.

The uploaded file must have type csv_leads. At least one of linkedin_id, work_email, or personal_email must be mapped.

Processing happens asynchronously in batches of 1,000 rows. The returned object has status: in_progress — poll by UUID or use webhooks to track completion.

### Import companies from uploaded file

 - [POST /leads/api/file-imports/{uuid}/import-companies](https://api.getsales.io/bundled/file-import-export/importcompaniesfromfile.md): Starts background import of companies from a previously uploaded CSV. The uploaded file must have type csv_accounts. At least one of linkedin_id or name must be mapped.

Processing happens asynchronously in batches of 1,000 rows.

### Export contacts to CSV

 - [POST /leads/api/file-exports/leads](https://api.getsales.io/bundled/file-import-export/exportleads.md): Starts an asynchronous CSV export of contacts matching the given filter. The export runs in the background in batches of 1,000 rows.

When complete, use the download endpoint with the file name from the export result to download the CSV file.

The filter uses the same structure as the mass action filter — you can export all contacts, a specific list, contacts matching a search query, or a hand-picked set of UUIDs.

### Export companies to CSV

 - [POST /leads/api/file-exports/companies](https://api.getsales.io/bundled/file-import-export/exportcompanies.md): Starts an asynchronous CSV export of companies matching the given filter. Works the same as the contact export — runs in background batches, use download to retrieve the file when done.

### Download an exported file

 - [POST /leads/api/file-exports/download](https://api.getsales.io/bundled/file-import-export/downloadexport.md): Downloads a completed CSV export file. Pass the file_name from the export result. The response is a binary CSV stream.

The export must have status: done and a non-null result.files array before you can download.

## Flows (Automations)

Create and manage outreach automation flows

### List flows (automations)

 - [GET /flows/api/flows](https://api.getsales.io/bundled/flows-(automations)/listflows.md): Returns all automation flows for the current team. Flows are multi-step outreach sequences that combine LinkedIn actions, email sends, delays, conditions, and CRM updates into an automated pipeline.

Filter by status to see only active, paused, or draft flows. Filter by flow_workspace_uuid to list flows in a specific campaign folder.

### Create a flow (automation)

 - [POST /flows/api/flows](https://api.getsales.io/bundled/flows-(automations)/createflow.md): Creates a new automation flow in draft status. After creating, use the flow version endpoints to add steps (nodes) and contact sources, then call start to activate the flow.

The schedule defines when the flow is allowed to execute actions. Each timeblock specifies a day of week (0=Sunday, 6=Saturday) and a time window in minutes from midnight (e.g. 540=9:00 AM, 1020=5:00 PM).

### Get flow details

 - [GET /flows/api/flows/{uuid}](https://api.getsales.io/bundled/flows-(automations)/getflow.md): Retrieves a single flow by UUID, including its schedule configuration and current status.

### Update a flow

 - [PUT /flows/api/flows/{uuid}](https://api.getsales.io/bundled/flows-(automations)/updateflow.md): Updates flow properties such as name, description, schedule, priority, or workspace assignment. To change the flow status, use the dedicated start, stop, or archive endpoints.

### Delete a flow

 - [DELETE /flows/api/flows/{uuid}](https://api.getsales.io/bundled/flows-(automations)/deleteflow.md): Soft-deletes a flow. All contacts currently in the flow are cancelled with reason "Automation cancelled because it was deleted". This action cannot be undone via the API.

### Start a flow

 - [PUT /flows/api/flows/{uuid}/start](https://api.getsales.io/bundled/flows-(automations)/startflow.md): Activates a flow, changing its status to on. The flow must have at least one contact source with a sender profile assigned, and all nodes must be valid.

Status transitions: draft → on, off → on. Cannot start an archived flow — unarchive it first.

### Stop (pause) a flow

 - [PUT /flows/api/flows/{uuid}/stop](https://api.getsales.io/bundled/flows-(automations)/stopflow.md): Pauses a running flow, changing its status to off. Contacts currently in progress will finish their current step, but no new steps will be started. Use start to resume.

### Archive a flow

 - [PUT /flows/api/flows/{uuid}/archive](https://api.getsales.io/bundled/flows-(automations)/archiveflow.md): Archives a flow, hiding it from the default flow list. All active contacts in the flow are cancelled in the background. To restore an archived flow, use the unarchive endpoint.

### Get flow metrics

 - [POST /flows/api/flows/metrics](https://api.getsales.io/bundled/flows-(automations)/getflowmetrics.md): Returns aggregate metrics for one or more flows — total contacts, in-progress count, finished count, and failed count.

### Get flow node statistics

 - [POST /flows/api/flows/{uuid}/statistics/nodes](https://api.getsales.io/bundled/flows-(automations)/getflownodestatistics.md): Returns per-node statistics for a flow — how many contacts are at each node, conversion metrics (accepted, replied, opened, clicked, bounced), and branch distribution for condition nodes.

### List flow versions

 - [GET /flows/api/flows/{flowUuid}/flow-versions](https://api.getsales.io/bundled/flows-(automations)/listflowversions.md): Returns all saved versions of a flow. Each version contains the complete node tree (steps), contact sources (entry points), and connection graph. The most recent version is the active one.

### Create flow version (save node tree)

 - [POST /flows/api/flows/{flowUuid}/flow-versions](https://api.getsales.io/bundled/flows-(automations)/createflowversion.md): Save a new version of the flow's automation tree. This is the primary endpoint for building automations programmatically. A version contains the complete node graph — every step, connection, branching rule, and contact source. The new version immediately becomes the active version.

Node graph structure: Nodes are connected via before[] and after[] arrays. Each entry is {node_id, branch_id}. For linear flows, branch_id is always 0. For branching nodes (rule_filter, rule_ab_test, trigger_*), each branch gets a unique branch_id matching the branch definition in the node's payload.

Contact sources define how leads enter the flow — with sender profile assignment, concurrency limits, and rotation strategy.

See the Node Type Reference below for all 40+ node types and their payloads.

### Get flow version details

 - [GET /flows/api/flow-versions/{uuid}](https://api.getsales.io/bundled/flows-(automations)/getflowversion.md): Returns a specific flow version with the full node tree, contact sources, and connection graph.

### Delete flow version

 - [DELETE /flows/api/flow-versions/{uuid}](https://api.getsales.io/bundled/flows-(automations)/deleteflowversion.md): Permanently delete a flow version. Cannot delete the currently active version of a running flow.

### Validate a flow node

 - [POST /flows/api/flow-versions/validate-node](https://api.getsales.io/bundled/flows-(automations)/validateflownode.md): Validate a single node's type and payload before saving the full flow version. Useful for real-time validation in flow builders.

### Validate a contact source

 - [POST /flows/api/flow-versions/validate-contact-source](https://api.getsales.io/bundled/flows-(automations)/validatecontactsource.md): Validate a contact source configuration (sender profiles, rotation strategy, limits) before saving.

## Flow Leads (Automation Contacts)

Add and manage contacts within flows

### Add contact to flow

 - [POST /flows/api/flows/{flowUuid}/leads/{leadUuid}](https://api.getsales.io/bundled/flow-leads-(automation-contacts)/addleadtoflow.md): Adds an existing contact to an automation flow. The contact is queued for processing through the flow's steps starting from the specified contact source.

The flow must be active (status: on) and the contact source must have at least one enabled sender profile.

### Create and add contact to flow

 - [POST /flows/api/flows/{flowUuid}/add-new-lead](https://api.getsales.io/bundled/flow-leads-(automation-contacts)/addnewleadtoflow.md): Creates a new contact (or updates an existing one) and immediately adds them to the specified flow. This is a combined operation that replaces separate "create contact" + "add to flow" calls.

If skip_if_lead_exists is true and the contact already exists (created more than 10 seconds ago), the operation is skipped and returns {"reason": "skipped"}.

### List flow contacts

 - [POST /flows/api/flows-leads/list](https://api.getsales.io/bundled/flow-leads-(automation-contacts)/listflowleads.md): Returns contacts enrolled in flows. Filter by flow_uuid to see contacts in a specific flow, by status to find active, finished, or failed contacts, or by sender_profile_uuid to see contacts assigned to a specific sender.

### Cancel contact from specific flows

 - [PUT /flows/api/flows/leads/{leadUuid}/cancel](https://api.getsales.io/bundled/flow-leads-(automation-contacts)/cancelflowlead.md): Cancels a contact's enrollment in one or more specific flows. The contact's status is set to canceled and any pending tasks are stopped. Completed steps are not rolled back.

### Cancel contact from all flows

 - [PUT /flows/api/flows/leads/{leadUuid}/cancel-all](https://api.getsales.io/bundled/flow-leads-(automation-contacts)/cancelallflowleads.md): Cancels a contact's enrollment in all active flows. Useful when a contact replies or opts out and should be removed from all running campaigns.

### Remove contact flow history

 - [DELETE /flows/api/flows/leads/{leadUuid}](https://api.getsales.io/bundled/flow-leads-(automation-contacts)/removeflowlead.md): Deletes all flow lead records for a contact. This removes the contact's history across all flows (up to 100 records).

## Flow Workspaces (Automation Folders)

Organize flows into folders

### List flow workspaces

 - [GET /flows/api/flow-workspaces](https://api.getsales.io/bundled/flow-workspaces-(automation-folders)/listflowworkspaces.md): Returns all flow workspaces (automation folders) for the current team. Workspaces let you organise flows into logical groups such as quarterly campaigns, product lines, or team ownership.

### Create a flow workspace

 - [POST /flows/api/flow-workspaces](https://api.getsales.io/bundled/flow-workspaces-(automation-folders)/createflowworkspace.md): Creates a new flow workspace (automation folder). Workspace names must be unique within the team.

### Update a flow workspace

 - [PUT /flows/api/flow-workspaces/{uuid}](https://api.getsales.io/bundled/flow-workspaces-(automation-folders)/updateflowworkspace.md): Updates a workspace name or display order.

### Delete a flow workspace

 - [DELETE /flows/api/flow-workspaces/{uuid}](https://api.getsales.io/bundled/flow-workspaces-(automation-folders)/deleteflowworkspace.md): Deletes a workspace. All flows inside the workspace are archived (not deleted) — their flow_workspace_uuid is cleared and their status is set to archived.

## Sender Profiles

Manage LinkedIn sender profiles attached to flows

### List sender profiles

 - [GET /flows/api/sender-profiles](https://api.getsales.io/bundled/sender-profiles/listsenderprofiles.md): Returns all sender profiles for the current team. A sender profile represents a person (typically an SDR or AE) who sends messages on behalf of the team. Each profile links a LinkedIn account and/or email mailbox, and has its own daily limits and schedule.

Sender profiles are assigned to flow contact sources to distribute outreach across multiple senders.

### Create a sender profile

 - [POST /flows/api/sender-profiles](https://api.getsales.io/bundled/sender-profiles/createsenderprofile.md): Creates a new sender profile with enabled status. After creating, link a LinkedIn account and/or email mailbox to enable the profile for outreach.

### Get sender profile details

 - [GET /flows/api/sender-profiles/{uuid}](https://api.getsales.io/bundled/sender-profiles/getsenderprofile.md): Retrieves a single sender profile by UUID.

### Update a sender profile

 - [PUT /flows/api/sender-profiles/{uuid}](https://api.getsales.io/bundled/sender-profiles/updatesenderprofile.md): Updates sender profile fields such as name, label, schedule, notification emails, or linked accounts. Partial updates are supported.

### Delete a sender profile

 - [DELETE /flows/api/sender-profiles/{uuid}](https://api.getsales.io/bundled/sender-profiles/deletesenderprofile.md): Deletes a sender profile and all linked accounts. The linked LinkedIn browser, LinkedIn account, and all mailboxes are removed. Pending tasks for this sender are cancelled. The profile is removed from all flow contact sources.

### Connect an external browser to a sender profile

 - [POST /flows/client-api/sender-profiles/connect-external](https://api.getsales.io/bundled/sender-profiles/connectexternalbrowser.md): Creates a new sender profile and links it to an external GoLogin browser profile in a single call. If the sender profile already exists (matched by first/last name for MirrorProfiles), it reuses the existing profile instead of creating a duplicate.

This is the primary endpoint for onboarding a new LinkedIn account into GetSales. After creating the sender profile and browser, the browser is automatically started — it will appear in the LinkedIn Browsers list with status running and begin the LinkedIn login/session setup.

What happens under the hood:
1. A new sender profile is created (or an existing one is reused for MirrorProfiles)
2. A LinkedIn browser is created and linked to the sender profile via the GoLogin external ID
3. The browser is started automatically
4. Default daily limits are applied (can be overridden via daily_limits)

The sender profile limit is checked before creation — if your plan limit is reached, the request will be rejected with a 422 error (MirrorProfiles connections bypass this limit).

### Get sender profile metrics

 - [POST /flows/api/sender-profiles/metrics](https://api.getsales.io/bundled/sender-profiles/getsenderprofilemetrics.md): Returns metrics for one or more sender profiles, including linked mailbox status and counts.

## Tasks

View and manage scheduled outreach tasks

### List tasks

 - [GET /flows/api/tasks](https://api.getsales.io/bundled/tasks/listtasks.md): Returns all tasks for the current team with filtering and pagination. Tasks represent individual outreach actions within automation flows, including LinkedIn actions (connect requests, messages, profile visits), email sends, phone calls, CRM updates, delays, conditions, and custom actions.

Filter by status to see in-progress, completed, failed, or skipped tasks. Filter by type to find specific action types. Filter by flow_uuid to see tasks within a specific automation. Filter by lead_uuid or sender_profile_uuid for targeted task searches.

### Get task details

 - [GET /flows/api/tasks/{uuid}](https://api.getsales.io/bundled/tasks/gettask.md): Retrieves full details for a specific task by UUID, including payload, execution history, and all metadata. Use this to inspect a task's configuration, status, and results.

### Complete a task

 - [PUT /flows/api/tasks/{uuid}/complete](https://api.getsales.io/bundled/tasks/completetask.md): Marks a task as complete (closed). Only works on manual or custom tasks that are currently in_progress, delegated, or paused. Use this endpoint to manually complete tasks that don't have automatic completion logic.

### Cancel a task

 - [PUT /flows/api/tasks/{uuid}/cancel](https://api.getsales.io/bundled/tasks/canceltask.md): Cancels a task by changing its status to canceled. Works on tasks that are currently in_progress, delegated, or paused. Cannot cancel already closed or failed tasks.

### Get task metrics

 - [POST /flows/api/tasks/metrics](https://api.getsales.io/bundled/tasks/gettaskmetrics.md): Retrieve aggregated metrics and statistics for tasks. Returns counts of tasks by status, type, and performance metrics. Useful for dashboards, reports, and monitoring automation performance.

### Get task schedule

 - [GET /flows/api/tasks/schedule](https://api.getsales.io/bundled/tasks/gettaskschedule.md): Retrieve the upcoming task schedule for a specific sender profile and date. Returns tasks scheduled to execute on that day, grouped by time. Useful for understanding daily execution volume and planning.

## LinkedIn Messages

Read and send LinkedIn messages

### List LinkedIn messages

 - [GET /flows/api/linkedin-messages](https://api.getsales.io/bundled/linkedin-messages/listlinkedinmessages.md): Returns paginated LinkedIn messages for the current team. Includes both inbox (received) and outbox (sent) messages. Supports filtering by type (connection note, message, InMail), status (new, in progress, done, failed), automation mode, and other criteria. Default ordering is by sent_at descending (newest first).

### Send a LinkedIn message

 - [POST /flows/api/linkedin-messages](https://api.getsales.io/bundled/linkedin-messages/sendlinkedinmessage.md): Sends a LinkedIn message or connection note on behalf of a sender profile. The lead must be connected or connected requests must be enabled. Can send a custom message, use a template, or send an InMail with a subject line. All outbound messages are tracked and can be marked as done/failed based on delivery status.

### Get LinkedIn message group counts

 - [POST /flows/api/linkedin-messages/group-counts](https://api.getsales.io/bundled/linkedin-messages/getlinkedinmessagegroupcounts.md): Returns aggregated counts of LinkedIn messages grouped by a specified field (status, type, linkedin_type, automation, etc.). Useful for dashboards and reporting on message distribution, failure analysis, and automation mode breakdown. Supports optional filtering before grouping.

## Emails

Read and send emails

### List emails

 - [GET /emails/api/emails](https://api.getsales.io/bundled/emails/listemails.md): Retrieve a paginated list of emails with filtering and sorting options. Supports filtering by type (inbox/outbox), status, mailbox, lead, flow, email addresses, and date range. Results can be ordered by any field in ascending or descending order.

### Get email details

 - [GET /emails/api/emails/{uuid}](https://api.getsales.io/bundled/emails/getemail.md): Retrieve detailed information about a specific email including headers, thread information, and all metadata. Returns the complete email body and all associated fields.

### Send an email

 - [POST /emails/api/emails/send-email](https://api.getsales.io/bundled/emails/sendemail.md): Send an email from a specified mailbox to one or more recipients. Supports plain recipients, CC/BCC, templates, and thread replies. Email is validated and queued for delivery. Returns the created email record with status "waiting".

## Mailboxes

Manage connected email mailboxes

### List mailboxes

 - [GET /emails/api/mailboxes](https://api.getsales.io/bundled/mailboxes/listmailboxes.md): Retrieve a paginated list of mailboxes (email accounts) with filtering and sorting. Supports filtering by search query, provider type, send status, sync status, and sender profile. Results can be ordered by any field.

### Connect an SMTP/IMAP mailbox

 - [POST /emails/api/mailboxes](https://api.getsales.io/bundled/mailboxes/connectsmtpimapmailbox.md): Creates a new mailbox by connecting an email account via SMTP (for sending) and IMAP (for syncing replies). This is used for any email provider that supports standard SMTP/IMAP protocols — including Gmail with app passwords, Outlook with app passwords, Zoho, GoDaddy, custom mail servers, and more.

The mailbox is linked to a sender profile and becomes available for email outreach in automation flows. Once connected, GetSales will verify the SMTP and IMAP credentials by performing a test connection. If either connection fails, you'll receive a 433 error with the specific protocol that failed.

For Gmail and Outlook OAuth-based connections, use the dedicated OAuth endpoints instead (/emails/api/mailboxes/gmail/callback and /emails/api/mailboxes/outlook/callback).

Each sender profile has a mailbox limit based on your plan. Attempting to add beyond the limit will return a 422 error.

### Get mailbox details

 - [GET /emails/api/mailboxes/{uuid}](https://api.getsales.io/bundled/mailboxes/getmailbox.md): Retrieve detailed information about a specific mailbox including connection settings, error counts, and last activity timestamps.

### Delete mailbox

 - [DELETE /emails/api/mailboxes/{uuid}](https://api.getsales.io/bundled/mailboxes/deletemailbox.md): Permanently delete a mailbox. If the mailbox has active automation tasks, you must specify whether to reassign those tasks to another mailbox or cancel them.

### Activate mailbox

 - [PUT /emails/api/mailboxes/{uuid}/activate](https://api.getsales.io/bundled/mailboxes/activatemailbox.md): Activate a mailbox to enable sending and syncing emails. Performs a connection test to verify the mailbox credentials are valid. Returns an error if the connection test fails.

### Deactivate mailbox

 - [PUT /emails/api/mailboxes/{uuid}/deactivate](https://api.getsales.io/bundled/mailboxes/deactivatemailbox.md): Deactivate a mailbox to disable sending and syncing emails. The mailbox data is retained and can be reactivated later.

### Reconnect a mailbox to SMTP/IMAP

 - [POST /emails/api/mailboxes/{uuid}/reconnect-to-smtp](https://api.getsales.io/bundled/mailboxes/reconnectmailboxtosmtp.md): Reconnects an existing mailbox with new SMTP/IMAP credentials. Use this when a mailbox has an error send or sync status due to changed passwords, expired app passwords, or when migrating from OAuth to SMTP.

This endpoint replaces the provider and connection settings without creating a new mailbox. The mailbox UUID, email address, and sender profile association remain unchanged.

## AI Agents

Create and manage AI-powered classification agents

### List AI Agents

 - [GET /flows/api/ai-agents](https://api.getsales.io/bundled/ai-agents/listaiagents.md): Retrieve a paginated list of AI agents for the authenticated team. AI agents are configured to classify and respond to sales leads with customizable LLM models and instructions.

### Create AI Agent

 - [POST /flows/api/ai-agents](https://api.getsales.io/bundled/ai-agents/createaiagent.md): Create a new AI agent for your team. The agent uses configured LLM models to classify incoming leads and generate contextual responses. Classification results are categorized as positive, negative, neutral, or fallback.

### Get AI Agent

 - [GET /flows/api/ai-agents/{uuid}](https://api.getsales.io/bundled/ai-agents/getaiagent.md): Retrieve a specific AI agent by UUID including all configuration details and associated classification statuses. Returns the complete agent configuration and status categorizations.

### Update AI Agent

 - [PUT /flows/api/ai-agents/{uuid}](https://api.getsales.io/bundled/ai-agents/updateaiagent.md): Update an existing AI agent configuration. You can modify the agent name, description, LLM models, instructions, and behavioral settings. Partial updates are supported.

### Delete AI Agent

 - [DELETE /flows/api/ai-agents/{uuid}](https://api.getsales.io/bundled/ai-agents/deleteaiagent.md): Permanently delete an AI agent and all associated configuration. This action cannot be undone. Any active classifications or automations using this agent will be disabled.

### Classify Lead

 - [POST /flows/api/ai-agents/{uuid}/classify](https://api.getsales.io/bundled/ai-agents/classifylead.md): Submit a lead profile for asynchronous classification by the AI agent. The agent analyzes the lead information and categorizes it according to configured statuses (positive, negative, neutral, or fallback). Classification results are processed asynchronously and metrics are updated in real-time.

### Get AI Agent Metrics

 - [POST /flows/api/ai-agents/metrics](https://api.getsales.io/bundled/ai-agents/getaiagentmetrics.md): Retrieve classification metrics for one or more AI agents. Returns counts of classifications by category (positive, negative, neutral, fallback, no_reply) along with timestamps of the most recent classification activity.

## AI Templates

AI-powered message templates with dynamic rendering

### List AI Templates

 - [GET /flows/api/ai-templates](https://api.getsales.io/bundled/ai-templates/listaitemplates.md): Retrieve a paginated list of AI templates for your team. Templates define outreach messages, validation rules, and fallback behaviors for different communication channels (email, LinkedIn, connection notes, etc.).

### Create AI Template

 - [POST /flows/api/ai-templates](https://api.getsales.io/bundled/ai-templates/createaitemplate.md): Create a new AI template for your team. Templates support variable interpolation, AI-powered content generation with validation, and fallback message handling for multiple communication channels.

### Get AI Template

 - [GET /flows/api/ai-templates/{uuid}](https://api.getsales.io/bundled/ai-templates/getaitemplate.md): Retrieve a specific AI template by UUID including all configuration details, LLM settings, validation rules, and fallback messages.

### Update AI Template

 - [PUT /flows/api/ai-templates/{uuid}](https://api.getsales.io/bundled/ai-templates/updateaitemplate.md): Update an existing AI template. You can modify the body, subject, LLM configuration, validation rules, and fallback messages. Partial updates are supported.

### Delete AI Template

 - [DELETE /flows/api/ai-templates/{uuid}](https://api.getsales.io/bundled/ai-templates/deleteaitemplate.md): Permanently delete an AI template. This action cannot be undone. Any workflows or campaigns using this template will need to be updated with an alternative template.

### Render AI Template

 - [POST /flows/api/ai-templates/render](https://api.getsales.io/bundled/ai-templates/renderaitemplate.md): Render an AI template by UUID or inline definition. Returns the rendered message with variable interpolation, AI-generated content (if enabled), validation results, and fallback handling. Useful for previewing templates before deployment.

## LinkedIn Browsers

Manage LinkedIn browser profiles for automation

### List LinkedIn browsers

 - [POST /browsers/api/linkedin-browsers/list](https://api.getsales.io/bundled/linkedin-browsers/listlinkedinbrowsers.md): Returns a paginated list of LinkedIn browser profiles attached to your workspace. Each browser represents a GoLogin browser profile connected to a sender profile for LinkedIn automation. Use filters to narrow results by status, sender profile, or browser owner.

### Get first matching browser

 - [POST /browsers/api/linkedin-browsers/first](https://api.getsales.io/bundled/linkedin-browsers/getfirstlinkedinbrowser.md): Returns the first browser matching the given filter criteria. Useful for looking up a browser by sender profile UUID or ID without pagination.

### Get browser by ID

 - [GET /browsers/api/linkedin-browsers/{id}](https://api.getsales.io/bundled/linkedin-browsers/getlinkedinbrowser.md): Returns a single LinkedIn browser profile by its numeric ID. Sensitive fields (linkedin_login, linkedin_password, ln_code) are excluded by default. Pass show_all_fields=true to include them.

### Update browser

 - [PUT /browsers/api/linkedin-browsers/{id}](https://api.getsales.io/bundled/linkedin-browsers/updatelinkedinbrowser.md): Update a LinkedIn browser's credentials, schedule, or status. Only provided fields are updated. You cannot set linkedin_account_uuid to null if it already has a value.

### Delete browser

 - [DELETE /browsers/api/linkedin-browsers/{id}](https://api.getsales.io/bundled/linkedin-browsers/deletelinkedinbrowser.md): Deletes a LinkedIn browser profile. If the browser is currently running, it will be stopped first. The associated sender profile's linkedin_browser_id and linkedin_account_uuid are cleared, which means all pending LinkedIn tasks for that sender profile will fail — the sender can no longer execute connection requests, messages, InMails, or any other LinkedIn actions until a new browser is connected. If the browser is owned by GetSales, the GoLogin profile is also deleted.

### Create browser

 - [POST /browsers/api/linkedin-browsers](https://api.getsales.io/bundled/linkedin-browsers/createlinkedinbrowser.md): Creates a new LinkedIn browser profile and attaches it to a sender profile. Either provide an external_id (existing GoLogin profile) or let GetSales create one by specifying a proxy_country_code or custom_proxy_config.

### Start browser

 - [POST /browsers/api/linkedin-browsers/{id}/run](https://api.getsales.io/bundled/linkedin-browsers/runlinkedinbrowser.md): Starts a LinkedIn browser automation session. The browser must be in a non-running status (stopped, idle, start_issue, running_issue, login_issue, etc.). Returns 400 if the browser is already running or initializing.

### Stop browser

 - [POST /browsers/api/linkedin-browsers/{id}/stop](https://api.getsales.io/bundled/linkedin-browsers/stoplinkedinbrowser.md): Stops a running LinkedIn browser automation session. By default, stops immediately (now: 1). Set now: 0 to queue a graceful stop that finishes the current action first.

### Set browser proxy

 - [POST /browsers/api/linkedin-browsers/{id}/set-proxy](https://api.getsales.io/bundled/linkedin-browsers/setbrowserproxy.md): Changes the proxy configuration for a LinkedIn browser. Either provide a proxy_country_code to use a GetSales-managed proxy, or a custom_proxy_config with your own proxy details. The proxy is validated before being applied.

### Replace GetSales proxy

 - [POST /browsers/api/linkedin-browsers/{id}/replace-getsales-proxy](https://api.getsales.io/bundled/linkedin-browsers/replacegetsalesproxy.md): Replaces the current GetSales-managed proxy with a new one in the same country. Only works for browsers using a GetSales proxy (linkedin_proxy_id must be set). Returns 400 if the browser uses a custom proxy.

### Check proxy connectivity

 - [POST /browsers/api/linkedin-browsers/check-proxy](https://api.getsales.io/bundled/linkedin-browsers/checkproxy.md): Tests a proxy connection by attempting to connect through it. Returns proxy details if the connection succeeds.

### Share browser profile

 - [POST /browsers/api/linkedin-browsers/{id}/share](https://api.getsales.io/bundled/linkedin-browsers/sharebrowser.md): Shares the GoLogin browser profile with additional email recipients. Each recipient must be a registered GoLogin user.

### List available proxy countries

 - [GET /browsers/api/linkedin-proxies/countries](https://api.getsales.io/bundled/linkedin-browsers/listproxycountries.md): Returns the list of countries where GetSales-managed proxies are available. Use a country code from this list when creating a browser with proxy_country_code or when setting a proxy via the set-proxy endpoint.

## Browser Logs

View automation logs for diagnosing browser issues

### List browser logs

 - [POST /browsers/api/linkedin-browser-logs/list](https://api.getsales.io/bundled/browser-logs/listbrowserlogs.md): Returns a paginated list of browser automation logs. Each log entry records an event (info or error) from the automation server. Use the linkedin_browser_id filter to get logs for a specific browser. Essential for diagnosing automation issues, login problems, and proxy errors.

## Analytics

Outreach and engagement metrics for LinkedIn and email channels

### Get lead engagement metrics

 - [POST /leads/api/leads/metrics](https://api.getsales.io/bundled/analytics/getleadmetrics.md): Returns aggregated outreach and engagement metrics for LinkedIn and email channels. This is the primary analytics endpoint used by the GetSales dashboard, reports page, flow performance columns, and the Messenger inbox (unread counts per sender profile).

Specify which metrics to retrieve via the metrics array. Optionally pass a date range with period_from/period_to, and group results with group_by. Filter by specific flows or sender profiles as needed.

When group_by is set, the response includes both total (workspace-wide aggregates) and a metrics map keyed by the grouping entity UUID with per-entity breakdowns.

Unread counts (unread_count, unread_count_linkedin, unread_count_email) are always computed in real-time regardless of period_from/period_to — they reflect the current unread state per sender profile.

## Webhooks

Subscribe to events via webhooks

### List webhooks

 - [GET /integrations/api/webhooks](https://api.getsales.io/bundled/webhooks/listwebhooks.md): Retrieve a paginated list of all webhooks configured for your team. You can filter by event type, status, and search query. Results are ordered by creation date in descending order by default.

### Create webhook

 - [POST /integrations/api/webhooks](https://api.getsales.io/bundled/webhooks/createwebhook.md): Create a new webhook to receive real-time notifications for specified events. The webhook will POST (or use another HTTP method) to your target URL when events occur. Webhooks are team-scoped and require a valid event type and publicly accessible target URL.

### Get webhook details

 - [GET /integrations/api/webhooks/{uuid}](https://api.getsales.io/bundled/webhooks/getwebhookdetails.md): Retrieve detailed information about a specific webhook by its UUID. This includes all configuration details, event type, filters, and timestamps.

### Update webhook

 - [PUT /integrations/api/webhooks/{uuid}](https://api.getsales.io/bundled/webhooks/updatewebhook.md): Update an existing webhook's configuration. You can modify the target URL, event type, HTTP method, name, filters, or enable/disable the webhook. The target_url is required, but other fields are optional.

### Delete webhook

 - [DELETE /integrations/api/webhooks/{uuid}](https://api.getsales.io/bundled/webhooks/deletewebhook.md): Permanently delete a webhook. This action cannot be undone. No further events will be delivered to the target URL.

### Test webhook

 - [POST /integrations/api/webhooks/test](https://api.getsales.io/bundled/webhooks/testwebhook.md): Send a test payload to a webhook endpoint to verify connectivity and integration without waiting for a real event to trigger. Returns execution details including response status, headers, and timing information.

## LLM Connections

Manage external LLM provider connections

### List all LLM connections

 - [GET /integrations/api/llms](https://api.getsales.io/bundled/llm-connections/listllmconnections.md): Retrieve a paginated list of LLM connections with optional filtering by provider, owner, status, or search query. This endpoint allows sales teams to manage and audit their organization's configured LLM providers.

### Create a new LLM connection

 - [POST /integrations/api/llms](https://api.getsales.io/bundled/llm-connections/createllmconnection.md): Create a new LLM connection for your organization. This allows teams to integrate with various LLM providers (OpenAI, Anthropic, Google, DeepSeek, XAI, etc.). The API token is encrypted and stored securely. Note that API token validation is performed at creation time.

### Get a specific LLM connection

 - [GET /integrations/api/llms/{uuid}](https://api.getsales.io/bundled/llm-connections/getllmconnection.md): Retrieve details of a specific LLM connection by UUID. The API token is returned masked for security (showing only last 4 characters).

### Update an LLM connection

 - [PUT /integrations/api/llms/{uuid}](https://api.getsales.io/bundled/llm-connections/updatellmconnection.md): Update an existing LLM connection. You can update the connection name and/or rotate the API token. If updating the API token, it will be validated against the provider's API before the update is persisted.

### Delete an LLM connection

 - [DELETE /integrations/api/llms/{uuid}](https://api.getsales.io/bundled/llm-connections/deletellmconnection.md): Delete an LLM connection permanently. This action cannot be undone. All workflows and automations using this connection will fail if the connection is deleted. Ensure no active processes depend on this connection before deletion.

### Get available LLM configuration options

 - [GET /integrations/api/llms/llm-config-options](https://api.getsales.io/bundled/llm-connections/getllmconfigoptions.md): Retrieve all available LLM providers, their supported models, and configuration parameters. This endpoint helps understand what models are available for each provider and their configuration constraints (temperature ranges, max tokens, etc.). Use this to validate model choices before creating connections.

