Dataset API

The following APIs allow you to interact with datasets.


List datasets

GET
/api/datasets

Query Parameters

  • limitnumber?

  • offsetnumber?

  • userstring?

  • querystring?

Output

  • itemsarray

  • totalPagesnumber

  • currentPagenumber

const result = await axios.get(
	`https://dibby.ai/api/datasets`,
);
{
  "items": [
    {
      "name": "dataset_name",
      "desc": "Awesome dataset!",
      "user": {
        "name": "user_name"
      }
    }
  ],
  "totalPages": 1,
  "currentPage": 0
}

Search dataset

POST
/api/datasets/{owner}/{name}/search
Search dataset rows

Route Parameters

  • ownerstring

  • namestring

Body Parameters

  • limitnumber?

  • offsetnumber?

  • orderByarray?

  • selectarray?

  • whereRecord<string, object>?

Output

  • itemsarray

  • totalPagesnumber

  • currentPagenumber

const owner = 'some string';
const name = 'some string';
const result = await axios.post(
	`https://dibby.ai/api/datasets/${owner}/${name}/search`,
);
{
  "items": [
    {
      "id": "some string",
      "values": {
        "some string": {
          "rowId": "some string",
          "column": "some string",
          "type": "STRING",
          "value": "some string"
        }
      }
    }
  ],
  "totalPages": 1,
  "currentPage": 0
}

Update Column

PUT
/api/datasets/{owner}/{name}/columns/{column}
Update a column in a dataset

Route Parameters

  • ownerstring

  • namestring

  • columnstring

Body Parameters

  • namestring

const owner = 'some string';
const name = 'some string';
const column = 'some string';
const result = await axios.put(
	`https://dibby.ai/api/datasets/${owner}/${name}/columns/${column}`,
	{"name":"some string"}
);
{}

Delete Column

DELETE
/api/datasets/{owner}/{name}/columns/{column}
Delete a column along with all its values in a dataset

Route Parameters

  • ownerstring

  • namestring

  • columnstring

const owner = 'some string';
const name = 'some string';
const column = 'some string';
const result = await axios.delete(
	`https://dibby.ai/api/datasets/${owner}/${name}/columns/${column}`,
);
{}

List Columns

GET
/api/datasets/{owner}/{name}/columns

Route Parameters

  • ownerstring

  • namestring

Output

  • columnsarray

const owner = 'some string';
const name = 'some string';
const result = await axios.get(
	`https://dibby.ai/api/datasets/${owner}/${name}/columns`,
);
{
  "columns": [
    {
      "name": "columnName",
      "type": "STRING"
    }
  ]
}

Create Column

POST
/api/datasets/{owner}/{name}/columns
Create a new column in a dataset

Route Parameters

  • ownerstring

  • namestring

Body Parameters

  • namestring

  • typeSTRING | IMAGE | EMBEDDING | MODEL_OUTPUT | PAIRWISE | NUMBER

Output

  • namestring

  • typeSTRING | IMAGE | EMBEDDING | MODEL_OUTPUT | PAIRWISE | NUMBER

const owner = 'some string';
const name = 'some string';
const result = await axios.post(
	`https://dibby.ai/api/datasets/${owner}/${name}/columns`,
	{"name":"columnName","type":"STRING"}
);
{
  "name": "columnName",
  "type": "STRING"
}

Delete Row

DELETE
/api/datasets/{owner}/{name}/rows/{id}
Delete a row in a dataset

Route Parameters

  • ownerstring

  • namestring

  • idstring

const owner = 'some string';
const name = 'some string';
const id = 'some string';
const result = await axios.delete(
	`https://dibby.ai/api/datasets/${owner}/${name}/rows/${id}`,
);
{}

Create Row

POST
/api/datasets/{owner}/{name}/rows
Create a new row in a dataset

Route Parameters

  • ownerstring

  • namestring

Output

  • idstring

const owner = 'some string';
const name = 'some string';
const result = await axios.post(
	`https://dibby.ai/api/datasets/${owner}/${name}/rows`,
);
{
  "id": "some string"
}

Set cell value

PUT
/api/datasets/{owner}/{name}/cell
Set the value of a cell in a dataset

Route Parameters

  • ownerstring

  • namestring

const owner = 'some string';
const name = 'some string';
const result = await axios.put(
	`https://dibby.ai/api/datasets/${owner}/${name}/cell`,
	{
	  "rowId": "some string",
	  "column": "some string",
	  "type": "STRING",
	  "value": "some string"
	}
	{ headers: { 'Content-Type': 'multipart/form-data' }}
);
{}