LeadSquared Developer Centre


Revoke Access to a Shared Lead

The Share a Lead API lets you share a lead with a sales user for a particular duration.
This API lets you revoke a user’s access to that lead before the specified duration has elapsed. You’ll get a request Id in the response if the call is successful. You can use this request Id in the Get Status of a Share/Revoke Request API to see if it has been processed.


  • Ensure that you have met the prerequisites listed under Entity Sharing before using this API.
  • All parameters in the request are mandatory except AccessType. The default value is 1 = read.

Revoking lead access for a lead shared in the context of multiple activities –
Let’s assume you’ve shared a lead L1, in the context of two different activities A1 and A2. In the context of activity A1, the lead was shared for say, 3 months and for activity A2 it was shared for 6 months. If you call this API and revoke access in the context of A1, the lead will still be shared in the context of A2 for 6 months.
If you revoke access in the context of A2, the lead will still be shared in the context of A1 (for 3 months).


POST https://{host}/v2/EntityAccess.svc/Revoke?accessKey=AccessKey&secretKey=SecretKey


Content-Type: application/json
JSON Body/Payload Icon
    "UserId": "0203f172-8642-11e7-9bed-069b743e848f",
    "Entity": 1,
    "EntityType": 3,
    "EntityId": "869196",
    "ContextEntity": 1,
    "ContextEntityId": "f2dbf1d5-bbab-418b-bddc-4c92ecdef214",
    "AccessType": 2

Request Parameters

Parameter Description

Id of the sales user who’s access to the lead you want to revoke.

You can use the Get Users API to retrieve user Ids.


Currently the only entity you can share is 1 = Lead.
Pass 1 here.


This is the entity the lead was shared with. Currently only 3 = User is accepted.
Pass 3 here


Pass the ProspectAutoId (also known as LeadAutoId) of the lead that was shared.
You can get it by calling the Get Lead by Id API.


The context through which the lead is being shared. Currently only 1 = Activity is allowed.
Pass 1 here.


Pass the ActivityId here. You can use the Get Activities by Date Range API or other retrieve activity APIs to get it.


Defines if you want to give the user read or write access to the lead.

  • Pass 1 for read access
  • Pass 2 for write access


200 OK
Content-Type: application/json
    "Status": "Success",
    "Message": {
        "Id": "4c224152d0e74190b29038397e3d93af"

HTTP Response Codes

Code Description
200 OK

This is the status code for successful API call.

401 Unauthorized

The API call was made with invalid access credentials. Check your AccessKey and SecretKey.

400 Bad Request

The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure.

404 Not Found

The API could not be found. Please check the API signature.

429 Too Many Requests

API calls exceeded the limit of 25 in 5 second(s)

500 Internal Server Error

The API called failed. There could be many reasons for it. Check the exception message to get more details.

On this page

© 2022 by MarketXpander Services Pvt Ltd. All Rights Reserved.