Create a Household
Request Details
| Item | Value |
| Description | Creates a new household. |
| Method | POST |
| Endpoint | https://[environment]api[client_id].crowdtwist.com/v2/household/?api_key=[api_key]¤t_user=[member_id] |
| Content Type | application/json |
Request
| Field Name | Sample Value | Required | Format | Notes |
| URL PARAMETERS – none | ||||
| QUERY STRING PARAMETERS | ||||
| api_key | QWERTYUIOP | Yes | String | |
| current_user | 240835353 | Yes | Integer | The member who is performing this action. This member will be the household owner. (CrowdTwist ID) |
Request Body
| Field Name | Validation | Format | Notes |
| name | "John’s Household" | String | The name of this household. |
| invites | ["jack@example.com"] | String (Array) | The email addresses of members to be invited to this household |
Successful Response
| Field Name | Sample Value | Format | Description |
| household_id | 3 | Integer | The id of this household |
| name | "John's Household" | String | The name of this household |
| date_created | "2020-11-16T23:51:12.000Z" | String (ISO 8601) | The date this household was created |
| redeemable_points | 200 | Integer | The number of redeemable points currently contributed to this household |
| members | (See Below) | Array of member objects | The members that are currently part of this household |
members
| Parameter | Sample Value | Format | Description |
| id | 240835353 | Integer | The id of this member. (CrowdTwist ID) |
| date_joined | "2020-11-16T23:51:12.000Z" | String | The date this member joined the household |
| owner | true | Boolean | True if this member is the owner of the household |
Sample Successful Response
{
"household_id": 3,
"name": "John’s Household",
"date_created": "2020-11-16T23:51:12.000Z",
"redeemable_points": 200,
"members": [
{
"id": 240835353,
"date_joined": "2020-11-16T23:51:12.000Z",
"owner": true
}
]
}
Error Responses
| Error Code | Description |
| 404 | Unable to find owner. |
| 400 | Member is already part of a household |
| 400 | A non-positive integer value was provided for current_user. |
| 400 | Missing current_user query parameter. |