@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Amazon WorkDocs
@version 2016-05-01
@auth AWS SigV4
@endpoints 44
@hint download_for_search
@toc api(44)

@endpoint DELETE /api/v1/documents/{DocumentId}/versions/{VersionId}
@desc Aborts the upload of the specified document version that was previously initiated by InitiateDocumentVersionUpload. The client should make this call only when it no longer intends to upload the document version, or fails to do so.
@required {DocumentId: str, VersionId: str}
@optional {Authentication: str}

@endpoint POST /api/v1/users/{UserId}/activation
@desc Activates the specified user. Only active users can access Amazon WorkDocs.
@required {UserId: str}
@optional {Authentication: str}
@returns(200) {User: User?{Id: str?, Username: str?, EmailAddress: str?, GivenName: str?, Surname: str?, OrganizationId: str?, RootFolderId: str?, RecycleBinFolderId: str?, Status: str?, Type: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, TimeZoneId: str?, Locale: str?, Storage: UserStorageMetadata?{StorageUtilizedInBytes: int(i64)?, StorageRule: StorageRuleType?{StorageAllocatedInBytes: int(i64)?, StorageType: str?}}}}

@endpoint POST /api/v1/resources/{ResourceId}/permissions
@desc Creates a set of permissions for the specified folder or document. The resource permissions are overwritten if the principals already have different permissions.
@required {ResourceId: str, Principals: [SharePrincipal]}
@optional {Authentication: str, NotificationOptions: NotificationOptions}
@returns(200) {ShareResults: [ShareResult]?}

@endpoint POST /api/v1/documents/{DocumentId}/versions/{VersionId}/comment
@desc Adds a new comment to the specified document version.
@required {DocumentId: str, VersionId: str, Text: str}
@optional {Authentication: str, ParentId: str, ThreadId: str, Visibility: str, NotifyCollaborators: bool}
@returns(200) {Comment: Comment?{CommentId: str, ParentId: str?, ThreadId: str?, Text: str?, Contributor: User?{Id: str?, Username: str?, EmailAddress: str?, GivenName: str?, Surname: str?, OrganizationId: str?, RootFolderId: str?, RecycleBinFolderId: str?, Status: str?, Type: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, TimeZoneId: str?, Locale: str?, Storage: UserStorageMetadata?{StorageUtilizedInBytes: int(i64)?, StorageRule: StorageRuleType?}}, CreatedTimestamp: str(timestamp)?, Status: str?, Visibility: str?, RecipientId: str?}}

@endpoint PUT /api/v1/resources/{ResourceId}/customMetadata
@desc Adds one or more custom properties to the specified resource (a folder, document, or version).
@required {ResourceId: str, CustomMetadata: map<str,str>}
@optional {Authentication: str, versionid: str}

@endpoint POST /api/v1/folders
@desc Creates a folder with the specified name and parent folder.
@required {ParentFolderId: str}
@optional {Authentication: str, Name: str}
@returns(200) {Metadata: FolderMetadata?{Id: str?, Name: str?, CreatorId: str?, ParentFolderId: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, ResourceState: str?, Signature: str?, Labels: [str]?, Size: int(i64)?, LatestVersionSize: int(i64)?}}

@endpoint PUT /api/v1/resources/{ResourceId}/labels
@desc Adds the specified list of labels to the given resource (a document or folder)
@required {ResourceId: str, Labels: [str]}
@optional {Authentication: str}

@endpoint POST /api/v1/organizations/{OrganizationId}/subscriptions
@desc Configure Amazon WorkDocs to use Amazon SNS notifications. The endpoint receives a confirmation message, and must confirm the subscription. For more information, see Setting up notifications for an IAM user or role in the Amazon WorkDocs Developer Guide.
@required {OrganizationId: str, Endpoint: str, Protocol: str, SubscriptionType: str}
@returns(200) {Subscription: Subscription?{SubscriptionId: str?, EndPoint: str?, Protocol: str?}}

@endpoint POST /api/v1/users
@desc Creates a user in a Simple AD or Microsoft AD directory. The status of a newly created user is "ACTIVE". New users can access Amazon WorkDocs.
@required {Username: str, GivenName: str, Surname: str, Password: str}
@optional {Authentication: str, OrganizationId: str, EmailAddress: str, TimeZoneId: str, StorageRule: StorageRuleType}
@returns(200) {User: User?{Id: str?, Username: str?, EmailAddress: str?, GivenName: str?, Surname: str?, OrganizationId: str?, RootFolderId: str?, RecycleBinFolderId: str?, Status: str?, Type: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, TimeZoneId: str?, Locale: str?, Storage: UserStorageMetadata?{StorageUtilizedInBytes: int(i64)?, StorageRule: StorageRuleType?{StorageAllocatedInBytes: int(i64)?, StorageType: str?}}}}

@endpoint DELETE /api/v1/users/{UserId}/activation
@desc Deactivates the specified user, which revokes the user's access to Amazon WorkDocs.
@required {UserId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/documents/{DocumentId}/versions/{VersionId}/comment/{CommentId}
@desc Deletes the specified comment from the document version.
@required {DocumentId: str, VersionId: str, CommentId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/resources/{ResourceId}/customMetadata
@desc Deletes custom metadata from the specified resource.
@required {ResourceId: str}
@optional {Authentication: str, versionId: str, keys: [str], deleteAll: bool}

@endpoint DELETE /api/v1/documents/{DocumentId}
@desc Permanently deletes the specified document and its associated metadata.
@required {DocumentId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/documentVersions/{DocumentId}/versions/{VersionId}
@desc Deletes a specific version of a document.
@required {DocumentId: str, VersionId: str, deletePriorVersions: bool}
@optional {Authentication: str}

@endpoint DELETE /api/v1/folders/{FolderId}
@desc Permanently deletes the specified folder and its contents.
@required {FolderId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/folders/{FolderId}/contents
@desc Deletes the contents of the specified folder.
@required {FolderId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/resources/{ResourceId}/labels
@desc Deletes the specified list of labels from a resource.
@required {ResourceId: str}
@optional {Authentication: str, labels: [str], deleteAll: bool}

@endpoint DELETE /api/v1/organizations/{OrganizationId}/subscriptions/{SubscriptionId}
@desc Deletes the specified subscription from the specified organization.
@required {SubscriptionId: str, OrganizationId: str}

@endpoint DELETE /api/v1/users/{UserId}
@desc Deletes the specified user from a Simple AD or Microsoft AD directory.  Deleting a user immediately and permanently deletes all content in that user's folder structure. Site retention policies do NOT apply to this type of deletion.
@required {UserId: str}
@optional {Authentication: str}

@endpoint GET /api/v1/activities
@desc Describes the user activities in a specified time period.
@optional {Authentication: str, startTime: str(timestamp), endTime: str(timestamp), organizationId: str, activityTypes: str, resourceId: str, userId: str, includeIndirectActivities: bool, limit: int, marker: str}
@returns(200) {UserActivities: [Activity]?, Marker: str?}

@endpoint GET /api/v1/documents/{DocumentId}/versions/{VersionId}/comments
@desc List all the comments for the specified document version.
@required {DocumentId: str, VersionId: str}
@optional {Authentication: str, limit: int, marker: str}
@returns(200) {Comments: [Comment]?, Marker: str?}

@endpoint GET /api/v1/documents/{DocumentId}/versions
@desc Retrieves the document versions for the specified document. By default, only active versions are returned.
@required {DocumentId: str}
@optional {Authentication: str, marker: str, limit: int, include: str, fields: str}
@returns(200) {DocumentVersions: [DocumentVersionMetadata]?, Marker: str?}

@endpoint GET /api/v1/folders/{FolderId}/contents
@desc Describes the contents of the specified folder, including its documents and subfolders. By default, Amazon WorkDocs returns the first 100 active document and folder metadata items. If there are more results, the response includes a marker that you can use to request the next set of results. You can also request initialized documents.
@required {FolderId: str}
@optional {Authentication: str, sort: str, order: str, limit: int, marker: str, type: str, include: str}
@returns(200) {Folders: [FolderMetadata]?, Documents: [DocumentMetadata]?, Marker: str?}

@endpoint GET /api/v1/groups
@desc Describes the groups specified by the query. Groups are defined by the underlying Active Directory.
@required {searchQuery: str}
@optional {Authentication: str, organizationId: str, marker: str, limit: int}
@returns(200) {Groups: [GroupMetadata]?, Marker: str?}

@endpoint GET /api/v1/organizations/{OrganizationId}/subscriptions
@desc Lists the specified notification subscriptions.
@required {OrganizationId: str}
@optional {marker: str, limit: int}
@returns(200) {Subscriptions: [Subscription]?, Marker: str?}

@endpoint GET /api/v1/resources/{ResourceId}/permissions
@desc Describes the permissions of a specified resource.
@required {ResourceId: str}
@optional {Authentication: str, principalId: str, limit: int, marker: str}
@returns(200) {Principals: [Principal]?, Marker: str?}

@endpoint GET /api/v1/me/root
@desc Describes the current user's special folders; the RootFolder and the RecycleBin. RootFolder is the root of user's files and folders and RecycleBin is the root of recycled items. This is not a valid action for SigV4 (administrative API) clients. This action requires an authentication token. To get an authentication token, register an application with Amazon WorkDocs. For more information, see Authentication and Access Control for User Applications in the Amazon WorkDocs Developer Guide.
@required {Authentication: str}
@optional {limit: int, marker: str}
@returns(200) {Folders: [FolderMetadata]?, Marker: str?}

@endpoint GET /api/v1/users
@desc Describes the specified users. You can describe all users or filter the results (for example, by status or organization). By default, Amazon WorkDocs returns the first 24 active or pending users. If there are more results, the response includes a marker that you can use to request the next set of results.
@optional {Authentication: str, organizationId: str, userIds: str, query: str, include: str, order: str, sort: str, marker: str, limit: int, fields: str}
@returns(200) {Users: [User]?, TotalNumberOfUsers: int(i64)?, Marker: str?}

@endpoint GET /api/v1/me
@desc Retrieves details of the current user for whom the authentication token was generated. This is not a valid action for SigV4 (administrative API) clients. This action requires an authentication token. To get an authentication token, register an application with Amazon WorkDocs. For more information, see Authentication and Access Control for User Applications in the Amazon WorkDocs Developer Guide.
@required {Authentication: str}
@returns(200) {User: User?{Id: str?, Username: str?, EmailAddress: str?, GivenName: str?, Surname: str?, OrganizationId: str?, RootFolderId: str?, RecycleBinFolderId: str?, Status: str?, Type: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, TimeZoneId: str?, Locale: str?, Storage: UserStorageMetadata?{StorageUtilizedInBytes: int(i64)?, StorageRule: StorageRuleType?{StorageAllocatedInBytes: int(i64)?, StorageType: str?}}}}

@endpoint GET /api/v1/documents/{DocumentId}
@desc Retrieves details of a document.
@required {DocumentId: str}
@optional {Authentication: str, includeCustomMetadata: bool}
@returns(200) {Metadata: DocumentMetadata?{Id: str?, CreatorId: str?, ParentFolderId: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, LatestVersionMetadata: DocumentVersionMetadata?{Id: str?, Name: str?, ContentType: str?, Size: int(i64)?, Signature: str?, Status: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, ContentCreatedTimestamp: str(timestamp)?, ContentModifiedTimestamp: str(timestamp)?, CreatorId: str?, Thumbnail: map<str,str>?, Source: map<str,str>?}, ResourceState: str?, Labels: [str]?}, CustomMetadata: map<str,str>?}

@endpoint GET /api/v1/documents/{DocumentId}/path
@desc Retrieves the path information (the hierarchy from the root folder) for the requested document. By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested document and only includes the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the names of the parent folders.
@required {DocumentId: str}
@optional {Authentication: str, limit: int, fields: str, marker: str}
@returns(200) {Path: ResourcePath?{Components: [ResourcePathComponent]?}}

@endpoint GET /api/v1/documents/{DocumentId}/versions/{VersionId}
@desc Retrieves version metadata for the specified document.
@required {DocumentId: str, VersionId: str}
@optional {Authentication: str, fields: str, includeCustomMetadata: bool}
@returns(200) {Metadata: DocumentVersionMetadata?{Id: str?, Name: str?, ContentType: str?, Size: int(i64)?, Signature: str?, Status: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, ContentCreatedTimestamp: str(timestamp)?, ContentModifiedTimestamp: str(timestamp)?, CreatorId: str?, Thumbnail: map<str,str>?, Source: map<str,str>?}, CustomMetadata: map<str,str>?}

@endpoint GET /api/v1/folders/{FolderId}
@desc Retrieves the metadata of the specified folder.
@required {FolderId: str}
@optional {Authentication: str, includeCustomMetadata: bool}
@returns(200) {Metadata: FolderMetadata?{Id: str?, Name: str?, CreatorId: str?, ParentFolderId: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, ResourceState: str?, Signature: str?, Labels: [str]?, Size: int(i64)?, LatestVersionSize: int(i64)?}, CustomMetadata: map<str,str>?}

@endpoint GET /api/v1/folders/{FolderId}/path
@desc Retrieves the path information (the hierarchy from the root folder) for the specified folder. By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested folder and only includes the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the parent folder names.
@required {FolderId: str}
@optional {Authentication: str, limit: int, fields: str, marker: str}
@returns(200) {Path: ResourcePath?{Components: [ResourcePathComponent]?}}

@endpoint GET /api/v1/resources
@desc Retrieves a collection of resources, including folders and documents. The only CollectionType supported is SHARED_WITH_ME.
@optional {Authentication: str, userId: str, collectionType: str, limit: int, marker: str}
@returns(200) {Folders: [FolderMetadata]?, Documents: [DocumentMetadata]?, Marker: str?}

@endpoint POST /api/v1/documents
@desc Creates a new document object and version object. The client specifies the parent folder ID and name of the document to upload. The ID is optionally specified when creating a new version of an existing document. This is the first step to upload a document. Next, upload the document to the URL returned from the call, and then call UpdateDocumentVersion. To cancel the document upload, call AbortDocumentVersionUpload.
@optional {Authentication: str, Id: str, Name: str, ContentCreatedTimestamp: str(timestamp), ContentModifiedTimestamp: str(timestamp), ContentType: str, DocumentSizeInBytes: int(i64), ParentFolderId: str}
@returns(200) {Metadata: DocumentMetadata?{Id: str?, CreatorId: str?, ParentFolderId: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, LatestVersionMetadata: DocumentVersionMetadata?{Id: str?, Name: str?, ContentType: str?, Size: int(i64)?, Signature: str?, Status: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, ContentCreatedTimestamp: str(timestamp)?, ContentModifiedTimestamp: str(timestamp)?, CreatorId: str?, Thumbnail: map<str,str>?, Source: map<str,str>?}, ResourceState: str?, Labels: [str]?}, UploadMetadata: UploadMetadata?{UploadUrl: str?, SignedHeaders: map<str,str>?}}

@endpoint DELETE /api/v1/resources/{ResourceId}/permissions
@desc Removes all the permissions from the specified resource.
@required {ResourceId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/resources/{ResourceId}/permissions/{PrincipalId}
@desc Removes the permission for the specified principal from the specified resource.
@required {ResourceId: str, PrincipalId: str}
@optional {Authentication: str, type: str}

@endpoint POST /api/v1/documentVersions/restore/{DocumentId}
@desc Recovers a deleted version of an Amazon WorkDocs document.
@required {DocumentId: str}
@optional {Authentication: str}

@endpoint POST /api/v1/search
@desc Searches metadata and the content of folders, documents, document versions, and comments.
@optional {Authentication: str, QueryText: str, QueryScopes: [str], OrganizationId: str, AdditionalResponseFields: [str], Filters: Filters, OrderBy: [SearchSortResult], Limit: int, Marker: str}
@returns(200) {Items: [ResponseItem]?, Marker: str?}

@endpoint PATCH /api/v1/documents/{DocumentId}
@desc Updates the specified attributes of a document. The user must have access to both the document and its parent folder, if applicable.
@required {DocumentId: str}
@optional {Authentication: str, Name: str, ParentFolderId: str, ResourceState: str}

@endpoint PATCH /api/v1/documents/{DocumentId}/versions/{VersionId}
@desc Changes the status of the document version to ACTIVE.  Amazon WorkDocs also sets its document container to ACTIVE. This is the last step in a document upload, after the client uploads the document to an S3-presigned URL returned by InitiateDocumentVersionUpload.
@required {DocumentId: str, VersionId: str}
@optional {Authentication: str, VersionStatus: str}

@endpoint PATCH /api/v1/folders/{FolderId}
@desc Updates the specified attributes of the specified folder. The user must have access to both the folder and its parent folder, if applicable.
@required {FolderId: str}
@optional {Authentication: str, Name: str, ParentFolderId: str, ResourceState: str}

@endpoint PATCH /api/v1/users/{UserId}
@desc Updates the specified attributes of the specified user, and grants or revokes administrative privileges to the Amazon WorkDocs site.
@required {UserId: str}
@optional {Authentication: str, GivenName: str, Surname: str, Type: str, StorageRule: StorageRuleType, TimeZoneId: str, Locale: str, GrantPoweruserPrivileges: str}
@returns(200) {User: User?{Id: str?, Username: str?, EmailAddress: str?, GivenName: str?, Surname: str?, OrganizationId: str?, RootFolderId: str?, RecycleBinFolderId: str?, Status: str?, Type: str?, CreatedTimestamp: str(timestamp)?, ModifiedTimestamp: str(timestamp)?, TimeZoneId: str?, Locale: str?, Storage: UserStorageMetadata?{StorageUtilizedInBytes: int(i64)?, StorageRule: StorageRuleType?{StorageAllocatedInBytes: int(i64)?, StorageType: str?}}}}

@end
