Skip to main content

Create Data Endpoints

List of endpoints for creating Labels and Data


Create Labels#

POST https://api.levity.ai/v1/labels/#

The POST /v1/labels/ endpoint can accept a request with the following json properties in the body payload:

Body Payload#

dataset: Link to the associated AI Block name: Name of the Label

Sample Payload:

{  dataset: "https://api.levity.ai/v1/datasets/e0854485-7cbb-4b02-b21e-fd32757d10f0/"  name: "Cat"}
Header Fields#
  • Authorization: "Bearer < token > "
  • Content-Type: "application/json"

Response will contain the following

{  Status Code: 201 Created}

Create Labelled Image Data#

POST https://upload.levity.ai/upload/labelled-image#

The POST /upload/labelled-image endpoint can accept a request with the following json properties in the body payload:

Body Payload#
  • files: Binary of the image file (JPG or PNG) to be uploaded
Header Fields#
  • Authorization: "Bearer < token > "
  • aiblockid: AI Block ID (v4 UUID) can be found in the AI Block page url in the Levity app.
  • labels: Label ID (v4 UUID), 1 or more comma separated list of label id this image should be associated with.

Sample Payload:

headers={  aiblockid: e0854485-7cbb-4b02-b21e-fd32757d10f0  labels: 66234be1-35e6-4f7e-ac65-cba52482bdad,13234be1-35e6-4f7e-ac65-cba52482bdad}
Response#

Status Code: 201 Created

Payload:

{    url: string;    signedUrls: {        signedUrl50: string;        signedUrl250: string;        signedUrl600: string;        signedUrlOrig: string    } | null;    createdAt: Date;    updatedAt: Date;    originalFileName: string | null;    storageId: string | null;    remoteUrl: string | null;    text: string | null;    status: string;    dataset: string}

Create Labelled PDF Data#

POST https://upload.levity.ai/upload/labelled-pdf#

The POST /upload/labelled-pdf endpoint can accept a request with the following json properties in the body payload:

Body Payload#
  • files: Binary of the pdf file to be uploaded
Header Fields#
  • Authorization: "Bearer < token > "
  • aiblockid: AI Block ID (v4 UUID) can be found in the AI Block page url in the Levity app.
  • labels: Label ID (v4 UUID), 1 or more comma separated list of label id this image should be associated with.

Sample Payload:

headers={  aiblockid: e0854485-7cbb-4b02-b21e-fd32757d10f0  labels: 66234be1-35e6-4f7e-ac65-cba52482bdad,13234be1-35e6-4f7e-ac65-cba52482bdad}
Response#

Status Code: 201 Created

Payload:

{    url: string;    signedUrls: {        signedUrl50: string;        signedUrl250: string;        signedUrl600: string;        signedUrlOrig: string    } | null;    createdAt: Date;    updatedAt: Date;    originalFileName: string | null;    storageId: string | null;    remoteUrl: string | null;    text: string | null;    status: string;    dataset: string}

Create Labelled Item Data#

POST https://upload.levity.ai/upload/labelled-image#

The POST /upload/labelled-item endpoint can accept a request with the following json properties in the body payload:

Body Payload#
  • files: Binary of an image file (JPG or PNG) or a pdf file to be uploaded
Header Fields#
  • Authorization: "Bearer < token > "
  • aiblockid: AI Block ID (v4 UUID) can be found in the AI Block page url in the Levity app.
  • labels: Label ID (v4 UUID), 1 or more comma separated list of label id this image should be associated with.

Sample Payload:

headers={  aiblockid: e0854485-7cbb-4b02-b21e-fd32757d10f0  labels: 66234be1-35e6-4f7e-ac65-cba52482bdad,13234be1-35e6-4f7e-ac65-cba52482bdad}
Response#

Status Code: 201 Created

Payload:

{    url: string;    signedUrls: {        signedUrl50: string;        signedUrl250: string;        signedUrl600: string;        signedUrlOrig: string    } | null;    createdAt: Date;    updatedAt: Date;    originalFileName: string | null;    storageId: string | null;    remoteUrl: string | null;    text: string | null;    status: string;    dataset: string}

Create Labelled Item using a URL Data#

POST https://upload.levity.ai/upload/labelled-item-url#

The POST /upload/labelled-item-url endpoint can accept a request with the following json properties in the body payload:

Header Fields#
  • Authorization: "Bearer < token > "
  • aiblockid: AI Block ID (v4 UUID) can be found in the AI Block page url in the Levity app.
  • url: URL of the file to be uploaded, file can only be an image (JPG or PNG) or a PDF
  • labels: Label ID (v4 UUID), 1 or more comma separated list of label id this image should be associated with.

Sample Payload:

headers={  aiblockid: e0854485-7cbb-4b02-b21e-fd32757d10f0  url: https://www.example.com/files/image.png  labels: 66234be1-35e6-4f7e-ac65-cba52482bdad,13234be1-35e6-4f7e-ac65-cba52482bdad}
Response#

Status Code: 201 Created

Payload:

{    url: string;    signedUrls: {        signedUrl50: string;        signedUrl250: string;        signedUrl600: string;        signedUrlOrig: string    } | null;    createdAt: Date;    updatedAt: Date;    originalFileName: string | null;    storageId: string | null;    remoteUrl: string | null;    text: string | null;    status: string;    dataset: string}

Create Labelled Text Data#

POST https://upload.levity.ai/upload/labelled-image#

The POST /upload/labelled-text endpoint can accept a request with the following json properties in the body payload:

Body Payload#
  • data: Json text with a text attribute containing the text data.
Header Fields#
  • Authorization: "Bearer < token > "
  • aiblockid: AI Block ID (v4 UUID) can be found in the AI Block page url in the Levity app.
  • labels: Label ID (v4 UUID), 1 or more comma separated list of label id this image should be associated with.

Sample Payload:

headers={  aiblockid: e0854485-7cbb-4b02-b21e-fd32757d10f0  labels: 66234be1-35e6-4f7e-ac65-cba52482bdad,13234be1-35e6-4f7e-ac65-cba52482bdad}data='{"text": "hello world"}'
Response#

Status Code: 201 Created

Payload:

{    url: string;    signedUrls: {        signedUrl50: string;        signedUrl250: string;        signedUrl600: string;        signedUrlOrig: string    } | null;    createdAt: Date;    updatedAt: Date;    originalFileName: string | null;    storageId: string | null;    remoteUrl: string | null;    text: string | null;    status: string;    dataset: string}