{
  "opencollection": "1.0.0",
  "info": {
    "name": "AFM Access Profiles Organizations API",
    "version": "0.1.0"
  },
  "items": [
    {
      "info": {
        "name": "Organizations",
        "type": "folder"
      },
      "items": [
        {
          "info": {
            "name": "Get User Organizations",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/orgs",
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get organizations where current user has user_in_org records in Workspace format"
        },
        {
          "info": {
            "name": "Create Organization",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/app/v1/orgs",
            "body": {
              "type": "multipart-form",
              "data": []
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Create a new organization with full workspace setup"
        },
        {
          "info": {
            "name": "Update Organization",
            "type": "http"
          },
          "http": {
            "method": "PUT",
            "url": "{{baseUrl}}/app/v1/orgs",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update an organization. If organization_id is provided, update that organization. Otherwise update current user's active organization."
        },
        {
          "info": {
            "name": "Get Organizations With Profiles",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/orgs/profiles",
            "params": [
              {
                "name": "page",
                "value": "",
                "type": "query",
                "description": "Page number"
              },
              {
                "name": "page_size",
                "value": "",
                "type": "query",
                "description": "Number of items per page"
              },
              {
                "name": "search",
                "value": "",
                "type": "query",
                "description": "Search by organization name"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get all organizations with their rate limit and access profiles (admin only)"
        },
        {
          "info": {
            "name": "Get Organization Users",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/orgs/:org_id/users",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get users in a specific organization"
        },
        {
          "info": {
            "name": "Change Users Organization",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/app/v1/orgs/:org_id/users",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Change users' organization. Only admin and owner can perform this operation."
        },
        {
          "info": {
            "name": "Get Related Users",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/related-users",
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get all users from organizations where current user is owner, excluding current user"
        },
        {
          "info": {
            "name": "Get Organization By Id",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/orgs/:org_id",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get a single organization by ID"
        },
        {
          "info": {
            "name": "Delete Organization",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/app/v1/orgs/:org_id",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Delete an organization by ID. Only the owner can delete their organization."
        },
        {
          "info": {
            "name": "Change Organization Status",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/app/v1/orgs/:org_id/status",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "path",
                "description": "Organization ID"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Change organization status. Only owner can change status."
        },
        {
          "info": {
            "name": "Switch User Current Org",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/app/v1/switch-current-org",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Switch user's active profile to a different organization"
        },
        {
          "info": {
            "name": "Update Organization Status",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/app/v1/orgs/status",
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update an organization's status, requires owner privileges"
        },
        {
          "info": {
            "name": "Get Organization Invitations",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/invitations",
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get invitations for current user's active organization"
        },
        {
          "info": {
            "name": "Remove Invitation",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/app/v1/invitations/:invitation_id",
            "params": [
              {
                "name": "invitation_id",
                "value": "",
                "type": "path",
                "description": "Invitation ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Remove an invitation (cancel it)"
        },
        {
          "info": {
            "name": "Update Invitation Status",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/app/v1/invitations/:invitation_id/status",
            "params": [
              {
                "name": "invitation_id",
                "value": "",
                "type": "path",
                "description": "Invitation ID"
              }
            ],
            "body": {
              "type": "form-urlencoded",
              "data": []
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update invitation status"
        },
        {
          "info": {
            "name": "Update User Role",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/app/v1/users/:user_id/role",
            "params": [
              {
                "name": "user_id",
                "value": "",
                "type": "path",
                "description": "User ID"
              }
            ],
            "body": {
              "type": "form-urlencoded",
              "data": []
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update user role in organization"
        },
        {
          "info": {
            "name": "Remove User From Organization",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/app/v1/users/:user_id",
            "params": [
              {
                "name": "user_id",
                "value": "",
                "type": "path",
                "description": "User ID"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Remove user from organization"
        },
        {
          "info": {
            "name": "Remove Myself From Organization",
            "type": "http"
          },
          "http": {
            "method": "DELETE",
            "url": "{{baseUrl}}/app/v1/remove_my_self_from_org/:org_id",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "path",
                "description": "Organization ID to remove myself from"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Remove myself from specific organization"
        },
        {
          "info": {
            "name": "Update User Status",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/app/v1/users/:user_id/status",
            "params": [
              {
                "name": "user_id",
                "value": "",
                "type": "path",
                "description": "User ID"
              }
            ],
            "body": {
              "type": "form-urlencoded",
              "data": []
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update user status in organization"
        },
        {
          "info": {
            "name": "Add Members",
            "type": "http"
          },
          "http": {
            "method": "POST",
            "url": "{{baseUrl}}/app/v1/members/add",
            "body": {
              "type": "form-urlencoded",
              "data": []
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Add members to organization by sending invitations"
        },
        {
          "info": {
            "name": "Get Members Heartbeats",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/heartbeats",
            "params": [
              {
                "name": "from_date",
                "value": "",
                "type": "query",
                "description": "Start date for heartbeats filter"
              },
              {
                "name": "to_date",
                "value": "",
                "type": "query",
                "description": "End date for heartbeats filter"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "Number of heartbeats to return"
              },
              {
                "name": "offset",
                "value": "",
                "type": "query",
                "description": "Number of heartbeats to skip"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get all heartbeats from members of the current user's organization.\nOnly accessible by users with 'admin' or 'owner' role."
        },
        {
          "info": {
            "name": "Get Member Logs",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/member-logs",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "query",
                "description": "Organization ID (optional, defaults to active organization)"
              },
              {
                "name": "from_date",
                "value": "",
                "type": "query",
                "description": "Start date for logs filter"
              },
              {
                "name": "to_date",
                "value": "",
                "type": "query",
                "description": "End date for logs filter"
              },
              {
                "name": "limit",
                "value": "",
                "type": "query",
                "description": "Number of logs to return"
              },
              {
                "name": "offset",
                "value": "",
                "type": "query",
                "description": "Number of logs to skip"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get combined member logs (heartbeats + chat transactions) for the specified or active organization.\nOnly accessible by users with 'admin' or 'owner' role in the target organization."
        },
        {
          "info": {
            "name": "Get Organization Details",
            "type": "http"
          },
          "http": {
            "method": "GET",
            "url": "{{baseUrl}}/app/v1/orgs/details/:org_id",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "path"
              }
            ],
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Get Organization Details"
        },
        {
          "info": {
            "name": "Update Organization Profiles",
            "type": "http"
          },
          "http": {
            "method": "PATCH",
            "url": "{{baseUrl}}/app/v1/orgs/profiles/:org_id",
            "params": [
              {
                "name": "org_id",
                "value": "",
                "type": "path"
              }
            ],
            "body": {
              "type": "json",
              "data": "{}"
            },
            "auth": {
              "type": "bearer",
              "token": "{{bearerToken}}"
            }
          },
          "docs": "Update Organization Profiles"
        }
      ]
    }
  ],
  "bundled": true
}