-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
531 lines (527 loc) · 19.5 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
openapi: 3.0.0
info:
title: 1Password Partnership API
description: >-
Trusted by more than 100,000 businesses to protect their data, 1Password
gives you complete control over passwords and other sensitive business
information.
As an integral layer of the Identity and Access Management (IAM) stack,
1Password protects all employee accounts – even those you aren't aware of.
Give employees secure access to any app or service and safely share
everything you need to work together – including logins, documents, credit
cards, and more – while keeping everything else private.
1Password is easy to deploy and integrates with Azure AD, Okta, OneLogin,
and Slack, so you can automatically provision employees using the systems
you already trust. It's simple to manage and fits seamlessly into your
team's workflow, so you can secure your business without compromising
productivity.
version: 2.0.0
contact:
name: 1Password Partnerships
url: https://www.1password.partners/English/
email: partners@1password.com
servers:
- url: https://billing.b5test.eu
- url: https://billing.1password.com
tags:
- name: Account
paths:
/api/v1/partners/accounts:
post:
tags:
- Account
operationId: Account_beginProvisioningProcess
description: >-
Begins provisioning process for a new partner associated 1Password
account.
requestBody:
description: Request to initialize a partner account.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePartnerAccountRequest'
examples:
Creating an Individual account on b5test.com:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: I
domain: b5test.com
Creating a Family account on b5test.eu:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: F
domain: b5test.eu
Creating an Individual account with a specified ends_at field:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: I
domain: b5test.com
ends_at: '2050-02-05T13:00:00.000Z'
Creating a Family account with a specified ends_at and timezone:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: F
domain: b5test.com
ends_at: '2050-02-05T18:00:00.000Z'
responses:
'201':
description: >-
An Account object is returned upon successful initialization of a
partner account.
headers:
location:
description: Location of the newly created resource.
schema:
type: string
example: /api/v1/partners/accounts/aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
examples:
Creating an Individual account without an ends_at date:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: I
activation_token: PNS-DEFG1234
domain: b5test.com
status: entitled
deployed_members: 0
created_at: '2023-01-23T15:55:58.000Z'
updated_at: '2023-01-23T15:55:58.000Z'
ends_at: null
Creating a Family account with an ends_at date:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: F
activation_token: PNS-DEFG1234
domain: b5test.com
status: entitled
deployed_members: 0
created_at: '2023-01-23T15:55:58.000Z'
updated_at: '2023-01-23T15:55:58.000Z'
ends_at: '2050-02-05T13:00:00.000Z'
Creating an Individual account with an ends_at date with specified time zone:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: I
activation_token: PNS-DEFG1234
domain: b5test.com
status: entitled
deployed_members: 0
created_at: '2023-01-23T15:55:58.000Z'
updated_at: '2023-01-23T15:55:58.000Z'
ends_at: '2050-02-05T18:00:00.000Z'
'400':
description: Returned on bad requests.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Account type B is not supported.
code: 400
error: bad_request
'403':
description: >-
Returned when the Authorization header is missing or an invalid
token is specified.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Invalid auth token.
code: 403
error: forbidden
'404':
description: Returned when a resource or dependency of a resource is not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Domain not found.
code: 404
error: not_found
'500':
description: Returned on unexpected errors.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Internal server error
code: 500
error: internal_server_error
/api/v1/partners/accounts/{customer_account_uid}:
get:
tags:
- Account
operationId: Account_getByUid
description: Returns an account based on an UID.
parameters:
- description: Unique ID of an account to retrieve.
name: customer_account_uid
in: path
required: true
schema:
type: string
responses:
'200':
description: >-
An Account object is returned upon successful retrieval of a partner
account.
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
examples:
Getting an account without a specified ends_at time:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: I
activation_token: PNS-DEFG1234
domain: b5test.com
status: provisioned
deployed_members: 1
created_at: '2023-01-23T15:55:58.000Z'
updated_at: '2023-01-23T15:58:22.000Z'
ends_at: null
Getting an account with a specified ends_at time:
value:
customer_account_uid: aabee51b-0b
account_type: I
activation_token: PNS-DEFG1234
domain: b5test.com
status: provisioned
deployed_members: 1
created_at: '2023-01-23T15:55:58.000Z'
updated_at: '2023-01-23T15:58:22.000Z'
ends_at: '2030-01-23T15:58:22.000Z'
'403':
description: >-
Returned when the Authorization header is missing or an invalid
token is specified.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Invalid auth token.
code: 403
error: forbidden
'404':
description: Returned when a resource or dependency of a resource is not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Failed to find the requested account.
code: 404
error: not_found
'410':
description: Returned when a resource has been removed.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: The requested account is gone.
code: 410
error: gone
'500':
description: Returned on unexpected errors.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Internal server error
code: 500
error: internal_server_error
delete:
tags:
- Account
operationId: Account_removeFromPartnership
description: Removes an account from the partnership domain.
parameters:
- description: Unique ID of partner_account to delete.
name: customer_account_uid
in: path
required: true
schema:
type: string
responses:
'204':
description: Returned upon successful deactivation of a partnership account.
'403':
description: >-
Returned when the Authorization header is missing or an invalid
token is specified.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Invalid auth token.
code: 403
error: forbidden
'404':
description: Returned when a resource or dependency of a resource is not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Failed to find the requested account.
code: 404
error: not_found
'500':
description: Returned on unexpected errors.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Internal server error
code: 500
error: internal_server_error
patch:
tags:
- Account
operationId: Account_updateEndsAtByUid
description: Updates the ends_at attribute of an account based on an UID.
parameters:
- description: Unique ID of partner_account to update.
name: customer_account_uid
in: path
required: true
schema:
type: string
requestBody:
description: Request to update the ends_at attribute of a partner account.
content:
application/json:
schema:
$ref: '#/components/schemas/UpdatePartnerAccountRequest'
examples:
Setting an ends_at time:
value:
ends_at: '2030-01-23T15:55:58.000Z'
Removing an ends_at time with empty string:
value:
ends_at: ''
Removing an ends_at time with NULL:
value:
ends_at: null
responses:
'200':
description: >-
An Account object is returned upon successful update of a partner
account.
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
examples:
Setting an ends_at time:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: I
activation_token: PNS-DEFG1234
domain: b5test.com
status: provisioned
deployed_members: 1
created_at: '2023-01-23T15:55:58.000Z'
updated_at: '2023-01-23T15:58:22.000Z'
ends_at: '2030-01-23T15:55:58.000Z'
Removing an ends_at time:
value:
customer_account_uid: aabee51b-0be2-4a0c-aa39-5bbcbb903d1b
account_type: I
activation_token: PNS-DEFG1234
domain: b5test.com
status: provisioned
deployed_members: 1
created_at: '2023-01-23T15:55:58.000Z'
updated_at: '2023-01-23T15:58:22.000Z'
ends_at: null
'400':
description: Returned upon validation failures
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
examples:
Invalid ends_at date format:
value:
description: >-
Invalid ends_at date format - it must adhere to RFC-3339,
e.g. 2006-01-02T15:04:05-07:00.
code: 400
error: bad_request
ends_at date in the past:
value:
description: Invalid ends_at date - it cannot be in the past.
code: 400
error: bad_request
Deactivated partner cannot be modified:
value:
description: Invalid account - partner account deleted.
code: 400
error: bad_request
'403':
description: >-
Returned when the Authorization header is missing or an invalid
token is specified.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Invalid auth token.
code: 403
error: forbidden
'404':
description: Returned when a resource or dependency of a resource is not found.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Failed to find the requested account.
code: 404
error: not_found
'500':
description: Returned on unexpected errors.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
example:
description: Internal server error
code: 500
error: internal_server_error
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
schemas:
CreatePartnerAccountRequest:
type: object
required:
- customer_account_uid
- account_type
- domain
properties:
customer_account_uid:
description: >-
A unique identifier for the end user's account to be provisioned. It
can be up to 80 chars long and consist of alphanumeric characters
and hyphens.
type: string
account_type:
description: >-
Specifies the type of 1Password account plan to provision - 'I' for
Individual, or 'F' for family.
type: string
domain:
description: >-
Specifies the 1Password domain to provision the account for. For
testing it can be one of 'b5test.com', 'b5test.ca', or 'b5test.eu'.
For production, it can be one of '1password.com', '1password.ca', or
'1password.eu'. Note that domains can only be used after promotions
have been created for a given partnership in the specific domain.
type: string
ends_at:
description: >-
Specifies when the 1Password account will be frozen, formatted in
RFC-3339.
type: string
format: date-time
UpdatePartnerAccountRequest:
type: object
required:
- ends_at
properties:
ends_at:
description: >-
Specifies when the 1Password account will be frozen, formatted in
RFC-3339.
type: string
format: date-time
Account:
type: object
properties:
customer_account_uid:
description: >-
The unique identifier for the end user's account. It can be up to 80
chars long and consist of alphanumeric characters and hyphens.
type: string
account_type:
description: >-
The current type of the 1Password account - 'I' for Individual, or
'F' for family.
type: string
activation_token:
description: >-
The activation token is a coupon code to link a new or existing
1Password account to a partnership promotion. For example, it can be
used for 1Password account creation at
https://start.{{1password_domain}}/partnership/redeem?t={{account_type}}&c={{activation_token}}
during end-user signup.
type: string
domain:
description: >-
The 1Password domain for which the account was provisioned for. For
testing domains, it can be one of 'b5test.com', 'b5test.ca', or
'b5test.eu'. For production, it can be one of '1password.com',
'1password.ca', or '1password.eu'.
type: string
status:
description: >-
The provisioning status of the partner account. It can be either
'entitled' for accounts that have been initialized but have not
completed 1Password signup, or 'provisioned' for accounts that have
completed the 1Password signup process.
type: string
deployed_members:
description: The number of provisioned users for the 1Password account.
type: integer
created_at:
description: >-
The timestamp of when the partnership account was created, formatted
in RFC-3339.
type: string
format: date-time
updated_at:
description: >-
The timestamp of when the partner account was last updated,
formatted in RFC-3339. This field will be updated during account
status changes.
type: string
format: date-time
ends_at:
description: >-
The timestamp of when the partner account will be frozen, formatted
in RFC-3339.
type: string
format: date-time
Error:
type: object
properties:
description:
description: A description of the error.
type: string
code:
description: The HTTP response code of the error.
type: integer
error:
description: A machine parsable string that represents the code.
type: string
security:
- bearerAuth: []