@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Custom Vision Training Client
@base https://southcentralus.api.cognitive.microsoft.com/customvision/v3.2/training
@version 3.2
@auth ApiKey Training-Key in header
@endpoints 48
@hint download_for_search
@toc domains(2), projects(46)

@group domains
@endpoint GET /domains
@desc Get a list of the available domains.
@returns(200) OK

@endpoint GET /domains/{domainId}
@desc Get information about a specific domain.
@required {domainId: any # The id of the domain to get information about.}
@returns(200) OK

@endgroup

@group projects
@endpoint GET /projects
@desc Get your projects.
@returns(200) OK

@endpoint POST /projects
@desc Create a project.
@required {name: any # Name of the project.}
@optional {description: any # The description of the project., domainId: any # The id of the domain to use for this project. Defaults to General., classificationType: any # The type of classifier to create for this project., targetExportPlatforms: any # List of platforms the trained model is intending exporting to.}
@returns(200) OK

@endpoint GET /projects/{projectId}
@desc Get a specific project.
@required {projectId: any # The id of the project to get.}
@returns(200) OK

@endpoint DELETE /projects/{projectId}
@desc Delete a specific project.
@required {projectId: any # The project id.}
@returns(204) No Content

@endpoint PATCH /projects/{projectId}
@desc Update a specific project.
@required {projectId: any # The id of the project to update., updatedProject: map # The updated project model.}
@returns(200) OK

@endpoint GET /projects/{projectId}/export
@desc Exports a project.
@required {projectId: any # The project id of the project to export.}
@returns(200) OK

@endpoint POST /projects/{projectId}/images
@desc This API accepts body content as multipart/form-data and application/octet-stream. When using multipart
@required {projectId: any # The project id., imageData: any # Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB.}
@optional {tagIds: any # The tags ids with which to tag each image. Limited to 20.}
@returns(200) OK

@endpoint DELETE /projects/{projectId}/images
@desc Delete images from the set of training images.
@required {projectId: any # The project id.}
@optional {imageIds: any # Ids of the images to be deleted. Limited to 256 images per batch., allImages: any # Flag to specify delete all images, specify this flag or a list of images. Using this flag will return a 202 response to indicate the images are being deleted., allIterations: any # Removes these images from all iterations, not just the current workspace. Using this flag will return a 202 response to indicate the images are being deleted.}
@returns(202) Accepted
@returns(204) No Content

@endpoint POST /projects/{projectId}/images/{imageId}/regionproposals
@desc This API will get region proposals for an image along with confidences for the region. It returns an empty array if no proposals are found.
@required {projectId: any # The project id., imageId: any # The image id.}
@returns(200) OK

@endpoint POST /projects/{projectId}/images/files
@desc This API accepts a batch of files, and optionally tags, to create images. There is a limit of 64 images and 20 tags.
@required {projectId: any # The project id., batch: map # The batch of image files to add. Limited to 64 images and 20 tags per batch.}
@returns(200) OK

@endpoint GET /projects/{projectId}/images/id
@desc This API will return a set of Images for the specified tags and optionally iteration. If no iteration is specified the
@required {projectId: any # The project id.}
@optional {imageIds: any # The list of image ids to retrieve. Limited to 256., iterationId: any # The iteration id. Defaults to workspace.}
@returns(200) OK

@endpoint POST /projects/{projectId}/images/predictions
@desc This API creates a batch of images from predicted images specified. There is a limit of 64 images and 20 tags.
@required {projectId: any # The project id., batch: map # Image and tag ids. Limited to 64 images and 20 tags per batch.}
@returns(200) OK

@endpoint POST /projects/{projectId}/images/regions
@desc This API accepts a batch of image regions, and optionally tags, to update existing images with region information.
@required {projectId: any # The project id., batch: map # Batch of image regions which include a tag and bounding box. Limited to 64.}
@returns(200) OK

@endpoint DELETE /projects/{projectId}/images/regions
@desc Delete a set of image regions.
@required {projectId: any # The project id., regionIds: any # Regions to delete. Limited to 64.}
@returns(204) No Content

@endpoint POST /projects/{projectId}/images/suggested
@desc This API will fetch untagged images filtered by suggested tags Ids. It returns an empty array if no images are found.
@required {projectId: any # The project id., iterationId: any # IterationId to use for the suggested tags and regions., query: map # Contains properties we need to query suggested images.}
@returns(200) OK

@endpoint POST /projects/{projectId}/images/suggested/count
@desc This API takes in tagIds to get count of untagged images per suggested tags for a given threshold.
@required {projectId: any # The project id., iterationId: any # IterationId to use for the suggested tags and regions., query: map # Model that contains tagIds, threshold and projectType to query by.}
@returns(200) OK

@endpoint GET /projects/{projectId}/images/tagged
@desc This API supports batching and range selection. By default it will only return first 50 images matching images.
@required {projectId: any # The project id.}
@optional {iterationId: any # The iteration id. Defaults to workspace., tagIds: any # A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20., orderBy: any # The ordering. Defaults to newest., take: any # Maximum number of images to return. Defaults to 50, limited to 256., skip: any # Number of images to skip before beginning the image batch. Defaults to 0.}
@returns(200) OK

@endpoint GET /projects/{projectId}/images/tagged/count
@desc The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
@required {projectId: any # The project id.}
@optional {iterationId: any # The iteration id. Defaults to workspace., tagIds: any # A list of tags ids to filter the images to count. Defaults to all tags when null.}
@returns(200) OK

@endpoint POST /projects/{projectId}/images/tags
@desc Associate a set of images with a set of tags.
@required {projectId: any # The project id., batch: map # Batch of image tags. Limited to 128 tags per batch.}
@returns(200) OK

@endpoint DELETE /projects/{projectId}/images/tags
@desc Remove a set of tags from a set of images.
@required {projectId: any # The project id., imageIds: any # Image ids. Limited to 64 images., tagIds: any # Tags to be deleted from the specified images. Limited to 20 tags.}
@returns(204) No Content

@endpoint GET /projects/{projectId}/images/untagged
@desc This API supports batching and range selection. By default it will only return first 50 images matching images.
@required {projectId: any # The project id.}
@optional {iterationId: any # The iteration id. Defaults to workspace., orderBy: any # The ordering. Defaults to newest., take: any # Maximum number of images to return. Defaults to 50, limited to 256., skip: any # Number of images to skip before beginning the image batch. Defaults to 0.}
@returns(200) OK

@endpoint GET /projects/{projectId}/images/untagged/count
@desc This API returns the images which have no tags for a given project and optionally an iteration. If no iteration is specified the
@required {projectId: any # The project id.}
@optional {iterationId: any # The iteration id. Defaults to workspace.}
@returns(200) OK

@endpoint POST /projects/{projectId}/images/urls
@desc This API accepts a batch of urls, and optionally tags, to create images. There is a limit of 64 images and 20 tags.
@required {projectId: any # The project id., batch: map # Image urls and tag ids. Limited to 64 images and 20 tags per batch.}
@returns(200) OK

@endpoint GET /projects/{projectId}/iterations
@desc Get iterations for the project.
@required {projectId: any # The project id.}
@returns(200) OK

@endpoint GET /projects/{projectId}/iterations/{iterationId}
@desc Get a specific iteration.
@required {projectId: any # The id of the project the iteration belongs to., iterationId: any # The id of the iteration to get.}
@returns(200) OK

@endpoint DELETE /projects/{projectId}/iterations/{iterationId}
@desc Delete a specific iteration of a project.
@required {projectId: any # The project id., iterationId: any # The iteration id.}
@returns(204) No Content

@endpoint PATCH /projects/{projectId}/iterations/{iterationId}
@desc Update a specific iteration.
@required {projectId: any # Project id., iterationId: any # Iteration id., updatedIteration: map # The updated iteration model.}
@returns(200) OK

@endpoint GET /projects/{projectId}/iterations/{iterationId}/export
@desc Get the list of exports for a specific iteration.
@required {projectId: any # The project id., iterationId: any # The iteration id.}
@returns(200) OK

@endpoint POST /projects/{projectId}/iterations/{iterationId}/export
@desc Export a trained iteration.
@required {projectId: any # The project id., iterationId: any # The iteration id., platform: any # The target platform.}
@optional {flavor: any # The flavor of the target platform.}
@returns(200) OK

@endpoint GET /projects/{projectId}/iterations/{iterationId}/performance
@desc Get detailed performance information about an iteration.
@required {projectId: any # The id of the project the iteration belongs to., iterationId: any # The id of the iteration to get.}
@optional {threshold: any # The threshold used to determine true predictions., overlapThreshold: any # If applicable, the bounding box overlap threshold used to determine true predictions.}
@returns(200) OK

@endpoint GET /projects/{projectId}/iterations/{iterationId}/performance/images
@desc This API supports batching and range selection. By default it will only return first 50 images matching images.
@required {projectId: any # The project id., iterationId: any # The iteration id. Defaults to workspace.}
@optional {tagIds: any # A list of tags ids to filter the images. Defaults to all tagged images when null. Limited to 20., orderBy: any # The ordering. Defaults to newest., take: any # Maximum number of images to return. Defaults to 50, limited to 256., skip: any # Number of images to skip before beginning the image batch. Defaults to 0.}
@returns(200) OK

@endpoint GET /projects/{projectId}/iterations/{iterationId}/performance/images/count
@desc The filtering is on an and/or relationship. For example, if the provided tag ids are for the "Dog" and
@required {projectId: any # The project id., iterationId: any # The iteration id. Defaults to workspace.}
@optional {tagIds: any # A list of tags ids to filter the images to count. Defaults to all tags when null.}
@returns(200) OK

@endpoint POST /projects/{projectId}/iterations/{iterationId}/publish
@desc Publish a specific iteration.
@required {projectId: any # The project id., iterationId: any # The iteration id., publishName: any # The name to give the published iteration., predictionId: any # The id of the prediction resource to publish to.}
@returns(200) OK

@endpoint DELETE /projects/{projectId}/iterations/{iterationId}/publish
@desc Unpublish a specific iteration.
@required {projectId: any # The project id., iterationId: any # The iteration id.}
@returns(204) No Content

@endpoint DELETE /projects/{projectId}/predictions
@desc Delete a set of predicted images and their associated prediction results.
@required {projectId: any # The project id., ids: any # The prediction ids. Limited to 64.}
@returns(204) No Content

@endpoint POST /projects/{projectId}/predictions/query
@desc Get images that were sent to your prediction endpoint.
@required {projectId: any # The project id., query: map # Parameters used to query the predictions. Limited to combining 2 tags.}
@returns(200) OK

@endpoint POST /projects/{projectId}/quicktest/image
@desc Quick test an image.
@required {projectId: any # The project id., imageData: any # Binary image data. Supported formats are JPEG, GIF, PNG, and BMP. Supports images up to 6MB.}
@optional {iterationId: any # Optional. Specifies the id of a particular iteration to evaluate against.             The default iteration for the project will be used when not specified., store: any # Optional. Specifies whether or not to store the result of this prediction. The default is true, to store.}
@returns(200) OK

@endpoint POST /projects/{projectId}/quicktest/url
@desc Quick test an image url.
@required {projectId: any # The project to evaluate against., imageUrl: map # An ImageUrl that contains the url of the image to be evaluated.}
@optional {iterationId: any # Optional. Specifies the id of a particular iteration to evaluate against.             The default iteration for the project will be used when not specified., store: any # Optional. Specifies whether or not to store the result of this prediction. The default is true, to store.}
@returns(200) OK

@endpoint GET /projects/{projectId}/tags
@desc Get the tags for a given project and iteration.
@required {projectId: any # The project id.}
@optional {iterationId: any # The iteration id. Defaults to workspace.}
@returns(200) OK

@endpoint POST /projects/{projectId}/tags
@desc Create a tag for the project.
@required {projectId: any # The project id., name: any # The tag name.}
@optional {description: any # Optional description for the tag., type: any # Optional type for the tag.}
@returns(200) OK

@endpoint GET /projects/{projectId}/tags/{tagId}
@desc Get information about a specific tag.
@required {projectId: any # The project this tag belongs to., tagId: any # The tag id.}
@optional {iterationId: any # The iteration to retrieve this tag from. Optional, defaults to current training set.}
@returns(200) OK

@endpoint DELETE /projects/{projectId}/tags/{tagId}
@desc Delete a tag from the project.
@required {projectId: any # The project id., tagId: any # Id of the tag to be deleted.}
@returns(204) No Content

@endpoint PATCH /projects/{projectId}/tags/{tagId}
@desc Update a tag.
@required {projectId: any # The project id., tagId: any # The id of the target tag., updatedTag: map # The updated tag model.}
@returns(200) OK

@endpoint POST /projects/{projectId}/tagsandregions/suggestions
@desc This API will get suggested tags and regions for an array/batch of untagged images along with confidences for the tags. It returns an empty array if no tags are found.
@required {projectId: any # The project id., iterationId: any # IterationId to use for tag and region suggestion., imageIds: any # Array of image ids tag suggestion are needed for. Use GetUntaggedImages API to get imageIds.}
@returns(200) OK

@endpoint POST /projects/{projectId}/train
@desc Queues project for training.
@required {projectId: any # The project id.}
@optional {trainingType: any # The type of training to use to train the project (default: Regular)., reservedBudgetInHours: any # The number of hours reserved as budget for training (if applicable)., forceTrain: any # Whether to force train even if dataset and configuration does not change (default: false)., notificationEmailAddress: any # The email address to send notification to when training finishes (default: null)., trainingParameters: map # Additional training parameters passed in to control how the project is trained.}
@returns(200) OK

@endpoint POST /projects/import
@desc Imports a project.
@required {token: any # Token generated from the export project call.}
@returns(200) OK

@endgroup

@end
