cURL
curl -X POST https://api.aiql.io/ingestions \
-H "Authorization: Bearer $AIQL_API_KEY" \
-H "AiQL-Workspace: $AIQL_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/report.pdf", "metadata": {"customerId": "abc"}, "schema": {"classes": [{"name": "Person", "definition": "An individual human.", "cardinality": "many"}], "properties": [{"name": "name", "type": "STRING", "definition": "The person's full name.", "domain": ["Person"]}], "relationships": []}}'
curl -X POST https://api.aiql.io/ingestions \
-H "Authorization: Bearer $AIQL_API_KEY" \
-H "AiQL-Workspace: $AIQL_WORKSPACE_ID" \
-F "metadata={"customerId": "abc"}" \
-F "schema={"classes":[{"name":"Person","cardinality":"many"}],"properties":[{"name":"name","type":"STRING","domain":["Person"]}],"relationships":[]}" \
-F "file=@report.pdf"import os
from aiql import AiQL
client = AiQL(api_key=os.environ["AIQL_API_KEY"])
ingestion = client.ingestions.create(
workspace_id="ws_3a1b",
url="https://example.com/report.pdf",
metadata={"customerId": "abc"},
schema={
"classes": [{"name": "Person", "cardinality": "many"}],
"properties": [{"name": "name", "type": "STRING", "domain": ["Person"]}],
"relationships": [],
},
)
# Or upload a file directly instead of a URL:
with open("report.pdf", "rb") as f:
ingestion = client.ingestions.create(
workspace_id="ws_3a1b",
file=f,
metadata={"customerId": "abc"},
)
# Or request a presigned upload URL for a large file:
ingestion = client.ingestions.create(
workspace_id="ws_3a1b",
filename="report.pdf",
mime_type="application/pdf",
size=12_345_678,
)
# Then PUT the bytes to ingestion.upload.url with ingestion.upload.headersimport { AiQL } from "@aiql.io/sdk";
const client = new AiQL({ apiKey: process.env.AIQL_API_KEY });
const ingestion = await client.ingestions.create({
workspaceId: "ws_3a1b",
url: "https://example.com/report.pdf",
metadata: { customerId: "abc" },
schema: {
classes: [{ name: "Person", cardinality: "many" }],
properties: [{ name: "name", type: "STRING", domain: ["Person"] }],
relationships: [],
},
});
// Or upload a file directly instead of a URL:
const uploaded = await client.ingestions.create({
workspaceId: "ws_3a1b",
file: fs.createReadStream("report.pdf"),
metadata: { customerId: "abc" },
});
// Or request a presigned upload URL for a large file:
const ticket = await client.ingestions.create({
workspaceId: "ws_3a1b",
filename: "report.pdf",
mimeType: "application/pdf",
size: 12345678,
});
// Then PUT the bytes to ticket.upload.url with ticket.upload.headers{
"id": "<string>",
"url": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"processing": {
"steps": {},
"progress": {},
"current_step": "<string>",
"percent_complete": 123
},
"name": "<string>",
"filename": "<string>",
"size": 123,
"mime_type": "<string>",
"metadata": {},
"schema": {
"classes": [
{
"name": "<string>",
"definition": "<string>",
"cardinality": "many"
}
],
"relationships": [
{
"name": "<string>",
"domain": [
"<string>"
],
"range": [
"<string>"
],
"definition": "<string>"
}
],
"properties": [
{
"name": "<string>",
"type": "<string>",
"domain": [
"<string>"
],
"definition": "<string>",
"values": [
"<string>"
]
}
]
},
"upload": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"method": "PUT",
"headers": {}
}
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Ingestions
Create Ingestion
POST
/
ingestions
cURL
curl -X POST https://api.aiql.io/ingestions \
-H "Authorization: Bearer $AIQL_API_KEY" \
-H "AiQL-Workspace: $AIQL_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/report.pdf", "metadata": {"customerId": "abc"}, "schema": {"classes": [{"name": "Person", "definition": "An individual human.", "cardinality": "many"}], "properties": [{"name": "name", "type": "STRING", "definition": "The person's full name.", "domain": ["Person"]}], "relationships": []}}'
curl -X POST https://api.aiql.io/ingestions \
-H "Authorization: Bearer $AIQL_API_KEY" \
-H "AiQL-Workspace: $AIQL_WORKSPACE_ID" \
-F "metadata={"customerId": "abc"}" \
-F "schema={"classes":[{"name":"Person","cardinality":"many"}],"properties":[{"name":"name","type":"STRING","domain":["Person"]}],"relationships":[]}" \
-F "file=@report.pdf"import os
from aiql import AiQL
client = AiQL(api_key=os.environ["AIQL_API_KEY"])
ingestion = client.ingestions.create(
workspace_id="ws_3a1b",
url="https://example.com/report.pdf",
metadata={"customerId": "abc"},
schema={
"classes": [{"name": "Person", "cardinality": "many"}],
"properties": [{"name": "name", "type": "STRING", "domain": ["Person"]}],
"relationships": [],
},
)
# Or upload a file directly instead of a URL:
with open("report.pdf", "rb") as f:
ingestion = client.ingestions.create(
workspace_id="ws_3a1b",
file=f,
metadata={"customerId": "abc"},
)
# Or request a presigned upload URL for a large file:
ingestion = client.ingestions.create(
workspace_id="ws_3a1b",
filename="report.pdf",
mime_type="application/pdf",
size=12_345_678,
)
# Then PUT the bytes to ingestion.upload.url with ingestion.upload.headersimport { AiQL } from "@aiql.io/sdk";
const client = new AiQL({ apiKey: process.env.AIQL_API_KEY });
const ingestion = await client.ingestions.create({
workspaceId: "ws_3a1b",
url: "https://example.com/report.pdf",
metadata: { customerId: "abc" },
schema: {
classes: [{ name: "Person", cardinality: "many" }],
properties: [{ name: "name", type: "STRING", domain: ["Person"] }],
relationships: [],
},
});
// Or upload a file directly instead of a URL:
const uploaded = await client.ingestions.create({
workspaceId: "ws_3a1b",
file: fs.createReadStream("report.pdf"),
metadata: { customerId: "abc" },
});
// Or request a presigned upload URL for a large file:
const ticket = await client.ingestions.create({
workspaceId: "ws_3a1b",
filename: "report.pdf",
mimeType: "application/pdf",
size: 12345678,
});
// Then PUT the bytes to ticket.upload.url with ticket.upload.headers{
"id": "<string>",
"url": "<string>",
"status": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"processing": {
"steps": {},
"progress": {},
"current_step": "<string>",
"percent_complete": 123
},
"name": "<string>",
"filename": "<string>",
"size": 123,
"mime_type": "<string>",
"metadata": {},
"schema": {
"classes": [
{
"name": "<string>",
"definition": "<string>",
"cardinality": "many"
}
],
"relationships": [
{
"name": "<string>",
"domain": [
"<string>"
],
"range": [
"<string>"
],
"definition": "<string>"
}
],
"properties": [
{
"name": "<string>",
"type": "<string>",
"domain": [
"<string>"
],
"definition": "<string>",
"values": [
"<string>"
]
}
]
},
"upload": {
"url": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"method": "PUT",
"headers": {}
}
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API key passed as a Bearer token in the Authorization header.
Headers
ID of the workspace the request operates on.
Body
application/jsonmultipart/form-data
- Option 1
- Option 2
Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I