arazzo: 1.0.1
info:
title: Stytch User Create, Search, and Delete
summary: Create a user, find them again by email search, then delete the matched user.
description: >-
A user lifecycle management flow for consumer apps. The workflow creates a
user, searches the user store by email to confirm the record exists, and
then branches: when the search returns a match it deletes the matched user,
and when no match is found it ends without deleting anything. Every step
spells out its request inline so the flow can be read and executed without
opening the underlying OpenAPI description. All calls authenticate with HTTP
Basic auth using your Stytch project_id as the username and secret as the
password.
version: 1.0.0
x-realizes-capability-ids:
- BC-620.20
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-620.20
capability_name: Identity & Access Management
spec: stytch-user-api-openapi.yml
confidence: 0.75
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: userApi
url: ../openapi/stytch-user-api-openapi.yml
type: openapi
workflows:
- workflowId: user-create-search-delete
summary: Provision a user, locate them by email search, and delete the match.
description: >-
Creates a user, runs a user search filtered by email address, and deletes
the user only when the search confirms a matching record.
inputs:
type: object
required:
- email
properties:
email:
type: string
description: The email address to create and then search/delete the user by.
steps:
- stepId: createUser
description: >-
Add a new user to Stytch under the supplied email, returning the user_id.
operationId: api_user_v1_Create
requestBody:
contentType: application/json
payload:
email: $inputs.email
successCriteria:
- condition: $statusCode == 200
outputs:
userId: $response.body#/user_id
- stepId: searchUser
description: >-
Search the user store for an account whose email matches the supplied
address, confirming the record was created.
operationId: api_user_v1_Search
requestBody:
contentType: application/json
payload:
limit: 1
query:
operator: AND
operands:
- filter_name: email_address
filter_value:
- $inputs.email
successCriteria:
- condition: $statusCode == 200
outputs:
matchedUserId: $response.body#/results/0/user_id
onSuccess:
- name: userFound
type: goto
stepId: deleteUser
criteria:
- context: $response.body
condition: $.results[0]
type: jsonpath
- name: userMissing
type: end
- stepId: deleteUser
description: >-
Delete the matched user by user_id to clean up the account.
operationId: api_user_v1_Delete
parameters:
- name: user_id
in: path
value: $steps.searchUser.outputs.matchedUserId
successCriteria:
- condition: $statusCode == 200
outputs:
requestId: $response.body#/request_id
outputs:
createdUserId: $steps.createUser.outputs.userId
matchedUserId: $steps.searchUser.outputs.matchedUserId
deleteRequestId: $steps.deleteUser.outputs.requestId
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.