@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}
@required {DocumentId: str, VersionId: str}
@optional {Authentication: str}

@endpoint POST /api/v1/users/{UserId}/activation
@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
@required {ResourceId: str, Principals: [SharePrincipal]}
@optional {Authentication: str, NotificationOptions: NotificationOptions}
@returns(200) {ShareResults: [ShareResult]?}

@endpoint POST /api/v1/documents/{DocumentId}/versions/{VersionId}/comment
@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
@required {ResourceId: str, CustomMetadata: map<str,str>}
@optional {Authentication: str, versionid: str}

@endpoint POST /api/v1/folders
@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
@required {ResourceId: str, Labels: [str]}
@optional {Authentication: str}

@endpoint POST /api/v1/organizations/{OrganizationId}/subscriptions
@required {OrganizationId: str, Endpoint: str, Protocol: str, SubscriptionType: str}
@returns(200) {Subscription: Subscription?{SubscriptionId: str?, EndPoint: str?, Protocol: str?}}

@endpoint POST /api/v1/users
@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
@required {UserId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/documents/{DocumentId}/versions/{VersionId}/comment/{CommentId}
@required {DocumentId: str, VersionId: str, CommentId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/resources/{ResourceId}/customMetadata
@required {ResourceId: str}
@optional {Authentication: str, versionId: str, keys: [str], deleteAll: bool}

@endpoint DELETE /api/v1/documents/{DocumentId}
@required {DocumentId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/documentVersions/{DocumentId}/versions/{VersionId}
@required {DocumentId: str, VersionId: str, deletePriorVersions: bool}
@optional {Authentication: str}

@endpoint DELETE /api/v1/folders/{FolderId}
@required {FolderId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/folders/{FolderId}/contents
@required {FolderId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/resources/{ResourceId}/labels
@required {ResourceId: str}
@optional {Authentication: str, labels: [str], deleteAll: bool}

@endpoint DELETE /api/v1/organizations/{OrganizationId}/subscriptions/{SubscriptionId}
@required {SubscriptionId: str, OrganizationId: str}

@endpoint DELETE /api/v1/users/{UserId}
@required {UserId: str}
@optional {Authentication: str}

@endpoint GET /api/v1/activities
@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
@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
@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
@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
@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
@required {OrganizationId: str}
@optional {marker: str, limit: int}
@returns(200) {Subscriptions: [Subscription]?, Marker: str?}

@endpoint GET /api/v1/resources/{ResourceId}/permissions
@required {ResourceId: str}
@optional {Authentication: str, principalId: str, limit: int, marker: str}
@returns(200) {Principals: [Principal]?, Marker: str?}

@endpoint GET /api/v1/me/root
@required {Authentication: str}
@optional {limit: int, marker: str}
@returns(200) {Folders: [FolderMetadata]?, Marker: str?}

@endpoint GET /api/v1/users
@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
@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}
@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
@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}
@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}
@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
@required {FolderId: str}
@optional {Authentication: str, limit: int, fields: str, marker: str}
@returns(200) {Path: ResourcePath?{Components: [ResourcePathComponent]?}}

@endpoint GET /api/v1/resources
@optional {Authentication: str, userId: str, collectionType: str, limit: int, marker: str}
@returns(200) {Folders: [FolderMetadata]?, Documents: [DocumentMetadata]?, Marker: str?}

@endpoint POST /api/v1/documents
@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
@required {ResourceId: str}
@optional {Authentication: str}

@endpoint DELETE /api/v1/resources/{ResourceId}/permissions/{PrincipalId}
@required {ResourceId: str, PrincipalId: str}
@optional {Authentication: str, type: str}

@endpoint POST /api/v1/documentVersions/restore/{DocumentId}
@required {DocumentId: str}
@optional {Authentication: str}

@endpoint POST /api/v1/search
@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}
@required {DocumentId: str}
@optional {Authentication: str, Name: str, ParentFolderId: str, ResourceState: str}

@endpoint PATCH /api/v1/documents/{DocumentId}/versions/{VersionId}
@required {DocumentId: str, VersionId: str}
@optional {Authentication: str, VersionStatus: str}

@endpoint PATCH /api/v1/folders/{FolderId}
@required {FolderId: str}
@optional {Authentication: str, Name: str, ParentFolderId: str, ResourceState: str}

@endpoint PATCH /api/v1/users/{UserId}
@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
