Create a retrieval document

createRetrievalDocument(projectReference: ID!, input: CreateRetrievalDocumentInput!): RetrievalDocument!

Requires project.knowledge.write.

Arguments

ArgumentTypeRequiredDescription
projectReferenceID!YesProject UUID or slug.
inputCreateRetrievalDocumentInput!Yes

Input fields

input

CreateRetrievalDocumentInput

FieldTypeRequiredDescription
idIDNoCaller-chosen record ID. Omit to let the API choose one. An ID that already exists is a conflict. Create the record before writing its chunks; use update to change an existing record.
titleString!Yes
sourceStringNoDefaults to an empty string.
typeStringNoDefaults to an empty string.
metadataJSONObjectNo

Response

Returns RetrievalDocument!. Open the type for its fields and nested types.

FieldTypeDescription
idID!
revisionString!Opaque revision: 64 lowercase hexadecimal characters. Send it as expectedRevision.
titleString!
sourceString!
typeString!
metadataJSONObject!
createdAtDateTime!
updatedAtDateTime!

Types marked with ! cannot be null. Lists use [Type] notation. The type index lists all published input and response types.

Example

graphql
mutation CreateRetrievalDocument($projectReference: ID!, $input: CreateRetrievalDocumentInput!) {
  createRetrievalDocument(projectReference: $projectReference, input: $input) {
    id
    createdAt
    updatedAt
    metadata
    revision
  }
}
json
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "input": {
    "title": "example"
  }
}