Users and sessions

Sign up, sign in and manage the user session. Programs normally use API keys instead; a session is needed to create the first key.

The User object

Properties

  • Name
    object
    Type
    'user'
    Description

    The object type.

  • Name
    id
    Type
    string
    Description

    Unique identifier, prefixed by the object type.

  • Name
    email
    Type
    string
    Description

     

  • Name
    name
    Type
    string or null
    Description

    Display name.

  • Name
    emailVerified
    Type
    boolean
    Description

     

  • Name
    hasPassword
    Type
    boolean
    Description

     

  • Name
    googleLinked
    Type
    boolean
    Description

     

  • Name
    createdAt
    Type
    string
    Description

    When it was created (ISO 8601).


POST/v1/auth/signup

Register a user; creates their account and first workspace

Required attributes

  • Name
    email
    Type
    string
    Description

     

  • Name
    password
    Type
    string
    Description

     

Optional attributes

  • Name
    name
    Type
    string
    Description

    Display name.

  • Name
    accountName
    Type
    string
    Description

    Agency / company name. Defaults to the user's name.

Request

POST
/v1/auth/signup
curl -X POST https://core.leadveyor.com/v1/auth/signup \
  -H "Content-Type: application/json" \
  -d '{
    "email": "owner@example.com",
    "password": "correct horse battery",
    "name": "name",
    "accountName": "accountName"
  }'

Response 201

{
  "user": {
    "object": "user",
    "id": "usr_3fK9aQ2LmZp8VxR1cT0bYw7e",
    "email": "owner@acme.example",
    "name": null,
    "emailVerified": false,
    "hasPassword": false,
    "googleLinked": false,
    "createdAt": "2026-11-02T09:30:00.000Z"
  },
  "account": {
    "object": "account",
    "id": "acc_8Hc2Qe5VnLx0TzJ4uM1rWk6a",
    "name": "name",
    "createdAt": "2026-11-02T09:30:00.000Z"
  },
  "workspace": {
    "object": "workspace",
    "id": "ws_Bd0Kh8oOOL8dKLzdocJ2isAj",
    "accountId": "acc_mZp0zVZomHFwUbbYrEqmSM9w",
    "name": "Acme Renovations",
    "businessContext": null,
    "location": null,
    "locale": {
      "language": "en",
      "timezone": "UTC",
      "currency": "USD"
    },
    "businessHours": null,
    "defaultProfileId": "prof_R0CsTy4Qwb8DwkNhFdnXsiVp",
    "retentionDays": 90,
    "createdAt": "2026-10-23T14:51:53.415Z",
    "updatedAt": "2026-10-23T14:51:55.684Z"
  },
  "session": {
    "object": "session",
    "token": "token",
    "expiresAt": "2026-11-02T09:30:00.000Z"
  }
}

POST/v1/auth/login

Sign in with email and password

Required attributes

  • Name
    email
    Type
    string
    Description

     

  • Name
    password
    Type
    string
    Description

     

Request

POST
/v1/auth/login
curl -X POST https://core.leadveyor.com/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "owner@example.com",
    "password": "password"
  }'

Response 200

{
  "user": {
    "object": "user",
    "id": "usr_3fK9aQ2LmZp8VxR1cT0bYw7e",
    "email": "owner@acme.example",
    "name": null,
    "emailVerified": false,
    "hasPassword": false,
    "googleLinked": false,
    "createdAt": "2026-11-02T09:30:00.000Z"
  },
  "session": {
    "object": "session",
    "token": "token",
    "expiresAt": "2026-11-02T09:30:00.000Z"
  }
}

POST/v1/auth/google

Sign in or register with Google (authorization code from the redirect, or an ID token)

Optional attributes

  • Name
    code
    Type
    string
    Description

    Authorization code from Google's redirect (the console's flow)

  • Name
    redirectUri
    Type
    string
    Description

    The redirect URI the code was issued for; required with code

  • Name
    idToken
    Type
    string
    Description

    Alternatively, a Google ID token (e.g. from a mobile app)

Request

POST
/v1/auth/google
curl -X POST https://core.leadveyor.com/v1/auth/google \
  -H "Content-Type: application/json" \
  -d '{
    "code": "code",
    "redirectUri": "redirectUri",
    "idToken": "idToken"
  }'

Response 200

{
  "user": {
    "object": "user",
    "id": "usr_3fK9aQ2LmZp8VxR1cT0bYw7e",
    "email": "owner@acme.example",
    "name": null,
    "emailVerified": false,
    "hasPassword": false,
    "googleLinked": false,
    "createdAt": "2026-11-02T09:30:00.000Z"
  },
  "session": {
    "object": "session",
    "token": "token",
    "expiresAt": "2026-11-02T09:30:00.000Z"
  },
  "isNew": false
}

POST/v1/auth/logout

Revoke the current session

Request

POST
/v1/auth/logout
curl -X POST https://core.leadveyor.com/v1/auth/logout \
  -H "Authorization: Bearer {api_key}"

POST/v1/auth/password/forgot

Required attributes

  • Name
    email
    Type
    string
    Description

     

Request

POST
/v1/auth/password/forgot
curl -X POST https://core.leadveyor.com/v1/auth/password/forgot \
  -H "Content-Type: application/json" \
  -d '{
    "email": "owner@example.com"
  }'

POST/v1/auth/password/reset

Set a new password with a reset token; signs out all sessions

Required attributes

  • Name
    token
    Type
    string
    Description

     

  • Name
    password
    Type
    string
    Description

     

Request

POST
/v1/auth/password/reset
curl -X POST https://core.leadveyor.com/v1/auth/password/reset \
  -H "Content-Type: application/json" \
  -d '{
    "token": "token",
    "password": "correct horse battery"
  }'

GET/v1/me

Current user with accounts, roles and workspaces

Request

GET
/v1/me
curl https://core.leadveyor.com/v1/me \
  -H "Authorization: Bearer {api_key}"

Response 200

{
  "user": {
    "object": "user",
    "id": "usr_3fK9aQ2LmZp8VxR1cT0bYw7e",
    "email": "owner@acme.example",
    "name": null,
    "emailVerified": false,
    "hasPassword": false,
    "googleLinked": false,
    "createdAt": "2026-11-02T09:30:00.000Z"
  },
  "memberships": [
    {
      "role": "owner",
      "account": {
        "object": "account",
        "id": "acc_8Hc2Qe5VnLx0TzJ4uM1rWk6a",
        "name": "name",
        "createdAt": "2026-11-02T09:30:00.000Z"
      },
      "workspaces": [
        {
          "object": "workspace",
          "id": "ws_Bd0Kh8oOOL8dKLzdocJ2isAj",
          "accountId": "acc_mZp0zVZomHFwUbbYrEqmSM9w",
          "name": "Acme Renovations",
          "businessContext": null,
          "location": null,
          "locale": {
            "language": "en",
            "timezone": "UTC",
            "currency": "USD"
          },
          "businessHours": null,
          "defaultProfileId": "prof_R0CsTy4Qwb8DwkNhFdnXsiVp",
          "retentionDays": 90,
          "createdAt": "2026-10-23T14:51:53.415Z",
          "updatedAt": "2026-10-23T14:51:55.684Z"
        }
      ]
    }
  ]
}

Was this page helpful?