Organizations#

Organization management

Check organization slug availability#

GET/organizations/check-slug

Check if an organization slug is available and get suggestions if not

Parameters#

NameTypeLocationRequiredDescription
slugstringqueryYesThe slug to check

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/organizations/check-slug?slug=string" \
-H "Authorization: Bearer YOUR_TOKEN"

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#

GET/organizations

List organizations where user is a member

Parameters#

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

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/organizations?offset=0&limit=20" \
-H "Authorization: Bearer YOUR_TOKEN"

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#

POST/organizations

Create new organization (user becomes owner)

Request Body#

{
  "name": "string",
  "slug": "string",
  "billing_email": "user@example.com",
  "settings": {}
}

Code Examples#

curl -X POST "https://platform.antfly.io/api/v1/organizations" \
-H "Authorization: Bearer YOUR_TOKEN" \
-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#

GET/organizations/{org_id}

Get organization details

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN"

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#

PATCH/organizations/{org_id}

Update organization (requires admin+ role)

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID

Request Body#

{
  "name": "string",
  "billing_email": "user@example.com",
  "settings": {}
}

Code Examples#

curl -X PATCH "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN" \
-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#

DELETE/organizations/{org_id}

Delete organization (requires owner role)

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID

Code Examples#

curl -X DELETE "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

No response body

List organization members#

GET/organizations/{org_id}/members

List all members of organization

Parameters#

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

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/members?offset=0&limit=20" \
-H "Authorization: Bearer YOUR_TOKEN"

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",
      "metadata": {},
      "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#

POST/organizations/{org_id}/members

Invite user to organization (requires admin+ role)

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID

Request Body#

{
  "email": "user@example.com",
  "role": "owner"
}

Code Examples#

curl -X POST "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/members" \
-H "Authorization: Bearer YOUR_TOKEN" \
-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#

PATCH/organizations/{org_id}/members/{member_id}

Update organization member role (requires admin+ role, cannot change owner)

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID
member_idstringpathYesMember ID

Request Body#

{
  "role": "admin"
}

Code Examples#

curl -X PATCH "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/members/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN" \
-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#

DELETE/organizations/{org_id}/members/{member_id}

Remove user from organization (requires admin+ role)

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID
member_idstringpathYesMember ID

Code Examples#

curl -X DELETE "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/members/550e8400-e29b-41d4-a716-446655440000" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

No response body

Update member metadata#

PATCH/organizations/{org_id}/members/{member_id}/metadata

Replace organization-scoped metadata for a member's role context.

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID
member_idstringpathYesMember ID

Request Body#

{
  "metadata": {}
}

Code Examples#

curl -X PATCH "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/members/550e8400-e29b-41d4-a716-446655440000/metadata" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"metadata": {}
}'

Responses#

{
  "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",
  "metadata": {},
  "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": {}
  }
}

Transfer organization ownership#

POST/organizations/{org_id}/transfer-ownership

Transfer organization ownership to another admin (requires owner role + password confirmation or OAuth re-authentication)

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID

Request Body#

{
  "new_owner_id": "550e8400-e29b-41d4-a716-446655440000",
  "password": "string",
  "reauth_verified": true
}

Code Examples#

curl -X POST "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/transfer-ownership" \
-H "Authorization: Bearer YOUR_TOKEN" \
-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 organization MFA policy#

GET/organizations/{org_id}/mfa-policy

Get the persisted organization MFA enforcement policy. The extensible organization settings object cannot override this policy.

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/mfa-policy" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

{
  "require_two_factor": true
}

Enable organization MFA policy#

PATCH/organizations/{org_id}/mfa-policy

Enables MFA enforcement for a legacy organization. Public API callers cannot disable an active policy.

Parameters#

NameTypeLocationRequiredDescription
org_idstringpathYesOrganization ID

Request Body#

{
  "require_two_factor": true
}

Code Examples#

curl -X PATCH "https://platform.antfly.io/api/v1/organizations/550e8400-e29b-41d4-a716-446655440000/mfa-policy" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"require_two_factor": true
}'

Responses#

{
  "require_two_factor": true
}

Get invitation details#

GET/invitations/{token}

Retrieve invitation details by token (public endpoint)

Parameters#

NameTypeLocationRequiredDescription
tokenstringpathYesInvitation token

Code Examples#

curl -X GET "https://platform.antfly.io/api/v1/invitations/string" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

{
  "invitation_id": "550e8400-e29b-41d4-a716-446655440000",
  "email": "user@example.com",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_name": "string",
  "role": "string",
  "expires_at": "2025-10-02T15:30:00Z"
}

Revoke invitation#

DELETE/invitations/{token}

Revoke an invitation token (requires authentication - only inviter or org admin/owner can revoke)

Parameters#

NameTypeLocationRequiredDescription
tokenstringpathYesInvitation token

Code Examples#

curl -X DELETE "https://platform.antfly.io/api/v1/invitations/string" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

No response body

Accept invitation#

POST/invitations/{token}/accept

Accept an invitation token and create membership (requires authenticated user)

Parameters#

NameTypeLocationRequiredDescription
tokenstringpathYesInvitation token

Code Examples#

curl -X POST "https://platform.antfly.io/api/v1/invitations/string/accept" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

{
  "user_id": "550e8400-e29b-41d4-a716-446655440000",
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "role": "string",
  "joined_at": "2025-10-02T15:30:00Z"
}

Resend invitation#

POST/invitations/{token}/resend

Resend invitation email with a new token (requires authentication - only inviter or org admin/owner can resend)

Parameters#

NameTypeLocationRequiredDescription
tokenstringpathYesOriginal invitation token

Code Examples#

curl -X POST "https://platform.antfly.io/api/v1/invitations/string/resend" \
-H "Authorization: Bearer YOUR_TOKEN"

Responses#

{
  "message": "Invitation email resent successfully",
  "new_token": "string",
  "expires_at": "2025-10-02T15:30:00Z"
}