Skip to content

API to change requester email address

Views
1870
Last updated

API Endpoint

{account_url}/api/v2/public/requesters/actions/change-email/

Method

POST
Request Data

Change requester email address

 

Parameters

Parameter Description
requester_id   ID of the requester for whom email needs to be updated
from_email Existing email address of the requester which needs to be updated
to_email New email address which needs to be set

Note

Sample Response

Success Response: Status code 200

{
    "id": 25641,
    "name": "lisa taylors",
    "email": "[email protected]",
    "phones": [
        {
            "id": 23634,
            "type": "mobile",
            "number": "+168621326920"
        }
    ],
    "custom_fields": [
        {
            "id": 1,
            "name": "CCF 3",
            "type": "t",
            "value": "New"
        },
    ],
    "primary_phone": {
        "id": 23634,
        "type": "mobile",
        "number": "+368621326920"
    },
    "created_at": "2023-06-26T13:55:25Z",
    "updated_at": "2023-06-28T02:08:22Z"
}

 

Error Response(s)

Case 1: When both requester_id and from_email is not present in the request.

{
    "non_field_errors": [
        "Either from_email or requester_id is required."
    ]
}

Case 2: When requester with from_email is not present

{
    "from_email": [
        "Requester with email [email protected] does not exist."
    ]
}

Case 3: When requester with requester_id is not present.

{
    "requester_id": [
        "Requester with id 100 does not exist."
    ]
}

Case 4: When requester with to_email is already present.

{
    "to_email": [
        "Requester with email [email protected] already exists."
    ]
}

Case 5: When requester with to_email is already present in pending status.

{
    "to_email": [
        "Requester with email [email protected] already exists in pending status"
    ]

Case 6: When trying to update a redacted requester.

Response code: 403

{
    "detail": "You do not have access to this contact"
}

 

Tags