Content Objects

The /objects endpoint allows you to manage your Content Objects.

Upload URL

Endpoint: /objects/upload-url

Method: POST

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Input Parameters

ParameterData TypeDescription
namestring(Required) The name of the file to upload.
idstringThe ID of the file to upload. If not provided, a random ID will be generated.
mime_typestringThe MIME type of the file to upload. If not provided, the MIME type will be inferred from the file extension.
ttlnumberThe time-to-live (TTL) of the upload URL in seconds. If not provided, the default TTL will be used.

Example Request

{
    "name": "my-file.pdf",
    "mime_type": "application/pdf"
}

Example Response

{
    "url": "https://storage.googleapis.com/....",
    "id": "<OBJECT_ID>",
    "mime_type": "application/pdf"
}

Code Example

Get Upload URL

curl -X POST \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/upload-url \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \\
  -H 'Content-Type: application/json' \\
  -d '{
    "name": "my-file.pdf",
    "mime_type": "application/pdf"
}'

Download URL

Endpoint: /objects/download-url

Method: POST

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Input Parameters

ParameterData TypeDescription
filestring(Required) The URI of the file to download. The URI can be retrieved from the object's content.source property.

Example Request

{
    "file": "gs://<YOUR_BUCKET>/<OBJECT_ID>"
}

Example Response

{
    "url": "https://storage.googleapis.com/....?Expires=....&Signature=...."
}

Code Example

Get Download URL

curl -X POST \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/download-url \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \\
  -H 'Content-Type: application/json' \\
  -d '{
    "file": "gs://<YOUR_BUCKET>/<OBJECT_ID>"
}'

Create

Endpoint: /objects

Method: POST

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Input Parameters

ParameterData TypeDescription
idstringAn optional existing object ID to be replaced by the new one.
namestring(Required) The name of the object.
descriptionstringA description of the object.
tagsstring[]A list of tags to associate with the object.
typestringThe ID of the object type.
contentContentSourceThe content source URL and type.
external_idstringAn external ID to associate with the object.
propertiesRecord<string, any>A JSON object that describes the object.
metadataVideoMetadata | AudioMetadata | ImageMetadata | DocumentMetadataMetadata about the object.
tokens{ count: number; encoding: string; etag: string; }The number of tokens in the text.
runstringThe ID of the interaction run that created the object.

Example Request

{
    "name": "My File",
    "description": "This is my file.",
    "type": "<OBJECT_TYPE_ID>",
    "content": {
        "source": "gs://<YOUR_BUCKET>/<OBJECT_ID>",
        "type": "application/pdf",
        "name": "my-file.pdf"
    },
    "properties": {
        "title": "My File Title",
        "author": "John Doe"
    }
}

Example Response

{
  "id": "<OBJECT_ID>",
  "name": "My File",
  "description": "This is my file.",
  "tags": [],
  "updated_by": "user:<USER_ID>",
  "created_by": "user:<USER_ID>",
  "created_at": "2023-11-15T12:34:56.789Z",
  "updated_at": "2023-11-15T12:34:56.789Z",
  "root": "<OBJECT_ID>",
  "parent": "<OBJECT_ID>",
  "location": "/",
  "status": "created",
  "type": {
    "id": "<OBJECT_TYPE_ID>",
    "name": "Document"
  },
  "content": {
    "source": "gs://<YOUR_BUCKET>/<OBJECT_ID>",
    "type": "application/pdf",
    "name": "my-file.pdf"
  },
  "external_id": null,
  "properties": {
    "title": "My File Title",
    "author": "John Doe"
  },
  "metadata": {
    "type": "document"
  },
  "tokens": null,
  "run": null
}

Code Example

Create Object

curl -X POST \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \\
  -H 'Content-Type: application/json' \\
  -d '{
    "name": "My File",
    "description": "This is my file.",
    "type": "<OBJECT_TYPE_ID>",
    "content": {
        "source": "gs://<YOUR_BUCKET>/<OBJECT_ID>",
        "type": "application/pdf",
        "name": "my-file.pdf"
    },
    "properties": {
        "title": "My File Title",
        "author": "John Doe"
    }
}'

Retrieve

Endpoint: /objects/:objectId

Method: GET

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
objectId(Required) The ID of the object to retrieve.

Query Parameters

ParameterDescription
selectA string of space separated field names. Prefix a field name with "-" to exclude it from the result.

Example Request

curl -X GET \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID> \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Example Response

{
  "id": "<OBJECT_ID>",
  "name": "My File",
  "description": "This is my file.",
  "tags": [],
  "updated_by": "user:<USER_ID>",
  "created_by": "user:<USER_ID>",
  "created_at": "2023-11-15T12:34:56.789Z",
  "updated_at": "2023-11-15T12:34:56.789Z",
  "root": "<OBJECT_ID>",
  "parent": "<OBJECT_ID>",
  "location": "/",
  "status": "created",
  "type": {
    "id": "<OBJECT_TYPE_ID>",
    "name": "Document"
  },
  "content": {
    "source": "gs://<YOUR_BUCKET>/<OBJECT_ID>",
    "type": "application/pdf",
    "name": "my-file.pdf"
  },
  "external_id": null,
  "properties": {
    "title": "My File Title",
    "author": "John Doe"
  },
  "metadata": {
    "type": "document"
  },
  "tokens": null,
  "run": null
}

Code Example

Retrieve Object

curl -X GET \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID> \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Update

Endpoint: /objects/:objectId

Method: PUT

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
objectId(Required) The ID of the object to update.

Input Parameters

ParameterData TypeDescription
namestringThe name of the object.
descriptionstringA description of the object.
tagsstring[]A list of tags to associate with the object.
typestringThe ID of the object type.
contentContentSourceThe content source URL and type.
external_idstringAn external ID to associate with the object.
propertiesRecord<string, any>A JSON object that describes the object.
metadataVideoMetadata | AudioMetadata | ImageMetadata | DocumentMetadataMetadata about the object.
tokens{ count: number; encoding: string; etag: string; }The number of tokens in the text.
runstringThe ID of the interaction run that created the object.

Example Request

{
    "name": "My Updated File",
    "description": "This is my updated file.",
    "properties": {
        "title": "My Updated File Title",
        "author": "Jane Doe"
    }
}

Example Response

{
  "id": "<OBJECT_ID>",
  "name": "My Updated File",
  "description": "This is my updated file.",
  "tags": [],
  "updated_by": "user:<USER_ID>",
  "created_by": "user:<USER_ID>",
  "created_at": "2023-11-15T12:34:56.789Z",
  "updated_at": "2023-11-15T12:34:56.789Z",
  "root": "<OBJECT_ID>",
  "parent": "<OBJECT_ID>",
  "location": "/",
  "status": "created",
  "type": {
    "id": "<OBJECT_TYPE_ID>",
    "name": "Document"
  },
  "content": {
    "source": "gs://<YOUR_BUCKET>/<OBJECT_ID>",
    "type": "application/pdf",
    "name": "my-file.pdf"
  },
  "external_id": null,
  "properties": {
    "title": "My Updated File Title",
    "author": "Jane Doe"
  },
  "metadata": {
    "type": "document"
  },
  "tokens": null,
  "run": null
}

Code Example

Update Object

curl -X PUT \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID> \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \\
  -H 'Content-Type: application/json' \\
  -d '{
    "name": "My Updated File",
    "description": "This is my updated file.",
    "properties": {
        "title": "My Updated File Title",
        "author": "Jane Doe"
    }
}'

Delete

Endpoint: /objects/:objectId

Method: DELETE

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
objectId(Required) The ID of the object to delete.

Example Request

curl -X DELETE \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID> \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Example Response

{
    "id": "<OBJECT_ID>"
}

Code Example

Delete Object

curl -X DELETE \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID> \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

List

Endpoint: /objects

Method: GET

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Query Parameters

ParameterData TypeDescription
locationstringThe path of the parent object.
statusstringThe status of the object.
typestringThe ID of the object type.
parentstringThe ID of the parent object.
similarTostringThe ID of an object to find similar objects.
embeddingTypeSupportedEmbeddingTypesThe type of embedding to use for similarity search.
namestringThe name of the object.
limitnumberThe maximum number of objects to return.
offsetnumberThe number of objects to skip.

Example Request

curl -X GET \\
  'https://zeno-server-production.api.becomposable.com/api/v1/objects?limit=10&offset=0' \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Example Response

[
  {
    "id": "<OBJECT_ID>",
    "name": "My File",
    "description": "This is my file.",
    "tags": [],
    "updated_by": "user:<USER_ID>",
    "created_by": "user:<USER_ID>",
    "created_at": "2023-11-15T12:34:56.789Z",
    "updated_at": "2023-11-15T12:34:56.789Z",
    "location": "/",
    "status": "created",
    "type": {
      "id": "<OBJECT_TYPE_ID>",
      "name": "Document"
    },
    "content": {
      "source": "gs://<YOUR_BUCKET>/<OBJECT_ID>",
      "type": "application/pdf",
      "name": "my-file.pdf"
    },
    "external_id": null,
    "properties": {
      "title": "My File Title",
      "author": "John Doe"
    },
    "metadata": {
      "type": "document"
    },
    "tokens": null,
    "run": null,
    "parent": {
      "id": "<OBJECT_ID>",
      "name": "Undefined"
    },
    "score": 0
  }
]

Code Example

List Objects

curl -X GET \\
  'https://zeno-server-production.api.becomposable.com/api/v1/objects?limit=10&offset=0' \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Endpoint: /objects/search

Method: POST

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Input Parameters

ParameterData TypeDescription
queryComplexSearchQuery(Required) The search query.
limitnumberThe maximum number of objects to return.
offsetnumberThe number of objects to skip.

Example Request

{
  "query": {
    "name": "My File",
    "vector": {
      "objectId": "<OBJECT_ID>",
      "type": "text"
    }
  },
  "limit": 10,
  "offset": 0
}

Example Response

[
  {
    "id": "<OBJECT_ID>",
    "name": "My File",
    "description": "This is my file.",
    "tags": [],
    "updated_by": "user:<USER_ID>",
    "created_by": "user:<USER_ID>",
    "created_at": "2023-11-15T12:34:56.789Z",
    "updated_at": "2023-11-15T12:34:56.789Z",
    "location": "/",
    "status": "created",
    "type": {
      "id": "<OBJECT_TYPE_ID>",
      "name": "Document"
    },
    "content": {
      "source": "gs://<YOUR_BUCKET>/<OBJECT_ID>",
      "type": "application/pdf",
      "name": "my-file.pdf"
    },
    "external_id": null,
    "properties": {
      "title": "My File Title",
      "author": "John Doe"
    },
    "metadata": {
      "type": "document"
    },
    "tokens": null,
    "run": null,
    "parent": {
      "id": "<OBJECT_ID>",
      "name": "Undefined"
    },
    "score": 0.987654321
  }
]

Code Example

Search Objects

curl -X POST \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/search \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \\
  -H 'Content-Type: application/json' \\
  -d '{
  "query": {
    "name": "My File",
    "vector": {
      "objectId": "<OBJECT_ID>",
      "type": "text"
    }
  },
  "limit": 10,
  "offset": 0
}'

Find

Endpoint: /objects/find

Method: POST

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Input Parameters

ParameterData TypeDescription
queryRecord<string, any>(Required) The search query.
limitnumberThe maximum number of objects to return.
selectstringA string of space separated field names. Prefix a field name with "-" to exclude it from the result.

Example Request

{
    "query": {
        "name": "My File"
    },
    "limit": 10,
    "select": "name description"
}

Example Response

[
  {
    "id": "<OBJECT_ID>",
    "name": "My File",
    "description": "This is my file."
  }
]

Code Example

Find Objects

curl -X POST \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/find \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \\
  -H 'Content-Type: application/json' \\
  -d '{
    "query": {
        "name": "My File"
    },
    "limit": 10,
    "select": "name description"
}'

Export Properties

Endpoint: /objects/export

Method: POST

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Input Parameters

ParameterData TypeDescription
objectIdsstring[](Required) The IDs of the objects to export.
typestring(Required) The export type. Currently, only JSON and CSV are supported.
layoutstringThe ID of the type layout to use for the export.

Example Request

{
    "objectIds": [
        "<OBJECT_ID_1>",
        "<OBJECT_ID_2>"
    ],
    "type": "CSV",
    "layout": "<TYPE_LAYOUT_ID>"
}

Example Response

{
  "type": "text/csv",
  "name": "My Project_2023-11-16T12:34:56.789Z.csv",
  "data": "id,name,description\n<OBJECT_ID_1>,My File 1,This is my file 1.\n<OBJECT_ID_2>,My File 2,This is my file 2.\n"
}

Code Example

Export Properties

curl -X POST \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/export \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>' \\
  -H 'Content-Type: application/json' \\
  -d '{
    "objectIds": [
        "<OBJECT_ID_1>",
        "<OBJECT_ID_2>"
    ],
    "type": "CSV",
    "layout": "<TYPE_LAYOUT_ID>"
}'

Get Text

Endpoint: /objects/:objectId/text

Method: GET

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
objectId(Required) The ID of the object to retrieve the text from.

Example Request

curl -X GET \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID>/text \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Example Response

{
    "text": "This is the text content of the object."
}

Code Example

Get Object Text

curl -X GET \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID>/text \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Get Content Source

Endpoint: /objects/:objectId/content-source

Method: GET

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
objectId(Required) The ID of the object to retrieve the content source from.

Example Request

curl -X GET \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID>/content-source \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Example Response

{
    "source": "gs://<YOUR_BUCKET>/<OBJECT_ID>",
    "type": "application/pdf",
    "name": "my-file.pdf",
    "etag": "...."
}

Code Example

Get Content Source

curl -X GET \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID>/content-source \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Get Renditions

Endpoint: /objects/:objectId/renditions

Method: GET

Headers

HeaderValue
AuthorizationBearer <YOUR_JWT_TOKEN>

Path Parameters

ParameterDescription
objectId(Required) The ID of the object to retrieve the renditions from.

Example Request

curl -X GET \\
  https://zeno-server-production.api.becomposable.com/api/v1/objects/<OBJECT_ID>/renditions \\
  -H 'Authorization: Bearer <YOUR_JWT_TOKEN>'

Example Response

[
  {
    "id": "<OBJECT_ID>",
    "name": "my-file.png",
    "description": null,
    "tags": [],
    "updated_by": "user:<USER_ID>",
    "created_by": "

Was this page helpful?