Skip to main content
POST
/
sources
Create source
curl --request POST \
  --url https://apigcp.trynia.ai/v2/sources \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "repository",
  "repository": "<string>",
  "branch": "<string>",
  "url": "<string>",
  "folder_name": "<string>",
  "folder_path": "<string>",
  "files": [
    {
      "path": "<string>",
      "content": "<string>"
    }
  ],
  "database": {
    "filename": "<string>",
    "content": "<string>"
  },
  "add_as_global_source": true,
  "url_patterns": [
    "<string>"
  ],
  "exclude_patterns": [
    "<string>"
  ],
  "limit": 123,
  "max_depth": 123,
  "wait_for": 123,
  "is_pdf": true,
  "display_name": "<string>",
  "focus_instructions": "<string>"
}
'
{
  "id": "<string>",
  "type": "repository",
  "identifier": "<string>",
  "display_name": "<string>",
  "status": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>",
  "category_id": "<string>",
  "is_global": true,
  "global_source_id": "<string>",
  "global_namespace": "<string>",
  "metadata": {}
}

Authorizations

Authorization
string
header
required

API key must be provided in the Authorization header

Body

application/json
type
enum<string>
required

Unified source type

Available options:
repository,
documentation,
research_paper,
huggingface_dataset,
local_folder
repository
string

Repository slug (owner/repo)

branch
string
url
string

Documentation or dataset URL

folder_name
string
folder_path
string
files
object[]
database
object
add_as_global_source
boolean
default:true
url_patterns
string[]
exclude_patterns
string[]
limit
integer
max_depth
integer
wait_for
integer
is_pdf
boolean
display_name
string
focus_instructions
string

Response

200 - application/json

Created

id
string
required

Source identifier

type
enum<string>
required

Unified source type

Available options:
repository,
documentation,
research_paper,
huggingface_dataset,
local_folder
identifier
string

Canonical identifier (repo slug, URL, or folder path)

display_name
string

Human-readable name

status
string

Indexing status

created_at
string

Creation timestamp (ISO)

updated_at
string

Last update timestamp (ISO)

category_id
string | null

Category assignment

is_global
boolean

Whether the source is global/shared

global_source_id
string | null

Global source ID if applicable

global_namespace
string | null

Global namespace if applicable

metadata
object

Type-specific metadata