Keystone Developers
Open Keystone
API reference

Console API

Guest

5 endpoints.

GET/api/v1/admin/businesses/{business_id}/guest

Whether the business is held by a guest

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Responses

200Successful Response
application/jsonSuccessResponse_GuestStatus_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredGuestStatus
GuestStatus fields
FieldTypeDescription
guestrequiredboolean
claimedrequiredboolean
finishedrequiredboolean
metadataResponseMetadata | null
ResponseMetadata fields
FieldTypeDescription
paginationPaginationMetadata | null
PaginationMetadata fields
FieldTypeDescription
limitrequiredinteger
next_cursorstring | null
prev_cursorstring | null
has_morerequiredboolean
has_prevbooleandefault false
total_countinteger | null
status_countsobject | null
object | null fields

Map of string to integer

lifecycle_countsLifecycleCounts | null
LifecycleCounts fields
FieldTypeDescription
allintegerdefault 0
leadintegerdefault 0
prospectintegerdefault 0
customerintegerdefault 0
former_customerintegerdefault 0
classification_countsClassificationCounts | null
ClassificationCounts fields
FieldTypeDescription
signalobject
object fields

Nested object (not expanded)

touchobject
object fields

Nested object (not expanded)

stageobject
object fields

Nested object (not expanded)

metaResponseMeta | null
ResponseMeta fields
FieldTypeDescription
totalinteger | null
total_countinteger | null
pageinteger | null
per_pageinteger | null
  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/businesses/{business_id}/guest/claim/code

Sign up from the guest: send the visitor a code

The signed-in guest gives their email, and Heimdal emails a code. When an account has that email already, the code is its sign-in code (`existing`). An email on the guest domain is 409 `EMAIL_EXISTS`; another code too soon, or past the hourly limit, is 429 `CODE_COOLDOWN` with `retry_in_seconds`.

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Request bodyrequired

application/jsonGuestClaimCodeBody
FieldTypeDescription
emailrequiredstring (email)

Responses

200Successful Response
application/jsonSuccessResponse_GuestClaimCodeResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredGuestClaimCodeResponse
GuestClaimCodeResponse fields
FieldTypeDescription
existingrequiredboolean

The code signs in to the account that has the email already

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/businesses/{business_id}/guest/claim/details

Sign up from the guest: their name, their business, and a phone and password if they want

After the code. A website that isn't one is 400 `INVALID_WEBSITE_URL`. Businesses on Keystone already with the same website or Google listing are 409 `BUSINESS_MATCHES` (`details.businesses`, by name) unless `create_anyway`. A phone another account has proven is 409 `PHONE_EXISTS`.

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Request bodyrequired

application/jsonGuestClaimDetailsBody
FieldTypeDescription
first_namerequiredstringmin length 1 · max length 100
last_namerequiredstringmin length 1 · max length 100
business_namerequiredstringmin length 1 · max length 255
websitestring | null

The business's website, if it has one

place_idstring | null

Its Google listing's place id (ChIJ…), if it has one

create_anywayboolean

Keep it though businesses on Keystone already share its website or Google listing

default false
passwordstring | null

Optional. Heimdal's rules: 8 or more, with an uppercase letter, a lowercase letter, a digit and a symbol

phonestring | null

Optional. Their mobile, unproven until they sign in with it

Responses

200Successful Response
application/jsonSuccessResponse_GuestStatus_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredGuestStatus
GuestStatus fields

GuestStatus, expanded above.

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

POST/api/v1/admin/businesses/{business_id}/guest/claim/verify

Sign up from the guest: the code makes the account the visitor's

The code from the email, with the same email. Right, the account and business are the visitor's from then on, with a session for it; for an account they had already (`existing`), that account is signed in, the business and everything the guest did in it are its, and the guest is deleted. Wrong is 400 `INVALID_CODE`, and too many wrong codes 429 `TOO_MANY_CODE_ATTEMPTS`.

Authentication

Authorization: Bearer <token>.

Parameters

NameInTypeDescription
business_idrequiredpathstring (uuid)

Request bodyrequired

application/jsonGuestClaimVerifyBody
FieldTypeDescription
emailrequiredstring (email)
coderequiredstringmin length 4 · max length 12

Responses

200Successful Response
application/jsonSuccessResponse_GuestClaimVerifyResponse_
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredGuestClaimVerifyResponse
GuestClaimVerifyResponse fields
FieldTypeDescription
guestrequiredboolean
claimedrequiredboolean
finishedrequiredboolean
access_tokenrequiredstring
refresh_tokenrequiredstring
existingrequiredboolean

Signed in to an account they had already, which the business is now

metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.

GET/api/v1/admin/guests

The guests nobody has signed up from yet

Authentication

Authorization: Bearer <token>.

Responses

200Successful Response
application/jsonSuccessResponse_list_GuestSummary__
FieldTypeDescription
request_idrequiredstring
successtruedefault true
datarequiredGuestSummary[]
GuestSummary[] fields
FieldTypeDescription
business_idrequiredstring (uuid)
business_namerequiredstring
started_atrequiredstring (date-time)
metadataResponseMetadata | null
ResponseMetadata fields

ResponseMetadata, expanded above.

metaResponseMeta | null
ResponseMeta fields

ResponseMeta, expanded above.

  • 400Bad request
  • 401Unauthorized
  • 403Forbidden
  • 404Not found
  • 422Validation error
  • 500Internal server error
  • 503Service unavailable

Error bodies: ErrorResponse. See Errors.