Organizations
Organization management
Check organization slug availability
/organizations/check-slugCheck if an organization slug is available and get suggestions if not
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
slug | string | query | Yes | The slug to check |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/organizations/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 organizations
/organizationsList organizations where user is a member
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
offset | integer | query | No | Number of items to skip |
limit | integer | query | No | Maximum number of items to return |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/organizations?offset=value&limit=value" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Acme Corp",
"slug": "acme-corp",
"owner_id": "550e8400-e29b-41d4-a716-446655440000",
"billing_email": "billing@acme.com",
"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 organization
/organizationsCreate new organization (user becomes owner)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Request Body
Example:
{
"name": "string",
"slug": "string",
"billing_email": "user@example.com",
"settings": {}
}
Code Examples
curl -X POST "https://searchaf.antfly.io/api/v1/organizations" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"name": "string",
"slug": "string",
"billing_email": "user@example.com",
"settings": {}
}'Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Acme Corp",
"slug": "acme-corp",
"owner_id": "550e8400-e29b-41d4-a716-446655440000",
"billing_email": "billing@acme.com",
"status": "active",
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z",
"settings": {}
}Get organization
/organizations/{org_id}Get organization details
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/organizations/{org_id}" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Acme Corp",
"slug": "acme-corp",
"owner_id": "550e8400-e29b-41d4-a716-446655440000",
"billing_email": "billing@acme.com",
"status": "active",
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z",
"settings": {}
}Update organization
/organizations/{org_id}Update organization (requires admin+ role)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Request Body
Example:
{
"name": "string",
"billing_email": "user@example.com",
"settings": {}
}
Code Examples
curl -X PATCH "https://searchaf.antfly.io/api/v1/organizations/{org_id}" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"name": "string",
"billing_email": "user@example.com",
"settings": {}
}'Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Acme Corp",
"slug": "acme-corp",
"owner_id": "550e8400-e29b-41d4-a716-446655440000",
"billing_email": "billing@acme.com",
"status": "active",
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z",
"settings": {}
}Delete organization
/organizations/{org_id}Delete organization (requires owner role, cascades to projects)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Code Examples
curl -X DELETE "https://searchaf.antfly.io/api/v1/organizations/{org_id}" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
List organization members
/organizations/{org_id}/membersList all members of organization
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
offset | integer | query | No | Number of items to skip |
limit | integer | query | No | Maximum number of items to return |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/organizations/{org_id}/members?offset=value&limit=value" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"role": "owner",
"invited_by": "550e8400-e29b-41d4-a716-446655440000",
"invited_at": "2025-10-02T15:30:00Z",
"joined_at": "2025-10-02T15:30:00Z",
"status": "invited",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"display_name": "John Doe",
"avatar_url": "https://example.com/avatar.jpg",
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z",
"last_login_at": "2025-10-02T15:30:00Z",
"status": "active",
"settings": {}
}
}
],
"meta": {
"offset": 0,
"limit": 1,
"total": 0
}
}Invite member
/organizations/{org_id}/membersInvite user to organization (requires admin+ role)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Request Body
Example:
{
"email": "user@example.com",
"role": "owner"
}
Code Examples
curl -X POST "https://searchaf.antfly.io/api/v1/organizations/{org_id}/members" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"email": "user@example.com",
"role": "owner"
}'Responses
{
"invitation_id": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"role": "owner",
"expires_at": "2025-10-02T15:30:00Z",
"status": "invited",
"token": "string"
}Update member role
/organizations/{org_id}/members/{member_id}Update organization member role (requires admin+ role, cannot change owner)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
member_id | string | path | Yes | Member ID |
Request Body
Example:
{
"role": "admin"
}
Code Examples
curl -X PATCH "https://searchaf.antfly.io/api/v1/organizations/{org_id}/members/{member_id}" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"role": "admin"
}'Responses
{
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"role": "string",
"updated_at": "2025-10-02T15:30:00Z"
}Remove member
/organizations/{org_id}/members/{member_id}Remove user from organization (requires admin+ role)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
member_id | string | path | Yes | Member ID |
Code Examples
curl -X DELETE "https://searchaf.antfly.io/api/v1/organizations/{org_id}/members/{member_id}" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
Transfer organization ownership
/organizations/{org_id}/transfer-ownershipTransfer organization ownership to another admin (requires owner role + password confirmation or OAuth re-authentication)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Request Body
Example:
{
"new_owner_id": "550e8400-e29b-41d4-a716-446655440000",
"password": "string",
"reauth_verified": true
}
Code Examples
curl -X POST "https://searchaf.antfly.io/api/v1/organizations/{org_id}/transfer-ownership" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"new_owner_id": "550e8400-e29b-41d4-a716-446655440000",
"password": "string",
"reauth_verified": true
}'Responses
{
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"old_owner_id": "550e8400-e29b-41d4-a716-446655440000",
"new_owner_id": "550e8400-e29b-41d4-a716-446655440000",
"transferred_at": "2025-10-02T15:30:00Z"
}Get invitation details
/invitations/{token}Retrieve invitation details by token (public endpoint)
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
token | string | path | Yes | Invitation token |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/invitations/{token}" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"invitation_id": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"organization_name": "string",
"project_id": "550e8400-e29b-41d4-a716-446655440000",
"project_name": "string",
"role": "string",
"expires_at": "2025-10-02T15:30:00Z"
}Revoke invitation
/invitations/{token}Revoke an invitation token (requires authentication - only inviter or org admin/owner can revoke)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
token | string | path | Yes | Invitation token |
Code Examples
curl -X DELETE "https://searchaf.antfly.io/api/v1/invitations/{token}" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
Accept invitation
/invitations/{token}/acceptAccept an invitation token and create membership (requires authenticated user)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
token | string | path | Yes | Invitation token |
Code Examples
curl -X POST "https://searchaf.antfly.io/api/v1/invitations/{token}/accept" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"project_id": "550e8400-e29b-41d4-a716-446655440000",
"role": "string",
"joined_at": "2025-10-02T15:30:00Z"
}Resend invitation
/invitations/{token}/resendResend invitation email with a new token (requires authentication - only inviter or org admin/owner can resend)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
token | string | path | Yes | Original invitation token |
Code Examples
curl -X POST "https://searchaf.antfly.io/api/v1/invitations/{token}/resend" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"message": "Invitation email resent successfully",
"new_token": "string",
"expires_at": "2025-10-02T15:30:00Z"
}Sign up and accept invitation
/invitations/{token}/signup-and-acceptCreate new account and accept invitation in one step (skips email verification by trusting invitation token)
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
token | string | path | Yes | Invitation token |
Request Body
Example:
{
"display_name": "string",
"password": "string"
}
Code Examples
curl -X POST "https://searchaf.antfly.io/api/v1/invitations/{token}/signup-and-accept" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"display_name": "string",
"password": "string"
}'Responses
{
"access_token": "string",
"refresh_token": "string",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "user@example.com",
"display_name": "John Doe",
"avatar_url": "https://example.com/avatar.jpg",
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z",
"last_login_at": "2025-10-02T15:30:00Z",
"status": "active",
"settings": {}
},
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"project_id": "550e8400-e29b-41d4-a716-446655440000"
}List organization provider configurations
/organizations/{org_id}/providersList all AI provider configurations for an organization
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/organizations/{org_id}/providers" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"provider": "gemini",
"enabled": true,
"has_api_key": true,
"config": {},
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z"
}
]
}Create organization provider configuration
/organizations/{org_id}/providersConfigure an AI provider for the organization (requires owner or admin role)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
Request Body
Example:
{
"provider": "gemini",
"api_key": "AIzaSy...",
"config": {},
"enabled": true
}
Code Examples
curl -X POST "https://searchaf.antfly.io/api/v1/organizations/{org_id}/providers" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"provider": "gemini",
"api_key": "AIzaSy...",
"config": {},
"enabled": true
}'Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"provider": "gemini",
"enabled": true,
"has_api_key": true,
"config": {},
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z"
}Get organization provider configuration
/organizations/{org_id}/providers/{provider}Get a specific AI provider configuration for an organization
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
provider | string (gemini, openai, anthropic) | path | Yes | AI provider type (gemini, openai, anthropic, vertex, bedrock) |
Code Examples
curl -X GET "https://searchaf.antfly.io/api/v1/organizations/{org_id}/providers/{provider}" \\
-H "Authorization: Bearer YOUR_API_KEY"Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"provider": "gemini",
"enabled": true,
"has_api_key": true,
"config": {},
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z"
}Update organization provider configuration
/organizations/{org_id}/providers/{provider}Update an AI provider configuration (requires owner or admin role)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
provider | string (gemini, openai, anthropic) | path | Yes | AI provider type (gemini, openai, anthropic, vertex, bedrock) |
Request Body
Example:
{
"api_key": "string",
"config": {},
"enabled": true
}
Code Examples
curl -X PATCH "https://searchaf.antfly.io/api/v1/organizations/{org_id}/providers/{provider}" \\
-H "Authorization: Bearer YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"api_key": "string",
"config": {},
"enabled": true
}'Responses
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "550e8400-e29b-41d4-a716-446655440000",
"provider": "gemini",
"enabled": true,
"has_api_key": true,
"config": {},
"created_at": "2025-10-02T15:30:00Z",
"updated_at": "2025-10-02T15:30:00Z"
}Delete organization provider configuration
/organizations/{org_id}/providers/{provider}Remove an AI provider configuration (requires owner or admin role)
Security
Provide your bearer token in the Authorization header when making requests to protected resources.
Example: Authorization: Bearer YOUR_API_KEY
Parameters
| Name | Type | Location | Required | Description |
|---|---|---|---|---|
org_id | string | path | Yes | Organization ID |
provider | string (gemini, openai, anthropic) | path | Yes | AI provider type (gemini, openai, anthropic, vertex, bedrock) |
Code Examples
curl -X DELETE "https://searchaf.antfly.io/api/v1/organizations/{org_id}/providers/{provider}" \\
-H "Authorization: Bearer YOUR_API_KEY"