YesGraph’s invite API endpoints can help us tune the results of our contact ranking. We can find people and relationships that are like the successful invites in the past.

This endpoint now replaces the deprecated /invite-accepted (singular) endpoint. This is more consistent with REST API practices and allows a batch or individual entry to be sent to the API.

This endpoint should be called when a new accepts user accepts an invite to your app. This endpoint can be used to record a single invite or multiple invites.

POST /invites-accepted

entries required list A list of the accepted invitations.

Entries objects

email required (unless phone is present) string The email address that the invite was sent to. Use this key if the invite was sent via an email.
phone required (unless email is present) string or int The phone number that the invite was sent to. Use this key if the invite was sent via an SMS.
accepted_at optional date The date and time the invitation got accepted. It defaults to the current time if not provided. This is an ISO 8601 date string or a Unix timestamp (integer). See the Dates section for details.
new_user_id optional string or int The new user ID that was the result of accepting the invite, if available.
inviter_user_id optional string or int The user ID of the user who sent the invite.
inviter_name optional string The name of the inviter who sent the invite.
inviter_email optional string The email address of the user who sent the invite. Use this key if the invite was sent via an email.
inviter_phone optional string The phone number of the user who sent the invite. Use this key if the invite was sent via an SMS.
invite_code optional string The invite code which was sent to the invitee, if applicable.

Example

# Use YesGraph's Python SDK 
# https://github.com/yesgraph/python-yesgraph
from yesgraph import YesGraphAPI
api = YesGraphAPI("YOUR_SECRET_KEY")

entries = [{
    "new_user_id": "1111",
    "name":"Kendall",
    "email":"kendall@yesgraph.com",
    "phone": "+1 123 456 7890",
    "accepted_at": "1970-01-01T00:00:00+00:00"
}]

api.post_invites_accepted(entries=entries)

### Response
{"message": "Invite accepted added."}
curl -X POST \
    -H 'Authorization: Bearer YOUR_SECRET_KEY' \
    -H 'Content-Type: application/json' \
    -d '{
        "entries" :
            [
                {
                    "new_user_id": "1111",
                    "name":"Kendall",
                    "email":"kendall@yesgraph.com",
                    "phone": "+1 123 456 7890",
                    "accepted_at": "1970-01-01T00:00:00+00:00"
                }
            ]
    }' \
    https://api.yesgraph.com/v0/invites-accepted

### Response
{"message": "Invite accepted added."}