From 86cb2fbac203b93349525a324f0263d0dbf0b901 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 7 Mar 2019 13:57:07 -0500 Subject: [PATCH] update spec and some styling --- api/css/bitwarden.css | 12 + api/specs/public/swagger.json | 2257 +++++++++++++++++---------------- 2 files changed, 1144 insertions(+), 1125 deletions(-) diff --git a/api/css/bitwarden.css b/api/css/bitwarden.css index e639adf..700b3fb 100644 --- a/api/css/bitwarden.css +++ b/api/css/bitwarden.css @@ -2,6 +2,7 @@ html { box-sizing: border-box; overflow: -moz-scrollbars-vertical; overflow-y: scroll; + font-size: 14px; } *, @@ -26,3 +27,14 @@ body { .swagger-ui .topbar .topbar-wrapper .download-url-wrapper select { border: none; } + +.swagger-ui .model, +.swagger-ui .model-title__text, +.swagger-ui .model-title, +.swagger-ui .opblock-description-wrapper, +.swagger-ui .opblock-external-docs-wrapper, +.swagger-ui .opblock-title_normal, +.swagger-ui table thead tr td, +.swagger-ui table thead tr th { + font-size: 14px; +} diff --git a/api/specs/public/swagger.json b/api/specs/public/swagger.json index a744d5c..2406267 100644 --- a/api/specs/public/swagger.json +++ b/api/specs/public/swagger.json @@ -1,1205 +1,1212 @@ { - "swagger": "2.0", - "info": { - "version": "latest", - "title": "Bitwarden Public API" - }, - "paths": { - "/public/collections/{id}": { - "get": { - "tags": [ - "Collections" - ], - "summary": "Retrieve a collection.", - "description": "Retrieves the details of an existing collection. You need only supply the unique collection identifier\r\nthat was returned upon collection creation.", - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the collection to be retrieved.", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CollectionResponseModel" - } - }, - "404": { - "description": "Not Found" - } - } - }, - "put": { - "tags": [ - "Collections" - ], - "summary": "Update a collection.", - "description": "Updates the specified collection object. If a property is not provided,\r\nthe value of the existing property will be reset.", - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the collection to be updated.", - "required": true, - "type": "string", - "format": "uuid" - }, - { - "name": "model", - "in": "body", - "description": "The request model.", - "required": false, - "schema": { - "$ref": "#/definitions/CollectionUpdateRequestModel" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/CollectionResponseModel" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - }, - "404": { - "description": "Not Found" - } - } - }, - "delete": { - "tags": [ - "Collections" - ], - "summary": "Delete a collection.", - "description": "Permanently deletes a collection. This cannot be undone.", - "operationId": "Delete", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the collection to be deleted.", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "responses": { - "200": { - "description": "Success" - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/public/collections": { - "get": { - "tags": [ - "Collections" - ], - "summary": "List all collections.", - "description": "Returns a list of your organization's collections.\r\nCollection objects listed in this call do not include information about their associated groups.", - "operationId": "List", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ListResponseModel[CollectionResponseModel]" - } - } - } - } - }, - "/public/events": { - "get": { - "tags": [ - "Events" - ], - "summary": "List all events.", - "description": "Returns a filtered list of your organization's event logs, paged by a continuation token.\r\nIf no filters are provided, it will return the last 30 days of event for the organization.", - "operationId": "List", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "start", - "in": "query", - "description": "The start date. Must be less than the end date.", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "end", - "in": "query", - "description": "The end date. Must be greater than the start date.", - "required": false, - "type": "string", - "format": "date-time" - }, - { - "name": "actingUserId", - "in": "query", - "description": "The unique identifier of the user that performed the event.", - "required": false, - "type": "string", - "format": "uuid" - }, - { - "name": "itemId", - "in": "query", - "description": "The unique identifier of the related item that the event describes.", - "required": false, - "type": "string", - "format": "uuid" - }, - { - "name": "continuationToken", - "in": "query", - "description": "A cursor for use in pagination.", - "required": false, - "type": "string" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ListResponseModel[EventResponseModel]" - } - } - } - } - }, - "/public/groups/{id}": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Retrieve a group.", - "description": "Retrieves the details of an existing group. You need only supply the unique group identifier\r\nthat was returned upon group creation.", - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the group to be retrieved.", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/GroupResponseModel" - } - }, - "404": { - "description": "Not Found" - } - } - }, - "put": { - "tags": [ - "Groups" - ], - "summary": "Update a group.", - "description": "Updates the specified group object. If a property is not provided,\r\nthe value of the existing property will be reset.", - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the group to be updated.", - "required": true, - "type": "string", - "format": "uuid" - }, - { - "name": "model", - "in": "body", - "description": "The request model.", - "required": false, - "schema": { - "$ref": "#/definitions/GroupCreateUpdateRequestModel" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/GroupResponseModel" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - }, - "404": { - "description": "Not Found" - } - } - }, - "delete": { - "tags": [ - "Groups" - ], - "summary": "Delete a group.", - "description": "Permanently deletes a group. This cannot be undone.", - "operationId": "Delete", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the group to be deleted.", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "responses": { - "200": { - "description": "Success" - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/public/groups": { - "get": { - "tags": [ - "Groups" - ], - "summary": "List all groups.", - "description": "Returns a list of your organization's groups.\r\nGroup objects listed in this call do not include information about their associated collections.", - "operationId": "List", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ListResponseModel[GroupResponseModel]" - } - } - } - }, - "post": { - "tags": [ - "Groups" - ], - "summary": "Create a group.", - "description": "Creates a new group object.", - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "model", - "in": "body", - "description": "The request model.", - "required": false, - "schema": { - "$ref": "#/definitions/GroupCreateUpdateRequestModel" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/GroupResponseModel" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - } - } - } - }, - "/public/members/{id}": { - "get": { - "tags": [ - "Members" - ], - "summary": "Retrieve a member.", - "description": "Retrieves the details of an existing member of the organization. You need only supply the\r\nunique member identifier that was returned upon member creation.", - "operationId": "Get", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the member to be retrieved.", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/MemberResponseModel" - } - }, - "404": { - "description": "Not Found" - } - } - }, - "put": { - "tags": [ - "Members" - ], - "summary": "Update a member.", - "description": "Updates the specified member object. If a property is not provided,\r\nthe value of the existing property will be reset.", - "operationId": "Put", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the member to be updated.", - "required": true, - "type": "string", - "format": "uuid" - }, - { - "name": "model", - "in": "body", - "description": "The request model.", - "required": false, - "schema": { - "$ref": "#/definitions/MemberUpdateRequestModel" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/MemberResponseModel" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - }, - "404": { - "description": "Not Found" - } - } - }, - "delete": { - "tags": [ - "Members" - ], - "summary": "Delete a member.", - "description": "Permanently deletes a member from the organization. This cannot be undone.\r\nThe user account will still remain. The user is only removed from the organization.", - "operationId": "Delete", - "consumes": [], - "produces": [], - "parameters": [ - { - "name": "id", - "in": "path", - "description": "The identifier of the member to be deleted.", - "required": true, - "type": "string", - "format": "uuid" - } - ], - "responses": { - "200": { - "description": "Success" - }, - "404": { - "description": "Not Found" - } - } - } - }, - "/public/members": { - "get": { - "tags": [ - "Members" - ], - "summary": "List all members.", - "description": "Returns a list of your organization's members.\r\nMember objects listed in this call do not include information about their associated collections.", - "operationId": "List", - "consumes": [], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/ListResponseModel[MemberResponseModel]" - } - } - } - }, - "post": { - "tags": [ - "Members" - ], - "summary": "Create a member.", - "description": "Creates a new member object by inviting a user to the organization.", - "operationId": "Post", - "consumes": [ - "application/json-patch+json", - "application/json", - "text/json", - "application/*+json" - ], - "produces": [ - "text/plain", - "application/json", - "text/json" - ], - "parameters": [ - { - "name": "model", - "in": "body", - "description": "The request model.", - "required": false, - "schema": { - "$ref": "#/definitions/MemberCreateRequestModel" - } - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/MemberResponseModel" - } - }, - "400": { - "description": "Bad Request", - "schema": { - "$ref": "#/definitions/ErrorResponseModel" - } - } - } - } - } - }, - "definitions": { - "CollectionResponseModel": { - "description": "A collection.", - "required": [ - "Object", - "Id" + "swagger": "2.0", + "info": { + "version": "latest", + "title": "Bitwarden Public API", + "description": "The Bitwarden public APIs.", + "contact": { + "name": "Bitwarden Support", + "url": "https://bitwarden.com", + "email": "support@bitwarden.com" + } + }, + "host": "api.bitwarden.com", + "paths": { + "/public/collections/{id}": { + "get": { + "tags": [ + "Collections" ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", - "type": "string", - "readOnly": true, - "example": "collection" - }, - "Id": { - "format": "uuid", - "description": "The collection's unique identifier.", - "type": "string", - "example": "539a36c5-e0d2-4cf9-979e-51ecf5cf6593" - }, - "Groups": { - "description": "The associated groups that this collection is assigned to.", - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssociationWithPermissionsResponseModel" - } - } - } - }, - "AssociationWithPermissionsResponseModel": { - "required": [ - "Id", - "ReadOnly" + "summary": "Retrieve a collection.", + "description": "Retrieves the details of an existing collection. You need only supply the unique collection identifier\r\nthat was returned upon collection creation.", + "operationId": "Get", + "consumes": [], + "produces": [ + "text/plain", + "application/json", + "text/json" ], - "type": "object", - "properties": { - "Id": { - "format": "uuid", - "description": "The associated object's unique identifier.", + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the collection to be retrieved.", + "required": true, "type": "string", - "example": "bfbc8338-e329-4dc0-b0c9-317c2ebf1a09" - }, - "ReadOnly": { - "description": "When true, the read only permission will not allow the user or group to make changes to items.", - "type": "boolean" + "format": "uuid" } - } - }, - "CollectionUpdateRequestModel": { - "type": "object", - "properties": { - "Groups": { - "description": "The associated groups that this collection is assigned to.", - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssociationWithPermissionsRequestModel" - } - } - } - }, - "AssociationWithPermissionsRequestModel": { - "required": [ - "Id", - "ReadOnly" ], - "type": "object", - "properties": { - "Id": { - "format": "uuid", - "description": "The associated object's unique identifier.", - "type": "string", - "example": "bfbc8338-e329-4dc0-b0c9-317c2ebf1a09" - }, - "ReadOnly": { - "description": "When true, the read only permission will not allow the user or group to make changes to items.", - "type": "boolean" - } - } - }, - "ErrorResponseModel": { - "required": [ - "Object", - "Message" - ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", - "type": "string", - "readOnly": true, - "example": "error" - }, - "Message": { - "description": "A human-readable message providing details about the error.", - "type": "string", - "example": "The request model is invalid." - }, - "Errors": { - "description": "If multiple errors occurred, they are listed in dictionary. Errors related to a specific\r\nrequest parameter will include a dictionary key describing that parameter.", - "type": "object", - "additionalProperties": { - "uniqueItems": false, - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "ListResponseModel[CollectionResponseModel]": { - "required": [ - "Object", - "Data" - ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", - "type": "string", - "readOnly": true, - "example": "list" - }, - "Data": { - "description": "An array containing the actual response elements, paginated by any request parameters.", - "uniqueItems": false, - "type": "array", - "items": { + "responses": { + "200": { + "description": "Success", + "schema": { "$ref": "#/definitions/CollectionResponseModel" } }, - "ContinuationToken": { - "description": "A cursor for use in pagination.", - "type": "string" + "404": { + "description": "Not Found" } } }, - "ListResponseModel[EventResponseModel]": { - "required": [ - "Object", - "Data" + "put": { + "tags": [ + "Collections" ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", + "summary": "Update a collection.", + "description": "Updates the specified collection object. If a property is not provided,\r\nthe value of the existing property will be reset.", + "operationId": "Put", + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the collection to be updated.", + "required": true, "type": "string", - "readOnly": true, - "example": "list" + "format": "uuid" }, - "Data": { - "description": "An array containing the actual response elements, paginated by any request parameters.", - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/EventResponseModel" + { + "name": "model", + "in": "body", + "description": "The request model.", + "required": false, + "schema": { + "$ref": "#/definitions/CollectionUpdateRequestModel" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CollectionResponseModel" } }, - "ContinuationToken": { - "description": "A cursor for use in pagination.", - "type": "string" + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + }, + "404": { + "description": "Not Found" } } }, - "EventResponseModel": { - "description": "An event log.", - "required": [ - "Object", - "Type", - "Date" + "delete": { + "tags": [ + "Collections" ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", + "summary": "Delete a collection.", + "description": "Permanently deletes a collection. This cannot be undone.", + "operationId": "Delete", + "consumes": [], + "produces": [], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the collection to be deleted.", + "required": true, "type": "string", - "readOnly": true, - "example": "event" + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Success" }, - "Type": { - "format": "int32", - "description": "The type of event.", - "enum": [ - 1000, - 1001, - 1002, - 1003, - 1004, - 1005, - 1006, - 1100, - 1101, - 1102, - 1103, - 1104, - 1105, - 1106, - 1300, - 1301, - 1302, - 1400, - 1401, - 1402, - 1500, - 1501, - 1502, - 1503, - 1504, - 1600, - 1601 - ], - "type": "integer" - }, - "ItemId": { - "format": "uuid", - "description": "The unique identifier of the related item that the event describes.", + "404": { + "description": "Not Found" + } + } + } + }, + "/public/collections": { + "get": { + "tags": [ + "Collections" + ], + "summary": "List all collections.", + "description": "Returns a list of your organization's collections.\r\nCollection objects listed in this call do not include information about their associated groups.", + "operationId": "List", + "consumes": [], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ListResponseModel[CollectionResponseModel]" + } + } + } + } + }, + "/public/events": { + "get": { + "tags": [ + "Events" + ], + "summary": "List all events.", + "description": "Returns a filtered list of your organization's event logs, paged by a continuation token.\r\nIf no filters are provided, it will return the last 30 days of event for the organization.", + "operationId": "List", + "consumes": [], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "start", + "in": "query", + "description": "The start date. Must be less than the end date.", + "required": false, "type": "string", - "example": "3767a302-8208-4dc6-b842-030428a1cfad" + "format": "date-time" }, - "CollectionId": { - "format": "uuid", - "description": "The unique identifier of the related collection that the event describes.", + { + "name": "end", + "in": "query", + "description": "The end date. Must be greater than the start date.", + "required": false, "type": "string", - "example": "bce212a4-25f3-4888-8a0a-4c5736d851e0" + "format": "date-time" }, - "GroupId": { - "format": "uuid", - "description": "The unique identifier of the related group that the event describes.", - "type": "string", - "example": "f29a2515-91d2-4452-b49b-5e8040e6b0f4" - }, - "MemberId": { - "format": "uuid", - "description": "The unique identifier of the related member that the event describes.", - "type": "string", - "example": "e68b8629-85eb-4929-92c0-b84464976ba4" - }, - "ActingUserId": { - "format": "uuid", + { + "name": "actingUserId", + "in": "query", "description": "The unique identifier of the user that performed the event.", + "required": false, "type": "string", - "example": "a2549f79-a71f-4eb9-9234-eb7247333f94" + "format": "uuid" }, - "Date": { - "format": "date-time", - "description": "The date/timestamp when the event occurred.", + { + "name": "itemId", + "in": "query", + "description": "The unique identifier of the related item that the event describes.", + "required": false, + "type": "string", + "format": "uuid" + }, + { + "name": "continuationToken", + "in": "query", + "description": "A cursor for use in pagination.", + "required": false, "type": "string" - }, - "Device": { - "format": "int32", - "description": "The type of device used by the acting user when the event occurred.", - "enum": [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20 - ], - "type": "integer" - }, - "IpAddress": { - "description": "The IP address of the acting user.", - "type": "string", - "example": "172.16.254.1" } - } - }, - "GroupResponseModel": { - "description": "A user group.", - "required": [ - "Object", - "Id", - "Name", - "AccessAll" ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", - "type": "string", - "readOnly": true, - "example": "group" - }, - "Id": { - "format": "uuid", - "description": "The group's unique identifier.", - "type": "string", - "example": "539a36c5-e0d2-4cf9-979e-51ecf5cf6593" - }, - "Collections": { - "description": "The associated collections that this group can access.", - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssociationWithPermissionsResponseModel" + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ListResponseModel[EventResponseModel]" } - }, - "Name": { - "description": "The name of the group.", - "maxLength": 100, - "minLength": 0, - "type": "string", - "example": "Development Team" - }, - "AccessAll": { - "description": "Determines if this group can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", - "type": "boolean" - }, - "ExternalId": { - "description": "External identifier linking this group to another system, such as a user directory.", - "maxLength": 300, - "minLength": 0, - "type": "string", - "example": "external_id_123456" } } - }, - "GroupCreateUpdateRequestModel": { - "required": [ - "Name", - "AccessAll" + } + }, + "/public/groups/{id}": { + "get": { + "tags": [ + "Groups" ], - "type": "object", - "properties": { - "Collections": { - "description": "The associated collections that this group can access.", - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssociationWithPermissionsRequestModel" - } - }, - "Name": { - "description": "The name of the group.", - "maxLength": 100, - "minLength": 0, + "summary": "Retrieve a group.", + "description": "Retrieves the details of an existing group. You need only supply the unique group identifier\r\nthat was returned upon group creation.", + "operationId": "Get", + "consumes": [], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the group to be retrieved.", + "required": true, "type": "string", - "example": "Development Team" - }, - "AccessAll": { - "description": "Determines if this group can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", - "type": "boolean" - }, - "ExternalId": { - "description": "External identifier linking this group to another system, such as a user directory.", - "maxLength": 300, - "minLength": 0, - "type": "string", - "example": "external_id_123456" + "format": "uuid" } - } - }, - "ListResponseModel[GroupResponseModel]": { - "required": [ - "Object", - "Data" ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", - "type": "string", - "readOnly": true, - "example": "list" - }, - "Data": { - "description": "An array containing the actual response elements, paginated by any request parameters.", - "uniqueItems": false, - "type": "array", - "items": { + "responses": { + "200": { + "description": "Success", + "schema": { "$ref": "#/definitions/GroupResponseModel" } }, - "ContinuationToken": { - "description": "A cursor for use in pagination.", - "type": "string" + "404": { + "description": "Not Found" } } }, - "MemberResponseModel": { - "description": "An organization member.", - "required": [ - "Object", - "Id", - "Email", - "TwoFactorEnabled", - "Status", - "Type", - "AccessAll" + "put": { + "tags": [ + "Groups" ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", + "summary": "Update a group.", + "description": "Updates the specified group object. If a property is not provided,\r\nthe value of the existing property will be reset.", + "operationId": "Put", + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the group to be updated.", + "required": true, "type": "string", - "readOnly": true, - "example": "member" + "format": "uuid" }, - "Id": { - "format": "uuid", - "description": "The member's unique identifier.", - "type": "string", - "example": "539a36c5-e0d2-4cf9-979e-51ecf5cf6593" - }, - "Name": { - "description": "The member's name, set from their user account profile.", - "type": "string", - "example": "John Smith" - }, - "Email": { - "description": "The member's email address.", - "type": "string", - "example": "jsmith@company.com" - }, - "TwoFactorEnabled": { - "description": "Returns {true} if the member has a two-step login method enabled on their user account.", - "type": "boolean" - }, - "Status": { - "format": "int32", - "description": "The member's status within the organization. All created members start with a status of \"Invited\".\r\nOnce a member accept's their invitation to join the organization, their status changes to \"Accepted\".\r\nAccepted members are then \"Confirmed\" by an organization administrator. Once a member is \"Confirmed\",\r\ntheir status can no longer change.", - "enum": [ - 0, - 1, - 2 - ], - "type": "integer" - }, - "Collections": { - "description": "The associated collections that this member can access.", - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssociationWithPermissionsResponseModel" + { + "name": "model", + "in": "body", + "description": "The request model.", + "required": false, + "schema": { + "$ref": "#/definitions/GroupCreateUpdateRequestModel" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/GroupResponseModel" } }, - "Type": { - "format": "int32", - "description": "The member's type (or role) within the organization.", - "enum": [ - 0, - 1, - 2, - 3 - ], - "type": "integer" - }, - "AccessAll": { - "description": "Determines if this member can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", - "type": "boolean" - }, - "ExternalId": { - "description": "External identifier linking this member to another system, such as a user directory.", - "maxLength": 300, - "minLength": 0, - "type": "string", - "example": "external_id_123456" - } - } - }, - "MemberUpdateRequestModel": { - "required": [ - "Type", - "AccessAll" - ], - "type": "object", - "properties": { - "Collections": { - "description": "The associated collections that this member can access.", - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssociationWithPermissionsRequestModel" + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" } }, - "Type": { - "format": "int32", - "description": "The member's type (or role) within the organization.", - "enum": [ - 0, - 1, - 2, - 3 - ], - "type": "integer" - }, - "AccessAll": { - "description": "Determines if this member can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", - "type": "boolean" - }, - "ExternalId": { - "description": "External identifier linking this member to another system, such as a user directory.", - "maxLength": 300, - "minLength": 0, - "type": "string", - "example": "external_id_123456" + "404": { + "description": "Not Found" } } }, - "ListResponseModel[MemberResponseModel]": { - "required": [ - "Object", - "Data" + "delete": { + "tags": [ + "Groups" ], - "type": "object", - "properties": { - "Object": { - "description": "String representing the object's type. Objects of the same type share the same properties.", + "summary": "Delete a group.", + "description": "Permanently deletes a group. This cannot be undone.", + "operationId": "Delete", + "consumes": [], + "produces": [], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the group to be deleted.", + "required": true, "type": "string", - "readOnly": true, - "example": "list" + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Success" }, - "Data": { - "description": "An array containing the actual response elements, paginated by any request parameters.", - "uniqueItems": false, - "type": "array", - "items": { + "404": { + "description": "Not Found" + } + } + } + }, + "/public/groups": { + "get": { + "tags": [ + "Groups" + ], + "summary": "List all groups.", + "description": "Returns a list of your organization's groups.\r\nGroup objects listed in this call do not include information about their associated collections.", + "operationId": "List", + "consumes": [], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ListResponseModel[GroupResponseModel]" + } + } + } + }, + "post": { + "tags": [ + "Groups" + ], + "summary": "Create a group.", + "description": "Creates a new group object.", + "operationId": "Post", + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "model", + "in": "body", + "description": "The request model.", + "required": false, + "schema": { + "$ref": "#/definitions/GroupCreateUpdateRequestModel" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/GroupResponseModel" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + } + } + } + }, + "/public/members/{id}": { + "get": { + "tags": [ + "Members" + ], + "summary": "Retrieve a member.", + "description": "Retrieves the details of an existing member of the organization. You need only supply the\r\nunique member identifier that was returned upon member creation.", + "operationId": "Get", + "consumes": [], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the member to be retrieved.", + "required": true, + "type": "string", + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { "$ref": "#/definitions/MemberResponseModel" } }, - "ContinuationToken": { - "description": "A cursor for use in pagination.", - "type": "string" + "404": { + "description": "Not Found" } } }, - "MemberCreateRequestModel": { - "required": [ - "Email", - "Type", - "AccessAll" + "put": { + "tags": [ + "Members" ], - "type": "object", - "properties": { - "Email": { - "description": "The member's email address.", + "summary": "Update a member.", + "description": "Updates the specified member object. If a property is not provided,\r\nthe value of the existing property will be reset.", + "operationId": "Put", + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the member to be updated.", + "required": true, "type": "string", - "example": "jsmith@company.com" + "format": "uuid" }, - "Collections": { - "description": "The associated collections that this member can access.", - "uniqueItems": false, - "type": "array", - "items": { - "$ref": "#/definitions/AssociationWithPermissionsRequestModel" + { + "name": "model", + "in": "body", + "description": "The request model.", + "required": false, + "schema": { + "$ref": "#/definitions/MemberUpdateRequestModel" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/MemberResponseModel" } }, - "Type": { - "format": "int32", - "description": "The member's type (or role) within the organization.", - "enum": [ - 0, - 1, - 2, - 3 - ], - "type": "integer" + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } }, - "AccessAll": { - "description": "Determines if this member can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", - "type": "boolean" - }, - "ExternalId": { - "description": "External identifier linking this member to another system, such as a user directory.", - "maxLength": 300, - "minLength": 0, + "404": { + "description": "Not Found" + } + } + }, + "delete": { + "tags": [ + "Members" + ], + "summary": "Delete a member.", + "description": "Permanently deletes a member from the organization. This cannot be undone.\r\nThe user account will still remain. The user is only removed from the organization.", + "operationId": "Delete", + "consumes": [], + "produces": [], + "parameters": [ + { + "name": "id", + "in": "path", + "description": "The identifier of the member to be deleted.", + "required": true, "type": "string", - "example": "external_id_123456" + "format": "uuid" + } + ], + "responses": { + "200": { + "description": "Success" + }, + "404": { + "description": "Not Found" } } } }, - "securityDefinitions": { - "OAuth2 Client Credentials": { - "flow": "application", - "tokenUrl": "https://identity.bitwarden.com/connect/token", - "scopes": { - "api.organization": "Organization APIs" + "/public/members": { + "get": { + "tags": [ + "Members" + ], + "summary": "List all members.", + "description": "Returns a list of your organization's members.\r\nMember objects listed in this call do not include information about their associated collections.", + "operationId": "List", + "consumes": [], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/ListResponseModel[MemberResponseModel]" + } + } + } + }, + "post": { + "tags": [ + "Members" + ], + "summary": "Create a member.", + "description": "Creates a new member object by inviting a user to the organization.", + "operationId": "Post", + "consumes": [ + "application/json-patch+json", + "application/json", + "text/json", + "application/*+json" + ], + "produces": [ + "text/plain", + "application/json", + "text/json" + ], + "parameters": [ + { + "name": "model", + "in": "body", + "description": "The request model.", + "required": false, + "schema": { + "$ref": "#/definitions/MemberCreateRequestModel" + } + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/MemberResponseModel" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/ErrorResponseModel" + } + } + } + } + } + }, + "definitions": { + "CollectionResponseModel": { + "description": "A collection.", + "required": [ + "object", + "id" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "collection" }, - "type": "oauth2" + "id": { + "format": "uuid", + "description": "The collection's unique identifier.", + "type": "string", + "example": "539a36c5-e0d2-4cf9-979e-51ecf5cf6593" + }, + "groups": { + "description": "The associated groups that this collection is assigned to.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/AssociationWithPermissionsResponseModel" + } + } } }, - "security": [ - { - "OAuth2 Client Credentials": [ - "api.organization" - ] + "AssociationWithPermissionsResponseModel": { + "required": [ + "id", + "readOnly" + ], + "type": "object", + "properties": { + "id": { + "format": "uuid", + "description": "The associated object's unique identifier.", + "type": "string", + "example": "bfbc8338-e329-4dc0-b0c9-317c2ebf1a09" + }, + "readOnly": { + "description": "When true, the read only permission will not allow the user or group to make changes to items.", + "type": "boolean" + } } - ] - } \ No newline at end of file + }, + "CollectionUpdateRequestModel": { + "type": "object", + "properties": { + "groups": { + "description": "The associated groups that this collection is assigned to.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/AssociationWithPermissionsRequestModel" + } + } + } + }, + "AssociationWithPermissionsRequestModel": { + "required": [ + "id", + "readOnly" + ], + "type": "object", + "properties": { + "id": { + "format": "uuid", + "description": "The associated object's unique identifier.", + "type": "string", + "example": "bfbc8338-e329-4dc0-b0c9-317c2ebf1a09" + }, + "readOnly": { + "description": "When true, the read only permission will not allow the user or group to make changes to items.", + "type": "boolean" + } + } + }, + "ErrorResponseModel": { + "required": [ + "object", + "message" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "error" + }, + "message": { + "description": "A human-readable message providing details about the error.", + "type": "string", + "example": "The request model is invalid." + }, + "errors": { + "description": "If multiple errors occurred, they are listed in dictionary. Errors related to a specific\r\nrequest parameter will include a dictionary key describing that parameter.", + "type": "object", + "additionalProperties": { + "uniqueItems": false, + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "ListResponseModel[CollectionResponseModel]": { + "required": [ + "object", + "data" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "list" + }, + "data": { + "description": "An array containing the actual response elements, paginated by any request parameters.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/CollectionResponseModel" + } + }, + "continuationToken": { + "description": "A cursor for use in pagination.", + "type": "string" + } + } + }, + "ListResponseModel[EventResponseModel]": { + "required": [ + "object", + "data" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "list" + }, + "data": { + "description": "An array containing the actual response elements, paginated by any request parameters.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/EventResponseModel" + } + }, + "continuationToken": { + "description": "A cursor for use in pagination.", + "type": "string" + } + } + }, + "EventResponseModel": { + "description": "An event log.", + "required": [ + "object", + "type", + "date" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "event" + }, + "type": { + "format": "int32", + "description": "The type of event.", + "enum": [ + 1000, + 1001, + 1002, + 1003, + 1004, + 1005, + 1006, + 1100, + 1101, + 1102, + 1103, + 1104, + 1105, + 1106, + 1300, + 1301, + 1302, + 1400, + 1401, + 1402, + 1500, + 1501, + 1502, + 1503, + 1504, + 1600, + 1601 + ], + "type": "integer" + }, + "itemId": { + "format": "uuid", + "description": "The unique identifier of the related item that the event describes.", + "type": "string", + "example": "3767a302-8208-4dc6-b842-030428a1cfad" + }, + "collectionId": { + "format": "uuid", + "description": "The unique identifier of the related collection that the event describes.", + "type": "string", + "example": "bce212a4-25f3-4888-8a0a-4c5736d851e0" + }, + "groupId": { + "format": "uuid", + "description": "The unique identifier of the related group that the event describes.", + "type": "string", + "example": "f29a2515-91d2-4452-b49b-5e8040e6b0f4" + }, + "memberId": { + "format": "uuid", + "description": "The unique identifier of the related member that the event describes.", + "type": "string", + "example": "e68b8629-85eb-4929-92c0-b84464976ba4" + }, + "actingUserId": { + "format": "uuid", + "description": "The unique identifier of the user that performed the event.", + "type": "string", + "example": "a2549f79-a71f-4eb9-9234-eb7247333f94" + }, + "date": { + "format": "date-time", + "description": "The date/timestamp when the event occurred.", + "type": "string" + }, + "device": { + "format": "int32", + "description": "The type of device used by the acting user when the event occurred.", + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ], + "type": "integer" + }, + "ipAddress": { + "description": "The IP address of the acting user.", + "type": "string", + "example": "172.16.254.1" + } + } + }, + "GroupResponseModel": { + "description": "A user group.", + "required": [ + "object", + "id", + "name", + "accessAll" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "group" + }, + "id": { + "format": "uuid", + "description": "The group's unique identifier.", + "type": "string", + "example": "539a36c5-e0d2-4cf9-979e-51ecf5cf6593" + }, + "collections": { + "description": "The associated collections that this group can access.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/AssociationWithPermissionsResponseModel" + } + }, + "name": { + "description": "The name of the group.", + "maxLength": 100, + "minLength": 0, + "type": "string", + "example": "Development Team" + }, + "accessAll": { + "description": "Determines if this group can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", + "type": "boolean" + }, + "externalId": { + "description": "External identifier linking this group to another system, such as a user directory.", + "maxLength": 300, + "minLength": 0, + "type": "string", + "example": "external_id_123456" + } + } + }, + "GroupCreateUpdateRequestModel": { + "required": [ + "name", + "accessAll" + ], + "type": "object", + "properties": { + "collections": { + "description": "The associated collections that this group can access.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/AssociationWithPermissionsRequestModel" + } + }, + "name": { + "description": "The name of the group.", + "maxLength": 100, + "minLength": 0, + "type": "string", + "example": "Development Team" + }, + "accessAll": { + "description": "Determines if this group can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", + "type": "boolean" + }, + "externalId": { + "description": "External identifier linking this group to another system, such as a user directory.", + "maxLength": 300, + "minLength": 0, + "type": "string", + "example": "external_id_123456" + } + } + }, + "ListResponseModel[GroupResponseModel]": { + "required": [ + "object", + "data" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "list" + }, + "data": { + "description": "An array containing the actual response elements, paginated by any request parameters.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/GroupResponseModel" + } + }, + "continuationToken": { + "description": "A cursor for use in pagination.", + "type": "string" + } + } + }, + "MemberResponseModel": { + "description": "An organization member.", + "required": [ + "object", + "id", + "email", + "twoFactorEnabled", + "status", + "type", + "accessAll" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "member" + }, + "id": { + "format": "uuid", + "description": "The member's unique identifier.", + "type": "string", + "example": "539a36c5-e0d2-4cf9-979e-51ecf5cf6593" + }, + "name": { + "description": "The member's name, set from their user account profile.", + "type": "string", + "example": "John Smith" + }, + "email": { + "description": "The member's email address.", + "type": "string", + "example": "jsmith@company.com" + }, + "twoFactorEnabled": { + "description": "Returns {true} if the member has a two-step login method enabled on their user account.", + "type": "boolean" + }, + "status": { + "format": "int32", + "description": "The member's status within the organization. All created members start with a status of \"Invited\".\r\nOnce a member accept's their invitation to join the organization, their status changes to \"Accepted\".\r\nAccepted members are then \"Confirmed\" by an organization administrator. Once a member is \"Confirmed\",\r\ntheir status can no longer change.", + "enum": [ + 0, + 1, + 2 + ], + "type": "integer" + }, + "collections": { + "description": "The associated collections that this member can access.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/AssociationWithPermissionsResponseModel" + } + }, + "type": { + "format": "int32", + "description": "The member's type (or role) within the organization.", + "enum": [ + 0, + 1, + 2, + 3 + ], + "type": "integer" + }, + "accessAll": { + "description": "Determines if this member can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", + "type": "boolean" + }, + "externalId": { + "description": "External identifier linking this member to another system, such as a user directory.", + "maxLength": 300, + "minLength": 0, + "type": "string", + "example": "external_id_123456" + } + } + }, + "MemberUpdateRequestModel": { + "required": [ + "type", + "accessAll" + ], + "type": "object", + "properties": { + "collections": { + "description": "The associated collections that this member can access.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/AssociationWithPermissionsRequestModel" + } + }, + "type": { + "format": "int32", + "description": "The member's type (or role) within the organization.", + "enum": [ + 0, + 1, + 2, + 3 + ], + "type": "integer" + }, + "accessAll": { + "description": "Determines if this member can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", + "type": "boolean" + }, + "externalId": { + "description": "External identifier linking this member to another system, such as a user directory.", + "maxLength": 300, + "minLength": 0, + "type": "string", + "example": "external_id_123456" + } + } + }, + "ListResponseModel[MemberResponseModel]": { + "required": [ + "object", + "data" + ], + "type": "object", + "properties": { + "object": { + "description": "String representing the object's type. Objects of the same type share the same properties.", + "type": "string", + "readOnly": true, + "example": "list" + }, + "data": { + "description": "An array containing the actual response elements, paginated by any request parameters.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/MemberResponseModel" + } + }, + "continuationToken": { + "description": "A cursor for use in pagination.", + "type": "string" + } + } + }, + "MemberCreateRequestModel": { + "required": [ + "email", + "type", + "accessAll" + ], + "type": "object", + "properties": { + "email": { + "description": "The member's email address.", + "type": "string", + "example": "jsmith@company.com" + }, + "collections": { + "description": "The associated collections that this member can access.", + "uniqueItems": false, + "type": "array", + "items": { + "$ref": "#/definitions/AssociationWithPermissionsRequestModel" + } + }, + "type": { + "format": "int32", + "description": "The member's type (or role) within the organization.", + "enum": [ + 0, + 1, + 2, + 3 + ], + "type": "integer" + }, + "accessAll": { + "description": "Determines if this member can access all collections within the organization, or only the associated\r\ncollections. If set to {true}, this option overrides any collection assignments.", + "type": "boolean" + }, + "externalId": { + "description": "External identifier linking this member to another system, such as a user directory.", + "maxLength": 300, + "minLength": 0, + "type": "string", + "example": "external_id_123456" + } + } + } + }, + "securityDefinitions": { + "OAuth2 Client Credentials": { + "flow": "application", + "tokenUrl": "https://identity.bitwarden.com/connect/token", + "scopes": { + "api.organization": "Organization APIs" + }, + "type": "oauth2" + } + }, + "security": [ + { + "OAuth2 Client Credentials": [ + "api.organization" + ] + } + ] +} \ No newline at end of file