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-sent (singular) endpoint. This allows us to be more flexible and accept either a batch of inputs or a single input.

/invites-sent should be called when a user sends an invitation over email or SMS. This endpoint can be used to enter a single or multiple items.

POST /invites-sent

entries required list A list of the invitations sent.

Entries objects

user_id required string or int The unique ID you use internally to reference the user sending the invite. Note: if you pass in a numeric user ID, it will be converted to a string, and thus returned as a string.
sent_at optional date The date and time the invitation was sent. If not provided, this field defaults to the current time. The format should be an ISO 8601 date string or a Unix timestamp (integer). See the Dates section for details.
email required unless phone is present string The email address of the invite recipient. Use this field if the invite was sent via email.
phone required unless email is present string or int The phone number of the invite recipient. Use this field if the invite was sent via SMS.


# Use YesGraph's Python SDK 
from yesgraph import YesGraphAPI
api = YesGraphAPI("YOUR_SECRET_KEY")

entries = [{
    "user_id": "1111",
    "invitee_name": "kendall",
    "email": "",
    "phone": "2223332222",
    "sent_at": "2015-02-28T20:16:12+00:00"

curl -X POST \
    -H 'Authorization: Bearer YOUR_SECRET_KEY' \
    -H 'Content-Type: application/json' \
    -d '
    {"entries" :
        "user_id": "1111",
    "invitee_name": "kendall",
        "email": "",
        "phone": "2223332222",
        "sent_at": "2015-02-28T20:16:12+00:00"
    }' \

### Response
  "message": "Invite sent added."