Delete Custom Layout

Purpose

To delete a custom layout and transfer its records to another active layout.

Request Details

Request URL

{api-domain}/crm/{version}/settings/layouts/{layout_id}

Header

Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52

Scope

scope = ZohoCRM.settings.layouts.DELETE (or)
scope = ZohoCRM.settings.layouts.ALL (or)
scope = ZohoCRM.settings.ALL 

Parameters

  • modulestring, mandatory

    Specify the module API name from which you want to delete the custom layout. Use the GET Module Metadata API to get the module API names. Supported modules are Leads, Contacts, Accounts, Deals, Products, Quotes, Sales Orders, Purchase, Orders, Invoices, Campaigns, Vendors, Price Books, Cases, Solutions, and Custom.

  • transfer_tostring, mandatory

    Specify the ID of the layout to which you want to transfer the records. Use the GET Layout Metadata API to get the layout IDs.

Note

You can delete one custom layout in a single API call.

Sample Request

Copiedcurl "https://www.zohoapis.com/crm/v7/settings/layouts/5725767000002269121?module=Leads&transfer_to=5725767000002256361"
-X DELETE
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"

Possible Errors

  • INVALID_DATAHTTP 400

    Given ID of the layout seems to be invalid
    Resolution: Specify a valid layout ID. Use the GET Layout Metadata API to retrieve unique layout IDs.

  • NOT_ALLOWEDHTTP 400
    • Cannot transfer to the deactivated layout
      Resolution: The layout ID specified in the "transfer_to" parameter has been deactivated. Specify an active layout ID. The status key in the response from the Layout Metadata API indicates whether the layout is active or inactive.
    • You cannot delete the system-defined layout
      Resolution: Only custom layouts can be deleted. Please specify a custom layout ID. Use the GET Layout Metadata API to retrieve unique layout IDs. For custom layouts, the key "generated_type" will be set to "custom".
  • NO_PERMISSIONHTTP 400

    Permission denied
    Resolution:  You do not have permission to delete the layout. Contact your system administrator.

  • REQUIRED_PARAM_MISSINGHTTP 400

    Required parameter is missing
    Resolution: Specify all the mandatory parameters. See the Parameter section above.

  • INVALID_REQUEST_METHODHTTP 400

    The http request method type is not a valid one
    Resolution: You have specified an invalid HTTP method to access the API URL.
    Specify a valid request method. Refer to the endpoints section above.

  • OAUTH_SCOPE_MISMATCHHTTP 401

    Unauthorized
    Resolution: The client does not have a valid scope to delete a custom layout. Create a new token with the required scopes. Refer to the scope section above.

  • AUTHENTICATION_FAILUREHTTP 401

    Authentication failed
    Resolution: Pass the access token in the request header of the API call.

  • INVALID_URL_PATTERNHTTP 404

    Please check if the URL trying to access is a correct one
    Resolution: The request URL specified is incorrect. Specify a valid request URL. Refer to the request URL section above.

  • INTERNAL_ERRORHTTP 500

    Internal Server Error
    Resolution: Unexpected and unhandled exception in the server. Contact support team.

Sample Response

Copied{
    "layouts": [
        {
            "code": "SUCCESS",
            "details": {
                "id": "5725767000002256447"
            },
            "message": "layout deleted",
            "status": "success"
        }
    ]
}