Skip to content

DELETE   /leads/{leadId}/archive

Unarchive a lead

Unarchives a specific lead by its ID. The user must have access to the account that owns the lead.

Authentication Required

Authorization: Bearer {token}   header string

This header is required to access this endpoint

Required Parameters

x-account-id   header string

Account ID for the request

leadId   path integer

The ID of the lead to unarchive

Try it out

Loading...

Output:

Responses

Description

Lead unarchived successfully

{
"id": 0,
"accountId": "string",
"teamId": 0,
"leadSourceId": 0,
"applicationId": "string",
"firstName": "string",
"lastName": "string",
"imgSrc": "string",
"email": "string",
"phone": "string",
"company": "string",
"jobTitle": "string",
"branch": "string",
"source": "string",
"position": "string",
"location": "string",
"productsServicesSold": "string",
"numberOfEmployees": 0,
"currentPaymentProcessor": "string",
"monthlyTransactionVolume": 0,
"interestedInSwitching": false,
"processStage": "string",
"buyingRole": "string",
"assignedTo": "string",
"notes": "string",
"lastContacted": "string",
"archived": false,
"createdBy": "string",
"createdAt": "string",
"updatedAt": "string",
"auditLog": [
{
"id": 0,
"event": "string",
"user": "string",
"apiKey": "string",
"data": {},
"created": "string",
"requestMethod": "string",
"requestPath": "string",
"requestHeaders": {},
"requestIpAddress": "string",
"account_id": "string"
}
]
}

References

#/components/parameters/xAccountIdHeader

in: header
name: x-account-id
schema:
type: string
description: Account ID for the request
required: true
example: "2311"

#/components/schemas/Lead

type: object
description: Lead object representing a potential customer or client
properties:
id:
type: integer
description: Unique identifier for the lead
readOnly: true
accountId:
type: string
description: ID of the account that owns this lead
teamId:
type: integer
description: ID of the team associated with this lead. Required if teams exist
in the account, unless skipTeamAndSourceRequirement=true.
leadSourceId:
type: integer
description: ID of the lead source associated with this lead. Required if the
team has lead sources, unless skipTeamAndSourceRequirement=true.
applicationId:
type: string
description: Optional application ID associated with this lead
firstName:
type: string
description: Lead's first name
lastName:
type: string
description: Lead's last name
imgSrc:
type: string
description: URL to lead's profile image
email:
type: string
description: Lead's email address
phone:
type: string
description: Lead's phone number
company:
type: string
description: Company name
jobTitle:
type: string
description: Lead's job title
branch:
type: string
description: Branch location
source:
type: string
description: Text description of lead source
position:
type: string
description: Position within company
location:
type: string
description: Geographic location
productsServicesSold:
type: string
description: Products or services the lead sells
numberOfEmployees:
type: integer
description: Number of employees at the lead's company
currentPaymentProcessor:
type: string
description: Lead's current payment processor
monthlyTransactionVolume:
type: integer
description: Monthly transaction volume in dollars
interestedInSwitching:
type: boolean
description: Whether the lead is interested in switching services
processStage:
type: string
description: Current stage in the sales process
buyingRole:
type: string
description: Lead's role in buying decisions
assignedTo:
type: string
description: User assigned to this lead. If not provided, will be automatically
assigned using lead rotation if available.
notes:
type: string
description: General notes about the lead
lastContacted:
type: string
format: date-time
description: Date and time of last contact with this lead
archived:
type: boolean
default: false
description: Whether the lead is archived
createdBy:
type: string
description: Email of the user who created the lead
createdAt:
type: string
format: date-time
description: When the lead was created
readOnly: true
updatedAt:
type: string
format: date-time
description: When the lead was last updated
readOnly: true
auditLog:
type: array
description: Comprehensive audit log of all significant events and actions
performed on the lead
readOnly: true
items:
type: object
properties:
id:
type: integer
description: Unique identifier for the audit log entry
event:
type: string
description: Type of event (e.g., lead_created, lead_updated, lead_archived,
lead_converted)
user:
type: string
description: Email address or identifier of the user who performed the action
apiKey:
type: string
nullable: true
description: API key identifier if the action was performed via API key
authentication
data:
type: object
description: Event-specific data containing details about what was changed or
accessed (structure varies by event type)
created:
type: string
format: date-time
description: Timestamp when the event occurred
requestMethod:
type: string
description: HTTP method used (GET, POST, PATCH, DELETE)
requestPath:
type: string
description: API endpoint path that was called
requestHeaders:
type: object
description: Sanitized HTTP headers from the request (sensitive values are masked)
requestIpAddress:
type: string
description: IP address of the request origin
account_id:
type: string
description: Account ID associated with the action
required:
- id
- firstName
- lastName

Route Source Code

Check out the source code for this route entrypoint here: /leads/[leadId]/archive/route.ts

Or the swagger.yaml spec this documentation was generated from: /leads/swagger.yaml