Create Data Endpoints
List of endpoints for creating Labels and Data
#
Create Labelshttps://api.levity.ai/v1/labels/#
POSTThe POST /v1/labels/
endpoint can accept a request with the following json properties in the body payload:
#
Body Payloaddataset: 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 Datahttps://upload.levity.ai/upload/labelled-image#
POSTThe 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}
#
ResponseStatus 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 Datahttps://upload.levity.ai/upload/labelled-pdf#
POSTThe 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}
#
ResponseStatus 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 Datahttps://upload.levity.ai/upload/labelled-image#
POSTThe 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}
#
ResponseStatus 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 Datahttps://upload.levity.ai/upload/labelled-item-url#
POSTThe 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}
#
ResponseStatus 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 Datahttps://upload.levity.ai/upload/labelled-image#
POSTThe 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"}'
#
ResponseStatus 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}