|
1
|
post: |
|
2
|
operationId: PostInvitesAccept |
|
3
|
summary: Accept Invite |
|
4
|
description: > |
|
5
|
Accept an invite and create a new user. |
|
6
|
|
|
7
|
Since the user isn't created yet, the JWT token used in the authorization |
|
8
|
header is retrieved from the `/auth/user/emailpass/register` API route (or a |
|
9
|
provider other than `emailpass`). The user can then authenticate using the |
|
10
|
`/auth/user/emailpass` API route. |
|
11
|
x-authenticated: true |
|
12
|
requestBody: |
|
13
|
content: |
|
14
|
application/json: |
|
15
|
schema: |
|
16
|
$ref: ../components/schemas/AdminGetInviteAcceptParams.yaml |
|
17
|
x-codeSamples: |
|
18
|
- lang: JavaScript |
|
19
|
label: JS SDK |
|
20
|
source: |
|
21
|
$ref: ../code_samples/JavaScript/admin_invites_accept/post.js |
|
22
|
- lang: Shell |
|
23
|
label: cURL |
|
24
|
source: |
|
25
|
$ref: ../code_samples/Shell/admin_invites_accept/post.sh |
|
26
|
tags: |
|
27
|
- Invites |
|
28
|
responses: |
|
29
|
'200': |
|
30
|
description: OK |
|
31
|
content: |
|
32
|
application/json: |
|
33
|
schema: |
|
34
|
oneOf: |
|
35
|
- type: object |
|
36
|
description: The created user's details. |
|
37
|
required: |
|
38
|
- user |
|
39
|
properties: |
|
40
|
user: |
|
41
|
$ref: ../components/schemas/AdminUser.yaml |
|
42
|
- type: object |
|
43
|
description: An error's details. |
|
44
|
required: |
|
45
|
- message |
|
46
|
properties: |
|
47
|
message: |
|
48
|
type: string |
|
49
|
title: message |
|
50
|
description: The error message. |
|
51
|
'400': |
|
52
|
$ref: ../components/responses/400_error.yaml |
|
53
|
'401': |
|
54
|
$ref: ../components/responses/unauthorized.yaml |
|
55
|
'404': |
|
56
|
$ref: ../components/responses/not_found_error.yaml |
|
57
|
'409': |
|
58
|
$ref: ../components/responses/invalid_state_error.yaml |
|
59
|
'422': |
|
60
|
$ref: ../components/responses/invalid_request_error.yaml |
|
61
|
'500': |
|
62
|
$ref: ../components/responses/500_error.yaml |
|
63
|
x-workflow: acceptInviteWorkflow |
|
64
|
security: |
|
65
|
- cookie_auth: [] |
|
66
|
- jwt_token: [] |
|
67
|
x-events: |
|
68
|
- name: user.created |
|
69
|
payload: |- |
|
70
|
```ts |
|
71
|
{ |
|
72
|
id, // The ID of the user |
|
73
|
} |
|
74
|
``` |
|
75
|
description: Emitted when users are created. |
|
76
|
deprecated: false |
|
77
|
- name: invite.accepted |
|
78
|
payload: |- |
|
79
|
```ts |
|
80
|
{ |
|
81
|
id, // The ID of the invite |
|
82
|
} |
|
83
|
``` |
|
84
|
description: Emitted when an invite is accepted. |
|
85
|
deprecated: false |
|
86
|
parameters: |
|
87
|
- name: token |
|
88
|
in: query |
|
89
|
description: The invite's token. |
|
90
|
required: true |
|
91
|
schema: |
|
92
|
type: string |
|
93
|
title: token |
|
94
|
description: The invite's token. |
|
95
|
- name: fields |
|
96
|
in: query |
|
97
|
description: >- |
|
98
|
Comma-separated fields that should be included in the returned data. If |
|
99
|
a field is prefixed with `+` it will be added to the default fields, |
|
100
|
using `-` will remove it from the default fields. Without prefix it will |
|
101
|
replace the entire default fields. |
|
102
|
required: false |
|
103
|
schema: |
|
104
|
type: string |
|
105
|
title: fields |
|
106
|
description: >- |
|
107
|
Comma-separated fields that should be included in the returned data. |
|
108
|
If a field is prefixed with `+` it will be added to the default |
|
109
|
fields, using `-` will remove it from the default fields. Without |
|
110
|
prefix it will replace the entire default fields. |
|
111
|
externalDocs: |
|
112
|
url: '#select-fields-and-relations' |