Cotter
  • 🚀Getting Started
  • Features & Concepts
    • 💬Sign In with Email/Phone Number
    • 🔐Sign In with Device
      • How it works
    • 🧬Sign In with WebAuthn
  • 📌Quickstart Guides
    • All Guides & Tutorials
    • HTML – Sign in with Email/Phone
    • React – Sign in with Email/Phone
    • React – WebAuthn
    • ▲ Next.js
    • Angular
    • Webflow
    • Bubble.io
    • Python SDK for a CLI
    • React Native – Sign in with Device
    • iOS – Sign in with Device
    • Flutter – Sign in with Device
  • 📘SDK Reference
    • Web
      • Sign In with Email/Phone Number
        • Customize the Form
        • Checking the email or phone before sending a verification code
        • Sending Code or Link via WhatsApp
        • Styling
        • Older SDK
          • Customize the Form
      • Sign in with Social Login
        • Getting Access Tokens from Social Login Providers
        • Github Instructions
        • Google Instructions
      • Sign In with WebAuthn
        • Register WebAuthn for a logged-in user
      • Sign In with Device
        • Steps for Pop Up Authentication Prompt
        • Advanced Customization for Login Form
        • Advanced Customization for Pop Up Authentication Prompt
      • Getting Access Token and Logged-In User Info
      • Sending Successful Form Submission
      • FAQ & Troubleshooting
    • React Native
      • Installation
      • Sign In with Device
        • Add Email/Phone Verification
        • Authenticate from a Non-Trusted Device
        • Add a new Trusted Device
        • Remove Trusted Device
      • Sign In with Email/Phone Number
      • Getting Stored OAuth Tokens and User Information
      • FAQ
      • Older SDK Versions
        • Sign in with Email/Phone
        • Sending Code via WhatsApp
        • Sign In with Device
          • Authenticate from a Non-Trusted Device
          • Add a new Trusted Device
          • Customization
    • Flutter
      • Sign In with Device
        • Add Email/Phone Verification
        • Authenticate from a Non-Trusted Device
      • Sign in with Email/Phone Number
      • Getting the Logged-in User
      • Getting OAuth Tokens
      • Signing a User Out
    • iOS
      • Sign In with Email/Phone Number
      • Sign In with Device
        • Authenticate from a Non-Trusted Device
        • Push Notification
        • Check if Trusted Device is Enrolled
        • Add a New Trusted Device
        • Remove Trusted Device
      • Older Versions
        • Biometric/Pin
    • Android
      • Sign In with Device
        • Authenticate from a Non-Trusted Device
        • Check if Trusted Device is Enrolled
        • Add a new Trusted Device
        • Remove Trusted Device
        • Customization
      • Sign In with Email/Phone Number
      • Biometric/Pin
        • Advanced Methods
        • Customization
        • Setting Strings
        • Styling
      • Older SDK Version
        • Sign In with Device
          • Authenticate from a Non-Trusted Device
    • Python (for CLI)
    • API for Other Mobile Apps or CLI
      • Verify Email/Phone Number
        • Handling URL Scheme
    • Backend: Handling Response
  • 🛡️ Protecting Your Account
    • Only Allow Your Website/App to Use Your API Key
    • Rate Limit
    • Enable reCAPTCHA to Protect Against Automated Abuse
  • 🗝️ Getting Access Token
    • Cotter's OAuth 2.0 Tokens Specification
    • Getting the Tokens
      • Get Tokens during Authentication
      • Using the Refresh Token
    • Storing and Removing Tokens
    • Renewing Expired Tokens
    • Verifying JWT Tokens
    • Requesting Custom Fields on your JWT Token
    • Older API
      • Using HTTP Requests
      • Getting the Tokens
        • During Authentication
          • During Email/Phone Verification
        • During enrolling Trusted Devices
  • 🔌API Reference
    • User API
      • User Object
    • OAuth Tokens API
      • Verify JWT Token using API (serverless)
      • Requesting Custom Claims on your Access Token
      • Older API
    • OAuth Tokens from Social Login
    • Event Object
    • Reset PIN API
  • Older API
    • Validating Cotter's Identity Token
    • Validating Cotter's Event Response
Powered by GitBook
On this page
  • Create a User
  • Get User
  • Get All Users
  1. API Reference

User API

Create a User

POST https://www.cotter.app/api/v0/user/create

Create a User during registration

Headers

Name
Type
Description

API_KEY_ID

string

Your API_KEY_ID

Content-Type

string

application/json

Request Body

Name
Type
Description

identifier

string

An identifier for the user, like email, phone number, or username

{
  "ID": "abcdefgh-bc20-4ccb-afdf-7fe16c061b30", // [Deprecated] Cotter User ID
  "client_user_id": "abcdefgh-bc20-4ccb-afdf-7fe16c061b30", // [Deprecated]
  "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 User

GET https://www.cotter.app/api/v0/user?identifier=<identifier>

Get a User object using your user's identifier.

Query Parameters

Name
Type
Description

identifier

string

The identifier for the user, like the email, phone, or username that was used to create the user.

Headers

Name
Type
Description

API_KEY_ID

string

Your API_KEY_ID

{
  "ID": "abcdefgh-bc20-4ccb-afdf-7fe16c061b30", // [Deprecated] Cotter User ID
  "client_user_id": "abcdefgh-bc20-4ccb-afdf-7fe16c061b30", // [Deprecated]
  "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 All Users

GET 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)

Query Parameters

Name
Type
Description

page

number

The page number that you want to access. Page numbers start from 0. Each page retrieves 50 records, ordered by created_at descendant.

Headers

Name
Type
Description

API_SECRET_KEY

string

Your API_SECRET_KEY

API_KEY_ID

string

Your API_KEY_ID

[
  {
    "ID": "jklmnopqr-abcd-abcd-abcd-1168d4b38d0d", // [Deprecated] Cotter User ID
    "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", // [Deprecated] Cotter User ID
    "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", // [Deprecated] Cotter User ID
    "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
  }
]
PreviousDuring enrolling Trusted DevicesNextUser Object

Last updated 3 years ago

🔌