Copper provides an API for all major CRUD operations related to Users.
POST /accounts/{id}/users
Creates a new User resource associated to the Account specified by the id
URL path parameter.
Many - but not all - properties of User resources are accepted as parameters to this API. Specifically:
Parameter | Type | Required? | Description |
---|---|---|---|
name |
string | Required | The name of the user. |
email |
string | Required | The email to associate with the user. Must be a valid email that the user can receive emails from; required in order to manage the user account, set or reset a password, etc. |
A User resource if object creation was successful.
curl https://api.usecopper.com/next/accounts/mch_12343456/users \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-d name="Santa Clause" \
-d email="santa@northpole.com" \
GET /accounts/{id}/users
Retrieves existing User resources owned by an Account specified by the id
URL path parameter.
This API accepts the base pagination parameters. In addition, you may provide the following parameters to further refine your query:
Parameter | Type | Required? | Description |
---|---|---|---|
created[gte] |
string | Optional | Retrieves users that were created on or after the specified ISO 8601-formatted value. |
created[gt] |
string | Optional | Retrieves users that were created after the specified ISO 8601-formatted value. |
created[lte] |
string | Optional | Retrieves users that were created on or before the specified ISO 8601-formatted value. |
created[lt] |
string | Optional | Retrieves users that were created before the specified ISO 8601-formatted value. |
User resources that matched the query.
curl https://api.usecopper.com/next/accounts/mch_1238742382/users \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-d "created[lt]"="2021-10-12"
DELETE /accounts/{account_id}/users/{user_id}
Deletes an existing User resource, specified by the user_id
, whose parent Account is specified by account_id
.
This API method accepts two parameters via the URL path:
An HTTP 204 empty response.
curl https://api.usecopper.com/next/accounts/mch_129381231/users/usr_81231231 \
-u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
-X DELETE