1 /**
2 * @oas [post] /auth/verification/request
3 * operationId: PostVerificationRequest
4 * summary: Create Verification
5 * description: Create a verification.
6 * x-authenticated: false
7 * requestBody:
8 * content:
9 * application/json:
10 * schema:
11 * type: object
12 * description: SUMMARY
13 * required:
14 * - entity_id
15 * - entity_type
16 * - code_provider
17 * properties:
18 * entity_id:
19 * type: string
20 * title: entity_id
21 * description: The verification's entity id.
22 * entity_type:
23 * type: string
24 * title: entity_type
25 * description: The verification's entity type.
26 * code_provider:
27 * type: string
28 * title: code_provider
29 * description: The verification's code provider.
30 * metadata:
31 * type: object
32 * description: The verification's metadata.
33 * x-codeSamples:
34 * - lang: Shell
35 * label: cURL
36 * source: |-
37 * curl -X POST '{backend_url}/auth/verification/request' \
38 * -H 'Content-Type: application/json' \
39 * --data-raw '{
40 * "entity_id": "{value}",
41 * "entity_type": "{value}",
42 * "code_provider": "{value}"
43 * }'
44 * tags:
45 * - Verification
46 * responses:
47 * "201":
48 * description: OK
49 * "400":
50 * $ref: "#/components/responses/400_error"
51 * "401":
52 * $ref: "#/components/responses/unauthorized"
53 * "404":
54 * $ref: "#/components/responses/not_found_error"
55 * "409":
56 * $ref: "#/components/responses/invalid_state_error"
57 * "422":
58 * $ref: "#/components/responses/invalid_request_error"
59 * "500":
60 * $ref: "#/components/responses/500_error"
61 * x-workflow: requestVerificationWorkflow
62 * x-events:
63 * - name: auth.verification_requested
64 * payload: |-
65 * ```ts
66 * {
67 * entity_id, // The identifier of the entity being verified. For example, an email address.
68 * entity_type, // The kind of entity being verified. For example, "email".
69 * code_provider, // The verification provider that generated the code. For example, "token".
70 * auth_identity_id, // The ID of the auth identity being verified.
71 * code, // The generated verification code.
72 * expires_at, // (Date) The code expiry date.
73 * metadata, // (object) Optional custom metadata passed from the request.
74 * }
75 * ```
76 * description: |-
77 * Emitted when a verification code is generated. You can listen to
78 * this event and decide how to deliver the code to the user or customer.
79 * The payload changed in v2.17.0:
80 * `actor_type` and `provider_identity_id` were removed,
81 * `provider` was renamed to `code_provider`, and `entity_type` was added.
82 * Subscribers written before v2.17.0 must be updated to use the payload below.
83 * deprecated: false
84 * since: 2.15.5
85 * x-since: 2.16.0
86 *
87 */
88