Create Account Member
Creates a new member for the account associated with your API token.
Endpoint
POST /api/v1/members
Headers
Content-Type: application/json
Authorization: Bearer <your_api_token>
Parameters
Body Parameters
Parameter | Type | Required | Description |
---|---|---|---|
member[first_name ] |
string | Yes | The first name of the member |
member[last_name ] |
string | No | The last name of the member |
member[phone ] |
string | Yes | The phone number of the member |
member[opt_in_status ] |
string | Yes | The member’s messaging consent status. Valid values: pending , opted_in , opted_out . See note below about opt-in requirements. |
member[pod_ids ] |
array or string | No | IDs of additional pods to assign the member to. Can be an array of IDs or a comma-separated string. Members are always added to the default pod automatically. |
Important Note About Opt-In Status
When setting opt_in_status
to opted_in
, you must ensure that:
- You have received explicit consent from the member to receive text messages
- The member understands they can reply “STOP” at any time to opt out
- You have informed the member about message frequency and any applicable charges
- You are compliant with all applicable telecommunications regulations
If you haven’t received explicit consent, set opt_in_status
to pending
. Members will be sent a welcome message and can opt in by replying “YES” to the welcome message.
Example Request
curl -X POST \
"http://api.example.com/api/v1/members" \
-H "Authorization: Bearer your_api_token" \
-H "Content-Type: application/json" \
-d '{
"member": {
"first_name": "John",
"last_name": "Doe",
"phone": "+12345678901",
"opt_in_status": "pending",
"pod_ids": [2, 3]
}
}'
Success Response
Status Code
201 Created
Response Body
{
"id": 456,
"name": "John Doe",
"phone": "+1234567890",
"opt_in_status": "pending",
"account_id": 123,
"created_at": "2024-01-20T12:00:00Z",
"updated_at": "2024-01-20T12:00:00Z"
}
Error Responses
Invalid Parameters
Status Code: 422 Unprocessable Entity
{
"name": ["First name can't be blank"],
"phone": ["is invalid"]
}
Unauthorized
Status Code: 401 Unauthorized
{
"error": "Unauthorized access"
}
Invalid or Missing API Token
Status Code: 401 Unauthorized
{
"error": "Invalid API token"
}