User API

post
Create a User

https://www.cotter.app/api/v0/user/create
Create a User during registration
Request
Response
Request
Headers
API_KEY_ID
required
string
Your API_KEY_ID
Content-Type
optional
string
application/json
Body Parameters
identifier
required
string
An identifier for the user, like email, phone number, or username
Response
200: OK
The newly created User object in Cotter's server
{
"ID": "abcdefgh-bc20-4ccb-afdf-7fe16c061b30",
"client_user_id": "abcdefgh-bc20-4ccb-afdf-7fe16c061b30",
"created_at": "2020-08-01T05:55:57.480314022Z",
"default_method": null,
"deleted_at": "0001-01-01T00:00:00Z",
"enrolled": [],
"identifier": "hello@gmail.com",
"identifiers": null,
"issuer": "<YOUR API KEY ID>i",
"updated_at": "2020-08-01T05:55:57.480314368Z"
}

Example Curl Request:

curl -XPOST \
-H 'API_KEY_ID: <your API KEY ID>' \
-H "Content-Type: application/json" \
-d '{"identifier": "hello@gmail.com"}' \
'https://www.cotter.app/api/v0/user/create'

get
Get User

https://www.cotter.app/api/v0/user?identifier=<identifier>
Get a User object using your user's identifier.
Request
Response
Request
Headers
API_KEY_ID
required
string
Your API_KEY_ID
Query Parameters
identifier
optional
string
The identifier for the user, like the email, phone, or username that was used to create the user.
Response
200: OK
If your user has enrolled TRUSTED_DEVICE , you'll get the following response
{
"ID": "abcdefgh-bc20-4ccb-afdf-7fe16c061b30",
"client_user_id": "abcdefgh-bc20-4ccb-afdf-7fe16c061b30",
"created_at": "2020-08-01T05:55:57.480314022Z",
"default_method": "TRUSTED_DEVICE",
"deleted_at": "0001-01-01T00:00:00Z",
"enrolled": ["TRUSTED_DEVICE"],
"identifier": "hello@gmail.com",
"identifiers": null,
"issuer": "<YOUR API KEY ID>i",
"updated_at": "2020-08-01T05:55:57.480314368Z"
}

get
Get All Users

https://www.cotter.app/api/v0/user/list?page=0
Get a list of Users that is registered under your API Key. This endpoint is paginated, each page returns 50 records, ordered by created_at descendant (newest user shows up first)
Request
Response
Request
Headers
API_SECRET_KEY
required
string
Your API_SECRET_KEY
API_KEY_ID
required
string
Your API_KEY_ID
Query Parameters
page
optional
number
The page number that you want to access. Page numbers start from 0. Each page retrieves 50 records, ordered by created_at descendant.
Response
200: OK
A list of the User Object.
[
{
"ID": "jklmnopqr-abcd-abcd-abcd-1168d4b38d0d",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"deleted_at": "0001-01-01T00:00:00Z",
"issuer": "abcdefgh-abcd-abcd-abcd-f901315ad31b",
"client_user_id": "jklmnopqr-abcd-abcd-abcd-1168d4b38d0d",
"enrolled": [],
"default_method": null,
"identifier": "team1@cotter.app",
"identifiers": null
},
{
"ID": "stuvxyza-abcd-abcd-abcd-6eb4c013e610",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "0001-01-01T00:00:00Z",
"deleted_at": "0001-01-01T00:00:00Z",
"issuer": "abcdefgh-abcd-abcd-abcd-f901315ad31b",
"client_user_id": "stuvxyza-abcd-abcd-abcd-6eb4c013e610",
"enrolled": [],
"default_method": null,
"identifier": "team2@cotter.app",
"identifiers": null
},
{
"ID": "abcdefgh-abcd-abcd-abcd-22bc178867ef",
"created_at": "0001-01-01T00:00:00Z",
"updated_at": "2020-07-21T02:42:16.318885Z",
"deleted_at": "0001-01-01T00:00:00Z",
"issuer": "abcdefgh-abcd-abcd-abcd-f901315ad31b",
"client_user_id": "bdabcdefgh-abcd-abcd-abcd-22bc178867ef",
"enrolled": [
"WEBAUTHN"
],
"default_method": "WEBAUTHN",
"identifier": "team@cotter.app",
"identifiers": null
}
]