GET
/
v4
/
knowledge-bases
/
{knowledge_base_id}
/
artifacts
/
{artifact_id}
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const artifact = await client.knowledgeBases.artifacts.retrieve('knowledge_base_id', 'artifact_id');

  console.log(artifact.artifact_id);
}

main();
{
  "artifact_id": "<string>",
  "artifact_name": "<string>",
  "artifact_uri": "<string>",
  "artifact_uri_public": "<string>",
  "status": "<string>",
  "status_reason": "<string>",
  "source": "S3",
  "chunks_status": {
    "chunks_completed": 123,
    "chunks_pending": 123,
    "chunks_failed": 123
  },
  "updated_at": "2023-11-07T05:31:56Z",
  "tags": {},
  "chunks": [
    {
      "chunk_id": "<string>",
      "upload_status": "Embedding",
      "status_reason": "<string>",
      "text": "<string>",
      "chunk_position": 123,
      "embedding": [
        123
      ],
      "metadata": {},
      "user_supplied_metadata": {}
    }
  ]
}

Authorizations

x-api-key
string
header
required

Path Parameters

knowledge_base_id
string
required
artifact_id
string
required

Query Parameters

status_filter
string | null

Response

200
application/json
Successful Response
artifact_id
string
required

Unique identifier for the artifact.

artifact_name
string
required

Friendly name for the artifact.

artifact_uri
string
required

Location (e.g. URI) of the artifact in the data source.

status
string
required

Status of the artifact.

source
enum<string>
required

Data source of the artifact.

Available options:
S3,
Confluence,
SharePoint,
GoogleDrive,
AzureBlobStorage,
Slack,
LocalFile,
LocalChunks
chunks_status
object
required

Number of chunks pending, completed, and failed.

tags
object
required

Tags associated with the artifact.

chunks
object[]
required

List of chunks associated with the artifact.

artifact_uri_public
string

Public Location (e.g. URI) of the artifact in the data source.

status_reason
string

Reason for the artifact's status.

updated_at
string

Timestamp at which the artifact was last updated.