The API is available at https://api.segments.ai/.
To authenticate, add an API key in the header of each request:
curl -H "Authorization: APIKey YOUR_API_KEY"
An API key can be created on your user account page.
GET /users/:owner_name/datasets
To get all datasets of the currently logged in users, you can use this shortcut:
GET /user/datasets
Note that this will only return datasets which are public, and datasets which are private but where the logged in user is a collaborator.
Status: 200 OK[{"name": "cats","description": "A dataset of cat images.","data_type": "IMAGE","category": "other","public": false,"owner": {"username": "bert","email": "bert@segments.ai","created_at": "2020-05-11T14:00:53.763278Z"},"created_at": "2020-04-10T20:09:31Z","collaborators_count": 0,"samples_count": 94}]
GET /datasets/:owner_name/:dataset_name
Status: 200 OK{"name": "cats","description": "A dataset of cat images.","category": "other","public": false,"owner": {"username": "bert","created_at": "2020-05-11T14:00:53.763278Z"},"created_at": "2020-07-20T14:59:36.242218Z","collaborators_count": 0,"samples_count": 94,"task_type": "segmentation-bitmap","task_attributes": {"format_version": "0.1","categories": [{"name": "cat","id": 0},{"name": "dog","id": 1}]},"labelsets": [{"name": "ground-truth","description": "Ground truth labels.",},{"name": "predictions","description": "My model predictions.",},]}
POST /user/datasets
Name | Type | Description |
|
| Required. The name of the dataset. |
|
| The description of the dataset. |
|
| Category of the data. |
|
| Sets the visibility of a dataset. Can be one of:
|
|
| The readme of the dataset, displayed on the overview tab. |
{"name": "cats","description": "A dataset of cat images."}
Status: 201 Created{"name": "cats","description": "A dataset of cat images.","category": "other","public": false,"owner": {"username": "bert","email": "bert@segments.ai","created_at": "2020-05-11T14:00:53.763278Z"},"created_at": "2020-07-20T14:59:36.242218Z","collaborators_count": 0,"samples_count": 94}
DELETE /datasets/:owner_name/:dataset_name
GET /datasets/:owner/:dataset/samples
Status: 200 OK[{"uuid": "10130ecd-790e-463d-86ce-747f5c545c77","name": "image.png""data_type": "IMAGE","attributes": {"image": {"url": "https://example.com/image.png"}}"created_at": "2011-04-10T20:09:31Z""created_by": "jane"}]
GET /samples/:sample_uuid
Status: 200 OK{"uuid": "10130ecd-790e-463d-86ce-747f5c545c77","name": "image.png""data_type": "IMAGE","attributes": {"image": {"url": "https://example.com/image.png"}}"created_at": "2020-04-10T20:09:31Z""created_by": "jane","metadata": {}}
POST /datasets/:owner/:dataset/samples
Name | Type | Description |
|
| Required. The name of the sample. |
|
| Sample data. |
|
| User-defined metadata. |
{"name": "flowers.png","attributes": {"image": {"url": "https://example.com/image.png"}},"metadata": {"city": "London","weather": "cloudy","robot_id": 3}}
Status: 201 Created{"uuid": "10130ecd-790e-463d-86ce-747f5c545c77","name": "image.png""data_type": "IMAGE","attributes": {"image": {"url": "https://example.com/image.png"}}"created_at": "2011-04-10T20:09:31Z""created_by": "jane"}
DELETE /samples/:sample_uuid
GET /labels/:sample_uuid/:labelset
Status: 200 OK{"label_type": "segmentation-bitmap","label_status": "LABELED","attributes": {"annotations": [{"id": 1,"category_id": 0}],"segmentation_bitmap": {"url": "https://segmentsai-staging.s3.eu-west-2.amazonaws.com/assets/davy/ddf55e99-1a6f-42d2-83e9-8657de3259a1.png"}},"created_at": "2020-04-10T20:09:31Z","created_by": "jane",}
PUT /labels/:sample_uuid/:labelset
Name | Type | Description |
|
| Label data. |
|
| Status of the label. ​ Can be one of: |
|
| Prediction score. |
{"attributes": {"format_version": "0.1","annotations": [{"id": 1,"category_id": 0,}],"segmentation_bitmap": {"url": "https://example.com/label.png"}},"label_status": "PRELABELED","score": 0.9254}
Status: 201 Created{"attributes": {"format_version": "0.1","annotations": [{"id": 1,"category_id": 0,}],"segmentation_bitmap": {"url": "https://example.com/label.png"}},"label_status": "PRELABELED","created_at": "2011-04-10T20:09:31Z"}
DELETE /labels/:sample_uuid/:labelset