Users API

Copper provides an API for all major CRUD operations related to Users.

Create a User

POST /accounts/{id}/users

Creates a new User resource associated to the Account specified by the id URL path parameter.

Parameters

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.

Returns

A User resource if object creation was successful.

Example

curl https://api.usecopper.com/next/accounts/mch_12343456/users \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -d name="Santa Clause" \
    -d email="santa@northpole.com" \

Retrieve Account Users

GET /accounts/{id}/users

Retrieves existing User resources owned by an Account specified by the id URL path parameter.

Parameters

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.

Returns

User resources that matched the query.

Example

curl https://api.usecopper.com/next/accounts/mch_1238742382/users \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -d "created[lt]"="2021-10-12"

Delete a User

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.

Parameters

This API method accepts two parameters via the URL path:

  1. account_id: The id of the parent Account of the User.
  2. user_id: The id of the User.

Returns

An HTTP 204 empty response.

Example

curl https://api.usecopper.com/next/accounts/mch_129381231/users/usr_81231231 \
    -u sk_test_XXXXXXXXXXXXXXXXXXXXXXXXXX: \
    -X DELETE