Public
PhoneSessions

Complete phone sign-in (verify code)

Passwordless phone sign-in, step 2: checks the SMS code. On success the mobile is marked verified, the account is created if new (with an unusable random password; account_mode applies then, default grower), and a first-party Doorkeeper access token is returned — the same payload as POST /users/sign-in.

With the optional property_draft (the landing page's map, design handoff 29) and a number that has no account yet, the property — and the business, when owner_kind is business — is created in the same transaction as the account. An existing account signs in and the draft is ignored. The draft is checked before the code for every number, so an invalid one is a 422 that spends no code.

post/users/phone-sessions/verify

Request

  • Base URL: https://api.purplegrain.com/api/v1
  • URL: https://api.purplegrain.com/api/v1/users/phone-sessions/verify
  • Auth: none declared

Request body

mobilestring required
codestring required

The 6-digit code from the SMS.

account_mode'grower' | 'contractor'

Applied only when the account is created by this verification; defaults to grower.

Example request

{
  "property_draft": {
    "location": {
      "label": "Currawarna NSW 2650"
    }
  }
}

Response

Signed in — Doorkeeper access token; includes user_id.

access_tokenstring required

Opaque bearer token. Send as header Authorization: Bearer {token} on /api/v1/* routes.

token_typestring required
expires_ininteger

Lifetime of the access token in seconds.

refresh_tokenstring nullable

Present when the client and grant type allow refresh tokens.

scopestring

Granted scopes (space-separated).

user_idstring uuid nullable

Only returned by first-party JSON endpoints (/users/sign-in, /users/access-tokens), not by POST /oauth/token.

actor_idstring uuid nullable

The acting entity's id (first-party endpoints only). Equals user_id today; becomes the Organization id when a token is scoped to act for an organization.

actor_type'User' | 'Organization' nullable

Polymorphic type of actor_id (first-party endpoints only).

Example response

{
  "token_type": "Bearer"
}

Changes

No recorded changes to this operation across all 4 revisions of this API.