Headless verify returns authorized

Updated APIBreaking

Since then: a good live verify makes the person's Layout account again, and answers status: "active" and claimed: true. See Verifying makes the Layout account. The rest of this entry is as it was published.

What changed

A security issue with the codes Layout texts people is fixed. As part of the fix, codes do one thing each, and production headless verify answers differently.

Codes do one thing

  • A verification code verifies. The code POST /v1/users/:id/verify/start texts is good for that person's number and your application only, for 3 minutes and five tries. It cannot sign anyone in to Layout.
  • An order code approves one order, at that amount, once.
  • Layout writes the texts. The order text names the total that will be charged and the store. Nothing your application sends appears in either text.
  • If the person once replied STOP to Layout, no code can reach them: verify/start answers 409 texts_blocked. They reply START to the number Layout texts from, then you try again.

Headless verify in production

A good code on a production user connects your application to that person and does nothing else. It no longer makes a Layout account, so the person is still provisioned:

POST /v1/users/usr_4b8e9a01c2d3/verify
{ "code": "482913" }

200 OK
{ "verified": true, "authorized": true, "status": "provisioned", "claimed": false }
  • authorized: true means you can mint a build grant straight away.
  • When the number belongs to an existing Layout account, authorized is false and the answer carries next: "connect": send the owner the connect link.
  • After five wrong tries, or three minutes, verify answers 400 code_expired. Text a new code.
  • claimed becomes true once the person signs up to Layout themselves, and your connection carries over.
  • When a person you provisioned signs up themselves, your application stays connected only if it already was, through a good verify or the connect screen. Otherwise POST /v1/users/:id/grant answers 409 until they approve your app.
  • Sandbox, with the code 000000, answers as before, now with authorized: true.

Testing has limits of its own

  • Builds. Sandbox builds, and builds for an application not yet approved, share a daily pool separate from approved production builds. Each developer account may use 250 of it a day in each environment.
  • Place search. In sandbox, and for an application not yet approved, GET /v1/places searches only the places Layout already knows, so it can return fewer results. searchLimit says when that happened.
  • Reads. Place reads, live menu reads and knowledge answers count every application on your developer account together.
  • An allowance Layout cannot read refuses with 503 unavailable and Retry-After. Nothing ran; retry it.

Also

  • A build grant never sees the person's card over MCP: no brand, no last four, no confirmation card.
  • An unexpected failure on any /v1 developer route answers the published error shape, { "error": { "code", "message" } }.
  • An OAuth client your application created is refused on MCP, as it already was on the API, when the application is deleted or suspended, or for a production person while the application is not approved.

Why it matters

A code a person shares with your app can only do what it says. Testing can no longer use up the room production orders need.

What to do

If your code waits for claimed: true or status: "active" after a production headless verify, wait for authorized: true instead. If a person you provisioned signs up to Layout and your grant call starts answering 409, send them the connect link. See Verify their phone.

Breaking changes

Yes, for production headless verify. A good code used to answer "status": "active", "claimed": true for a new number, and now answers "status": "provisioned", "claimed": false until the person signs up themselves. A person who signs up no longer connects an application they never verified with or approved. A code is checked only against the last one Layout texted, for five tries. Nothing else changes in sandbox.

All changes