site/content/en/docs/api_sdk/api/_index.md
CVAT server provides HTTP REST API for interaction. Each client application - be it a command line tool, browser or a script - all interact with CVAT via HTTP requests and responses:
You can obtain schema for your server at <yourserver>/api/docs. For example,
the official CVAT.ai application has API documentation here.
Here you can see how a task is created in CVAT:
Common pattern for our REST API is <VERB> [namespace] <objects> <id> <action>.
VERB can be POST, GET, PATCH, PUT, DELETE.namespace should scope some specific functionality like auth, lambda.
It is optional in the scheme.objects are tasks, projects, jobs.id.action can be used to simplify REST API or provide an endpoint for entities
without objects endpoint like annotations, data, data/meta. Note: action
should not duplicate other endpoints without a reason.When you're developing new endpoints, follow these guidelines:
POST /api/tasks instead of POST /api/tasks/create./tasks, /projects)/projects and /tasks instead of /projects/:id1/tasks/:id2. Use
filters to extract necessary information like /tasks/:id2?project=:id1.
In some cases it is useful to get all tasks. If the structure is
hierarchical, it cannot be done easily. Also you have to know both :id1
and :id2 to get information about the task.
Note: for now we accept GET /tasks/:id2/jobs but it should be replaced
by /jobs?task=:id2 in the future.201, 400)Accept header with vendor media type.Sometimes, it may be necessary to send customized requests or
simply test some endpoints available on the server.
It's possible to send custom requests to a CVAT server directly from
your web browser without special extensions. This can be done at
the Swagger page provided by the server. The page is available at
<cvat_host>/api/swagger (e.g. https://app.cvat.ai/api/swagger).
The Swagger page provides the autogenerated documentation,
supports multiple authentication options and allows sending
custom requests to various server endpoints.
Swagger documentation is visible on allowed hosts. If necessary, the list can be modified by updating the environment
variable in docker-compose.ymlfile with cvat hosted machine IP or domain
name. Example - ALLOWED_HOSTS: 'localhost, 127.0.0.1'.
Make a request to a resource stored on a server and the server will respond with the requested information.
The endpoints are grouped by APIs:
auth - user authentication queriescomments - requests to post/delete comments to issuesissues - update, delete and view problem commentsjobs -requests to manage the joblambda - requests to work with lambda functionprojects - project management queriesreviews -adding and removing the review of the jobserver - server information requeststasks - requests to manage tasksusers - user management queries
etc.In the Models section below you can also find various data structures used in the endpoints.
Each group contains queries related to a different types of HTTP methods such as: GET, POST, PATCH, DELETE, etc.
Different methods are highlighted in different color. Each item has a name and description.
Clicking on an element opens a form with a name, description and settings input field or an example of json values.
To find out more, read swagger specification.
To try to send a request, click Try it now and type Execute.
You'll get a response in the form of Curl, Request URL and Server response.