Projects#

Project management

Check project slug availability#

GET/organizations/{org_id}/projects/check-slug

Check if a project slug is available within an organization and get suggestions if not

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID
slugstringqueryYesThe slug to check

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/organizations/{org_id}/projects/check-slug?slug=value" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "available": false,
  "slug": "my-company",
  "suggestions": [
    "my-company-2",
    "my-company-inc",
    "my-company-io"
  ],
  "error": "Slug must match pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$"
}

List projects#

GET/organizations/{org_id}/projects

List projects in organization

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID
offsetintegerqueryNoNumber of items to skip
limitintegerqueryNoMaximum number of items to return

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/organizations/{org_id}/projects?offset=value&limit=value" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "organization_id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "My Store",
      "slug": "my-store",
      "description": "E-commerce store for outdoor gear",
      "project_type": "woocommerce",
      "antfly_cluster_id": "string",
      "integration_config": {},
      "tables": [
        {
          "id": "550e8400-e29b-41d4-a716-446655440000",
          "project_id": "550e8400-e29b-41d4-a716-446655440000",
          "slug": "products",
          "is_default": true,
          "created_at": "2025-10-02T15:30:00Z",
          "updated_at": "2025-10-02T15:30:00Z"
        }
      ],
      "status": "active",
      "created_at": "2025-10-02T15:30:00Z",
      "updated_at": "2025-10-02T15:30:00Z",
      "settings": {}
    }
  ],
  "meta": {
    "offset": 0,
    "limit": 1,
    "total": 0
  }
}

Create project#

POST/organizations/{org_id}/projects

Create new project in organization

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID

Request Body#

Example:

{
    "name": "string",
    "slug": "string",
    "project_type": "woocommerce",
    "integration_config": {},
    "settings": {}
}

Code Examples#

curl -X POST "https://searchaf.antfly.io/api/v1/organizations/{org_id}/projects" \\
    -H "Authorization: Bearer YOUR_API_KEY" \\
    -H "Content-Type: application/json" \\
    -d '{
    "name": "string",
    "slug": "string",
    "project_type": "woocommerce",
    "integration_config": {},
    "settings": {}
}'

Responses#

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "My Store",
  "slug": "my-store",
  "description": "E-commerce store for outdoor gear",
  "project_type": "woocommerce",
  "antfly_cluster_id": "string",
  "integration_config": {},
  "tables": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "slug": "products",
      "is_default": true,
      "created_at": "2025-10-02T15:30:00Z",
      "updated_at": "2025-10-02T15:30:00Z"
    }
  ],
  "status": "active",
  "created_at": "2025-10-02T15:30:00Z",
  "updated_at": "2025-10-02T15:30:00Z",
  "settings": {}
}

Get project#

GET/projects/{project_id}

Get project details

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/projects/{project_id}" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "My Store",
  "slug": "my-store",
  "description": "E-commerce store for outdoor gear",
  "project_type": "woocommerce",
  "antfly_cluster_id": "string",
  "integration_config": {},
  "tables": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "slug": "products",
      "is_default": true,
      "created_at": "2025-10-02T15:30:00Z",
      "updated_at": "2025-10-02T15:30:00Z"
    }
  ],
  "status": "active",
  "created_at": "2025-10-02T15:30:00Z",
  "updated_at": "2025-10-02T15:30:00Z",
  "settings": {}
}

Update project#

PATCH/projects/{project_id}

Update project (requires developer+ role)

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID

Request Body#

Example:

{
    "name": "string",
    "integration_config": {},
    "settings": {}
}

Code Examples#

curl -X PATCH "https://searchaf.antfly.io/api/v1/projects/{project_id}" \\
    -H "Authorization: Bearer YOUR_API_KEY" \\
    -H "Content-Type: application/json" \\
    -d '{
    "name": "string",
    "integration_config": {},
    "settings": {}
}'

Responses#

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "name": "My Store",
  "slug": "my-store",
  "description": "E-commerce store for outdoor gear",
  "project_type": "woocommerce",
  "antfly_cluster_id": "string",
  "integration_config": {},
  "tables": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "slug": "products",
      "is_default": true,
      "created_at": "2025-10-02T15:30:00Z",
      "updated_at": "2025-10-02T15:30:00Z"
    }
  ],
  "status": "active",
  "created_at": "2025-10-02T15:30:00Z",
  "updated_at": "2025-10-02T15:30:00Z",
  "settings": {}
}

Delete project#

DELETE/projects/{project_id}

Delete project (requires project_admin role)

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID

Code Examples#

curl -X DELETE "https://searchaf.antfly.io/api/v1/projects/{project_id}" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

No response body

List all tables for a project#

GET/projects/{project_id}/tables

List all AntflyDB tables associated with a project

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/projects/{project_id}/tables" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "project_id": "550e8400-e29b-41d4-a716-446655440000",
      "slug": "products",
      "is_default": true,
      "created_at": "2025-10-02T15:30:00Z",
      "updated_at": "2025-10-02T15:30:00Z"
    }
  ]
}

Create a new table for a project#

POST/projects/{project_id}/tables

Create a new AntflyDB table for a project (requires developer+ role)

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID

Request Body#

Example:

{
    "slug": "products",
    "is_default": true
}

Code Examples#

curl -X POST "https://searchaf.antfly.io/api/v1/projects/{project_id}/tables" \\
    -H "Authorization: Bearer YOUR_API_KEY" \\
    -H "Content-Type: application/json" \\
    -d '{
    "slug": "products",
    "is_default": true
}'

Responses#

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "slug": "products",
  "is_default": true,
  "created_at": "2025-10-02T15:30:00Z",
  "updated_at": "2025-10-02T15:30:00Z"
}

Get a specific table#

GET/projects/{project_id}/tables/{table_id}

Get details of a specific project table

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID
table_idstringpathYesTable ID

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/projects/{project_id}/tables/{table_id}" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "slug": "products",
  "is_default": true,
  "created_at": "2025-10-02T15:30:00Z",
  "updated_at": "2025-10-02T15:30:00Z"
}

Update a table#

PUT/projects/{project_id}/tables/{table_id}

Update a project table (requires developer+ role)

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID
table_idstringpathYesTable ID

Request Body#

Example:

{
    "slug": "string",
    "is_default": true
}

Code Examples#

curl -X PUT "https://searchaf.antfly.io/api/v1/projects/{project_id}/tables/{table_id}" \\
    -H "Authorization: Bearer YOUR_API_KEY" \\
    -H "Content-Type: application/json" \\
    -d '{
    "slug": "string",
    "is_default": true
}'

Responses#

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "slug": "products",
  "is_default": true,
  "created_at": "2025-10-02T15:30:00Z",
  "updated_at": "2025-10-02T15:30:00Z"
}

Delete a table#

DELETE/projects/{project_id}/tables/{table_id}

Delete a project table (requires project_admin role)

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID
table_idstringpathYesTable ID

Code Examples#

curl -X DELETE "https://searchaf.antfly.io/api/v1/projects/{project_id}/tables/{table_id}" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

No response body

Get project statistics#

GET/projects/{project_id}/stats

Get statistics for a project including indexed item counts across all tables and integration-specific metadata

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/projects/{project_id}/stats" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "project_id": "550e8400-e29b-41d4-a716-446655440000",
  "total_indexed_items": 15234,
  "tables": [
    {
      "table_id": "550e8400-e29b-41d4-a716-446655440000",
      "slug": "products",
      "indexed_items": 15234,
      "is_default": true
    }
  ],
  "integration_metadata": {
    "shopify": {
      "shop_name": "Acme Store",
      "shop_domain": "acme-store.myshopify.com",
      "last_sync_completed_at": "2025-10-02T15:30:00Z",
      "last_sync_status": "pending",
      "sync_in_progress": false
    },
    "docsaf": {
      "repo_url": "https://github.com/antflydb/colony",
      "default_branch": "main",
      "docs_path": "docs",
      "website_url": "https://docs.example.com",
      "include_patterns": [
        "string"
      ],
      "exclude_patterns": [
        "string"
      ],
      "last_sync_completed_at": "2025-10-02T15:30:00Z",
      "last_sync_status": "pending",
      "sync_in_progress": false
    }
  }
}

Get feedback analytics#

GET/projects/{project_id}/feedback/analytics

Retrieve analytics for answer feedback submitted for this project. Includes total queries, thumbs up/down counts, rates, and popular queries.

Security#

Provide your bearer token in the Authorization header when making requests to protected resources.

Example: Authorization: Bearer YOUR_API_KEY

Parameters#

NameTypeLocationRequiredDescription
project_idstringpathYesProject ID
daysintegerqueryNoNumber of days to look back (default 30)
limitintegerqueryNoMaximum number of popular queries to return (default 10)

Code Examples#

curl -X GET "https://searchaf.antfly.io/api/v1/projects/{project_id}/feedback/analytics?days=30&limit=10" \\
    -H "Authorization: Bearer YOUR_API_KEY"

Responses#

{
  "total_queries": 1247,
  "thumbs_up": 892,
  "thumbs_down": 123,
  "no_feedback": 232,
  "positive_rate": 71.5,
  "negative_rate": 9.9,
  "popular_queries": [
    {
      "query": "What are your best headphones?",
      "count": 145,
      "avg_rating": 0.85,
      "thumbs_up": 120,
      "thumbs_down": 25
    }
  ]
}