Delete an Agent
DELETE Method
The Delete an Agent API allows you to remove a registered agent profile from the RCS messaging platform based on agent number. Deleting an agent profile will impact any RCS messaging associated with that agent.
Prerequisites
- After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in kaleyra.io.
- Before you get started, Create an API Key. To view the API Key and the SID, see View API Key and SID.
- To send any RCS messages, you must configure the RCS channel in the Kaleyra platform. To configure the RCS channel in your account, please contact your local Kaleyra representative.
API Domain and Value
| api_domain | Value |
|---|---|
| IN pod | https://rcs-api.in.kaleyra.io |
| NA pod | https://rcs-api.na.kaleyra.io |
API request to delete an Agent
To delete an agent, use the https://rcs-api.<pod>.kaleyra.io/v1/<sid>/rcs/agent/{agent_number} endpoint with the following request method:
The following is the request format to delete an agent:
curl --location --request DELETE 'https://<api_domain>/v1/<sid>/rcs/agent/{agent_number}'\
--header 'Content-Type: <content_type>' \
--header 'api-key: <api-key>'The following is the sample request format to delete an agent:
curl --location --request DELETE 'https://rcs-api.na.kaleyra.io/v1/XXXXX6913850XXXX/rcs/agent/48400'\
--header 'Content-Type: application/json' \
--header 'api-key: XXXXX3b8497f58a94e84b671aca43XXXX' URL Parameters and Headers
The following is the list of parameters and headers to send the outgoing message request:
| Parameter/Headers | Data Type | Description | Example | Mandatory? |
|---|---|---|---|---|
sid | String | Account SID (Security Identifier). | XXXXX6913850XXXX | Yes |
Content-Type | String | Indicates the format of the content the API will be processing. | The only allowed value is application/JSON | Yes |
api-key | String | API key generated from kaleyra.io account. | XXXXX3b8497f58a94e84b671aca43XXXX | Yes |
The following is the list of parameters to be used in the payload to delete an agent by agent number:
| Parameter | Data Type | Description | Example | Mandatory? |
|---|---|---|---|---|
agent_number | string | Auto generated number by the server at the time of create agent request. | 48400 | Yes |
Sample Success Response
The following is the sample success response:
{
"code": "RCS902",
"message": "Agent deleted succesfully",
"data": {
"status": "OK",
"message": "Agent deleted",
"message_key": "message"
},
"error": {}
}Failure Responses
The following is the list of error codes that you can encounter while deleting an agent:
| Scenario | HTTP Status | Error Code | Message | Error Code Constant | Error Message |
|---|---|---|---|---|---|
| Missing Agent Number | 400 | RCS904 | Failed to delete Agent | MISSING_REQUIRED_PARAMS | agent_number missing in path |
| Agent Not Found | 400 | RCS904 | Failed to delete Agent | PROV_ERROR | {"status":"FAILED","message":"Agent not found"} |
| RCS Not Enabled | 400 | RCS601 | RCS Channel is not enabled for this User | RCS_CHANNEL_DISABLED | RCS Channel is not enabled for this User |
| Gateway Error | 500 | RCS502 | Internal Gateway Error | RCS_CHANNEL_INTERNAL_ERROR | Internal Gateway Error |
| Internal Server Error | 500 | RCS500 | Internal server error | RCS_CHANNEL_INTERNAL_ERROR | Internal server error |
Updated about 1 month ago
